├── .gitignore ├── .gitlab-ci.yml ├── .golangci.yaml ├── AUTHORS ├── LICENSE ├── NEWS ├── README.md ├── RELEASES.md ├── docs └── cheat-sheet-on-releases.md ├── go.mod ├── go.sum ├── host ├── config.go ├── config_test.go ├── configautodetect.go ├── efivarfs.go ├── host_test.go ├── network │ ├── download.go │ ├── download_test.go │ ├── network.go │ └── network_test.go ├── recovery.go ├── storage.go └── tpm.go ├── internal ├── certutil │ └── certutil.go └── jsonutil │ ├── jsonutil.go │ └── jsonutil_test.go ├── metadata └── metadata.go ├── opts ├── error.go ├── opts.go ├── opts_test.go └── testdata │ ├── cert.pem │ ├── cert_bad_cert.pem │ ├── cert_bad_pem.pem │ ├── certs.pem │ ├── host_bad_unset.json │ ├── host_good_all_set.json │ ├── key.pem │ ├── trust_policy_bad_unset.json │ └── trust_policy_good_all_set.json ├── ospkg ├── descriptor.go ├── descriptor_test.go ├── fetchmethod.go ├── fetchmethod_test.go ├── manifest.go ├── ospkg.go ├── signature.go └── zip.go ├── stboot.go ├── stboot_test.go ├── sterror ├── sterror.go └── sterror_test.go ├── stlog ├── stlog.go └── stlog_test.go ├── trust ├── policy.go └── policy_test.go └── vendor ├── github.com ├── davecgh │ └── go-spew │ │ ├── LICENSE │ │ └── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── format.go │ │ └── spew.go ├── dustin │ └── go-humanize │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.markdown │ │ ├── big.go │ │ ├── bigbytes.go │ │ ├── bytes.go │ │ ├── comma.go │ │ ├── commaf.go │ │ ├── ftoa.go │ │ ├── humanize.go │ │ ├── number.go │ │ ├── ordinals.go │ │ ├── si.go │ │ └── times.go ├── google │ ├── go-tpm │ │ ├── LICENSE │ │ ├── tpm │ │ │ ├── commands.go │ │ │ ├── constants.go │ │ │ ├── errors.go │ │ │ ├── open_other.go │ │ │ ├── open_windows.go │ │ │ ├── pcrs.go │ │ │ ├── structures.go │ │ │ ├── testing.md │ │ │ ├── tpm.go │ │ │ └── verify.go │ │ ├── tpm2 │ │ │ ├── README.md │ │ │ ├── constants.go │ │ │ ├── error.go │ │ │ ├── kdf.go │ │ │ ├── open_other.go │ │ │ ├── open_windows.go │ │ │ ├── structures.go │ │ │ └── tpm2.go │ │ └── tpmutil │ │ │ ├── encoding.go │ │ │ ├── poll_other.go │ │ │ ├── poll_unix.go │ │ │ ├── run.go │ │ │ ├── run_other.go │ │ │ ├── run_windows.go │ │ │ ├── structures.go │ │ │ └── tbs │ │ │ └── tbs_windows.go │ └── uuid │ │ ├── .travis.yml │ │ ├── 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 ├── insomniacslk │ └── dhcp │ │ ├── CONTRIBUTORS.md │ │ ├── LICENSE │ │ ├── dhcpv4 │ │ ├── bindtointerface.go │ │ ├── defaults.go │ │ ├── dhcpv4.go │ │ ├── fuzz.go │ │ ├── modifiers.go │ │ ├── nclient4 │ │ │ ├── client.go │ │ │ ├── conn_linux.go │ │ │ ├── ipv4.go │ │ │ └── lease.go │ │ ├── option_generic.go │ │ ├── option_ip.go │ │ ├── option_ip_address_lease_time.go │ │ ├── option_ips.go │ │ ├── option_maximum_dhcp_message_size.go │ │ ├── option_message_type.go │ │ ├── option_misc.go │ │ ├── option_parameter_request_list.go │ │ ├── option_relay_agent_information.go │ │ ├── option_routes.go │ │ ├── option_string.go │ │ ├── option_strings.go │ │ ├── option_subnet_mask.go │ │ ├── option_vivc.go │ │ ├── options.go │ │ └── types.go │ │ ├── dhcpv6 │ │ ├── defaults.go │ │ ├── dhcpv6.go │ │ ├── dhcpv6message.go │ │ ├── dhcpv6relay.go │ │ ├── duid.go │ │ ├── fuzz.go │ │ ├── iputils.go │ │ ├── modifiers.go │ │ ├── nclient6 │ │ │ └── client.go │ │ ├── option_4rd.go │ │ ├── option_archtype.go │ │ ├── option_bootfileparam.go │ │ ├── option_bootfileurl.go │ │ ├── option_clientid.go │ │ ├── option_clientlinklayeraddress.go │ │ ├── option_dhcpv4_msg.go │ │ ├── option_dhcpv4_o_dhcpv6_server.go │ │ ├── option_dns.go │ │ ├── option_domainsearchlist.go │ │ ├── option_elapsedtime.go │ │ ├── option_fqdn.go │ │ ├── option_iaaddress.go │ │ ├── option_iapd.go │ │ ├── option_iaprefix.go │ │ ├── option_informationrefreshtime.go │ │ ├── option_interfaceid.go │ │ ├── option_nii.go │ │ ├── option_nontemporaryaddress.go │ │ ├── option_ntp_server.go │ │ ├── option_relaymsg.go │ │ ├── option_relayport.go │ │ ├── option_remoteid.go │ │ ├── option_requestedoption.go │ │ ├── option_serverid.go │ │ ├── option_statuscode.go │ │ ├── option_temporaryaddress.go │ │ ├── option_userclass.go │ │ ├── option_vendor_opts.go │ │ ├── option_vendorclass.go │ │ ├── options.go │ │ └── types.go │ │ ├── iana │ │ ├── archtype.go │ │ ├── entid.go │ │ ├── hwtypes.go │ │ ├── iana.go │ │ └── statuscodes.go │ │ ├── interfaces │ │ ├── bindtodevice_bsd.go │ │ ├── bindtodevice_darwin.go │ │ ├── bindtodevice_linux.go │ │ ├── bindtodevice_windows.go │ │ └── interfaces.go │ │ └── rfc1035label │ │ └── label.go ├── klauspost │ └── compress │ │ ├── LICENSE │ │ ├── fse │ │ ├── README.md │ │ ├── bitreader.go │ │ ├── bitwriter.go │ │ ├── bytereader.go │ │ ├── compress.go │ │ ├── decompress.go │ │ └── fse.go │ │ ├── huff0 │ │ ├── .gitignore │ │ ├── README.md │ │ ├── bitreader.go │ │ ├── bitwriter.go │ │ ├── bytereader.go │ │ ├── compress.go │ │ ├── decompress.go │ │ └── huff0.go │ │ ├── snappy │ │ ├── .gitignore │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README │ │ ├── decode.go │ │ ├── decode_amd64.go │ │ ├── decode_amd64.s │ │ ├── decode_other.go │ │ ├── encode.go │ │ ├── encode_amd64.go │ │ ├── encode_amd64.s │ │ ├── encode_other.go │ │ ├── runbench.cmd │ │ └── snappy.go │ │ └── zstd │ │ ├── README.md │ │ ├── bitreader.go │ │ ├── bitwriter.go │ │ ├── blockdec.go │ │ ├── blockenc.go │ │ ├── blocktype_string.go │ │ ├── bytebuf.go │ │ ├── bytereader.go │ │ ├── decoder.go │ │ ├── decoder_options.go │ │ ├── enc_better.go │ │ ├── enc_dfast.go │ │ ├── enc_fast.go │ │ ├── enc_params.go │ │ ├── encoder.go │ │ ├── encoder_options.go │ │ ├── framedec.go │ │ ├── frameenc.go │ │ ├── fse_decoder.go │ │ ├── fse_encoder.go │ │ ├── fse_predefined.go │ │ ├── hash.go │ │ ├── history.go │ │ ├── internal │ │ └── xxhash │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── xxhash.go │ │ │ ├── xxhash_amd64.go │ │ │ ├── xxhash_amd64.s │ │ │ ├── xxhash_other.go │ │ │ └── xxhash_safe.go │ │ ├── seqdec.go │ │ ├── seqenc.go │ │ ├── snappy.go │ │ └── zstd.go ├── mdlayher │ ├── ethernet │ │ ├── .travis.yml │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── ethernet.go │ │ ├── fuzz.go │ │ ├── string.go │ │ └── vlan.go │ └── raw │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── raw.go │ │ ├── raw_bsd.go │ │ ├── raw_direction_bsd.go │ │ ├── raw_direction_openbsd.go │ │ ├── raw_linux.go │ │ ├── raw_others.go │ │ └── staticcheck.conf ├── pierrec │ └── lz4 │ │ └── v4 │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── internal │ │ ├── lz4block │ │ │ ├── block.go │ │ │ ├── blocks.go │ │ │ ├── decode_amd64.s │ │ │ ├── decode_arm.s │ │ │ ├── decode_arm64.s │ │ │ ├── decode_asm.go │ │ │ └── decode_other.go │ │ ├── lz4errors │ │ │ └── errors.go │ │ ├── lz4stream │ │ │ ├── block.go │ │ │ ├── frame.go │ │ │ └── frame_gen.go │ │ └── xxh32 │ │ │ ├── xxh32zero.go │ │ │ ├── xxh32zero_arm.go │ │ │ ├── xxh32zero_arm.s │ │ │ └── xxh32zero_other.go │ │ ├── lz4.go │ │ ├── options.go │ │ ├── options_gen.go │ │ ├── reader.go │ │ ├── state.go │ │ ├── state_gen.go │ │ └── writer.go ├── pmezard │ └── go-difflib │ │ ├── LICENSE │ │ └── difflib │ │ └── difflib.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 │ │ └── require │ │ ├── doc.go │ │ ├── forward_requirements.go │ │ ├── require.go │ │ ├── require.go.tmpl │ │ ├── require_forward.go │ │ ├── require_forward.go.tmpl │ │ └── requirements.go ├── u-root │ ├── u-root │ │ ├── AUTHORS │ │ ├── LICENSE │ │ └── pkg │ │ │ ├── align │ │ │ └── align.go │ │ │ ├── boot │ │ │ ├── boot.go │ │ │ ├── bzimage │ │ │ │ ├── bzimage.go │ │ │ │ ├── bzimage_decompress.go │ │ │ │ ├── header.go │ │ │ │ └── kver.go │ │ │ ├── ibft │ │ │ │ └── ibft.go │ │ │ ├── image │ │ │ │ └── image.go │ │ │ ├── initrd.go │ │ │ ├── kexec │ │ │ │ ├── doc.go │ │ │ │ ├── kexec_fileload_implemented_linux.go │ │ │ │ ├── kexec_fileload_other_linux.go │ │ │ │ ├── kexec_load_linux.go │ │ │ │ ├── kexec_reboot_linux.go │ │ │ │ ├── memory_linux.go │ │ │ │ └── object.go │ │ │ ├── linux.go │ │ │ ├── linux │ │ │ │ ├── debug.go │ │ │ │ ├── doc.go │ │ │ │ ├── load_linux_amd64.go │ │ │ │ ├── load_linux_arm64.go │ │ │ │ ├── load_other_linux.go │ │ │ │ └── opts.go │ │ │ ├── multiboot.go │ │ │ ├── multiboot │ │ │ │ ├── description.go │ │ │ │ ├── header.go │ │ │ │ ├── info.go │ │ │ │ ├── internal │ │ │ │ │ └── trampoline │ │ │ │ │ │ ├── trampoline.go │ │ │ │ │ │ ├── trampoline_linux_amd64.go │ │ │ │ │ │ └── trampoline_linux_amd64.s │ │ │ │ ├── module.go │ │ │ │ ├── multiboot.go │ │ │ │ ├── mutiboot_info.go │ │ │ │ └── mutiheader.go │ │ │ ├── purgatory │ │ │ │ ├── asm.go │ │ │ │ ├── purg_load.go │ │ │ │ └── purgatory.go │ │ │ └── util │ │ │ │ └── reader.go │ │ │ ├── cpio │ │ │ ├── archive.go │ │ │ ├── const.go │ │ │ ├── cpio.go │ │ │ ├── fs_plan9.go │ │ │ ├── fs_unix.go │ │ │ ├── mknod_freebsd.go │ │ │ ├── mknod_unix.go │ │ │ ├── newc.go │ │ │ ├── sysinfo_darwin.go │ │ │ ├── sysinfo_freebsd.go │ │ │ ├── sysinfo_linux.go │ │ │ ├── sysinfo_plan9.go │ │ │ └── utils.go │ │ │ ├── dhclient │ │ │ ├── dhclient.go │ │ │ ├── dhcp4.go │ │ │ ├── dhcp6.go │ │ │ ├── iface.go │ │ │ └── iscsiuri.go │ │ │ ├── dt │ │ │ ├── fdt_linux.go │ │ │ ├── node.go │ │ │ ├── print.go │ │ │ └── walk.go │ │ │ ├── efivarfs │ │ │ ├── doc.go │ │ │ ├── fs.go │ │ │ ├── varfs.go │ │ │ └── vars.go │ │ │ ├── ls │ │ │ ├── fileinfo_plan9.go │ │ │ ├── fileinfo_unix.go │ │ │ └── ls.go │ │ │ ├── mount │ │ │ ├── fs_linux.go │ │ │ ├── magic.go │ │ │ ├── mount_linux.go │ │ │ └── switch_root_linux.go │ │ │ ├── tss │ │ │ ├── capabilities.go │ │ │ ├── constants.go │ │ │ ├── nvram.go │ │ │ ├── pcr.go │ │ │ ├── structures.go │ │ │ ├── tpm_linux.go │ │ │ └── tss.go │ │ │ ├── ubinary │ │ │ ├── big_endian.go │ │ │ ├── doc.go │ │ │ └── little_endian.go │ │ │ ├── uio │ │ │ ├── alignreader.go │ │ │ ├── alignwriter.go │ │ │ ├── archivereader.go │ │ │ ├── buffer.go │ │ │ ├── cached.go │ │ │ ├── lazy.go │ │ │ ├── linewriter.go │ │ │ ├── multiwriter.go │ │ │ ├── null.go │ │ │ ├── progress.go │ │ │ ├── reader.go │ │ │ └── uio.go │ │ │ ├── upath │ │ │ ├── safejoin.go │ │ │ ├── symlink.go │ │ │ └── urootpath.go │ │ │ ├── watchdog │ │ │ └── watchdog.go │ │ │ └── watchdogd │ │ │ └── watchdogd.go │ └── uio │ │ ├── LICENSE │ │ ├── rand │ │ ├── random.go │ │ ├── random_linux.go │ │ ├── random_std.go │ │ ├── random_unix.go │ │ └── random_urandom.go │ │ ├── ubinary │ │ ├── big_endian.go │ │ ├── doc.go │ │ └── little_endian.go │ │ └── uio │ │ ├── alignreader.go │ │ ├── alignwriter.go │ │ ├── buffer.go │ │ ├── cached.go │ │ ├── lazy.go │ │ ├── linewriter.go │ │ ├── multiwriter.go │ │ ├── null.go │ │ ├── progress.go │ │ ├── reader.go │ │ └── uio.go ├── ulikunitz │ └── xz │ │ ├── LICENSE │ │ ├── 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 └── vishvananda │ ├── netlink │ ├── .gitignore │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── addr.go │ ├── addr_linux.go │ ├── bpf_linux.go │ ├── bridge_linux.go │ ├── class.go │ ├── class_linux.go │ ├── conntrack_linux.go │ ├── conntrack_unspecified.go │ ├── devlink_linux.go │ ├── filter.go │ ├── filter_linux.go │ ├── fou.go │ ├── fou_linux.go │ ├── fou_unspecified.go │ ├── genetlink_linux.go │ ├── genetlink_unspecified.go │ ├── gtp_linux.go │ ├── handle_linux.go │ ├── handle_unspecified.go │ ├── inet_diag.go │ ├── ioctl_linux.go │ ├── ipset_linux.go │ ├── link.go │ ├── link_linux.go │ ├── link_tuntap_linux.go │ ├── neigh.go │ ├── neigh_linux.go │ ├── netlink.go │ ├── netlink_linux.go │ ├── netlink_unspecified.go │ ├── netns_linux.go │ ├── netns_unspecified.go │ ├── nl │ │ ├── addr_linux.go │ │ ├── bridge_linux.go │ │ ├── conntrack_linux.go │ │ ├── devlink_linux.go │ │ ├── genetlink_linux.go │ │ ├── ipset_linux.go │ │ ├── link_linux.go │ │ ├── lwt_linux.go │ │ ├── mpls_linux.go │ │ ├── nl_linux.go │ │ ├── nl_unspecified.go │ │ ├── parse_attr_linux.go │ │ ├── rdma_link_linux.go │ │ ├── route_linux.go │ │ ├── seg6_linux.go │ │ ├── seg6local_linux.go │ │ ├── syscall.go │ │ ├── tc_linux.go │ │ ├── xfrm_linux.go │ │ ├── xfrm_monitor_linux.go │ │ ├── xfrm_policy_linux.go │ │ └── xfrm_state_linux.go │ ├── order.go │ ├── protinfo.go │ ├── protinfo_linux.go │ ├── qdisc.go │ ├── qdisc_linux.go │ ├── rdma_link_linux.go │ ├── route.go │ ├── route_linux.go │ ├── route_unspecified.go │ ├── rule.go │ ├── rule_linux.go │ ├── socket.go │ ├── socket_linux.go │ ├── tcp.go │ ├── tcp_linux.go │ ├── xfrm.go │ ├── xfrm_monitor_linux.go │ ├── xfrm_policy.go │ ├── xfrm_policy_linux.go │ ├── xfrm_state.go │ └── xfrm_state_linux.go │ └── netns │ ├── LICENSE │ ├── README.md │ ├── netns.go │ ├── netns_linux.go │ └── netns_unspecified.go ├── golang.org └── x │ ├── net │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ └── bpf │ │ ├── asm.go │ │ ├── constants.go │ │ ├── doc.go │ │ ├── instructions.go │ │ ├── setter.go │ │ ├── vm.go │ │ └── vm_instructions.go │ └── sys │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── internal │ └── unsafeheader │ │ └── unsafeheader.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_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 │ ├── bluetooth_linux.go │ ├── 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 │ ├── epoll_zos.go │ ├── errors_freebsd_386.go │ ├── errors_freebsd_amd64.go │ ├── errors_freebsd_arm.go │ ├── errors_freebsd_arm64.go │ ├── fcntl.go │ ├── fcntl_darwin.go │ ├── fcntl_linux_32bit.go │ ├── fdset.go │ ├── fstatfs_zos.go │ ├── gccgo.go │ ├── gccgo_c.c │ ├── gccgo_linux_amd64.go │ ├── ifreq_linux.go │ ├── ioctl.go │ ├── ioctl_linux.go │ ├── ioctl_zos.go │ ├── mkall.sh │ ├── mkerrors.sh │ ├── 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 │ ├── str.go │ ├── syscall.go │ ├── syscall_aix.go │ ├── syscall_aix_ppc.go │ ├── syscall_aix_ppc64.go │ ├── syscall_bsd.go │ ├── syscall_darwin.1_12.go │ ├── syscall_darwin.1_13.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_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_mips64.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 │ ├── 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_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_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 │ ├── zsyscall_aix_ppc.go │ ├── zsyscall_aix_ppc64.go │ ├── zsyscall_aix_ppc64_gc.go │ ├── zsyscall_aix_ppc64_gccgo.go │ ├── zsyscall_darwin_amd64.1_13.go │ ├── zsyscall_darwin_amd64.1_13.s │ ├── zsyscall_darwin_amd64.go │ ├── zsyscall_darwin_amd64.s │ ├── zsyscall_darwin_arm64.1_13.go │ ├── zsyscall_darwin_arm64.1_13.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_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_amd64.go │ ├── zsyscall_openbsd_arm.go │ ├── zsyscall_openbsd_arm64.go │ ├── zsyscall_openbsd_mips64.go │ ├── 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 │ ├── 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_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_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_illumos_amd64.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_solaris_amd64.go │ └── ztypes_zos_s390x.go ├── gopkg.in └── yaml.v3 │ ├── .travis.yml │ ├── 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 /.gitignore: -------------------------------------------------------------------------------- 1 | stboot 2 | out/** 3 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | 2 | stages: 3 | - build 4 | - test 5 | 6 | golangci-lint v1.50.1: 7 | stage: test 8 | image: golangci/golangci-lint:v1.50.1 9 | script: 10 | - golangci-lint --version 11 | - golangci-lint run -v 12 | 13 | staticcheck v0.3.3: 14 | stage: test 15 | image: golang:1.19 16 | script: 17 | - go install honnef.co/go/tools/cmd/staticcheck@v0.3.3 18 | - staticcheck ./... 19 | 20 | compile go 1.19: 21 | stage: build 22 | image: golang:1.19 23 | script: 24 | - go build -v ./... 25 | 26 | unittests: 27 | stage: test 28 | image: golang:1.19 29 | script: 30 | - go test -race -v ./... 31 | 32 | test-report: 33 | stage: test 34 | image: golang:1.19 35 | script: 36 | - go install gotest.tools/gotestsum@latest 37 | - gotestsum --junitfile report.xml --format testname 38 | artifacts: 39 | when: always 40 | reports: 41 | junit: report.xml 42 | 43 | coverage: 44 | stage: test 45 | image: golang:1.19 46 | script: 47 | - go test ./... -coverprofile=coverage.txt -covermode count 48 | - go install github.com/boumenot/gocover-cobertura@latest 49 | - gocover-cobertura < coverage.txt > coverage.xml 50 | artifacts: 51 | reports: 52 | coverage_report: 53 | coverage_format: cobertura 54 | path: coverage.xml 55 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Authors of stboot 2 | 3 | The copyright on stboot is held by the respective authors (or their 4 | organizations/employers). 5 | 6 | Unless file-specific copyright headers say otherwise, stboot is 7 | permissively licensed according to the BSD 2-Clause License (see the 8 | LICENSE file). 9 | 10 | This file contains only a summary; for more fine-grained information 11 | on who authored a particular file or feature, please refer to the 12 | version control history at: 13 | 14 | https://git.glasklar.is/system-transparency/core/stboot 15 | 16 | For contributions where copyrights are held by an organization, e.g., 17 | the author's employer, the copyright holder should be identified by 18 | the commit, preferably by using an author email address belonging to 19 | the organization, or otherwise explained in the commit message. 20 | 21 | File-specific copyright headers should be used when necessary to 22 | document the origin of a file's contents, e.g., for code copied from 23 | other sources, or governed by different license requirements. 24 | 25 | Authors, in chronological order of initial contribution: 26 | 27 | Jens Drenhaus 28 | Marcello Sylvester Bauer 29 | Christopher Meis 30 | Björn Töpel 31 | Marvin Drees 32 | Linus Schroeder 33 | Fabian Wienand 34 | Morten Linderud 35 | Linus Nordberg 36 | Niels Möller 37 | Kai Michaelis 38 | Daniel Lublin 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2021, stboot authors 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | NEWS for stboot v0.2.2 2 | 3 | First advertised release following the common System Transparency release 4 | policy. The previous release v0.2.1 [1] was a random snapshot of the 5 | repository with a tag and dump of the recent commit messages as release info. 6 | 7 | Changed since v0.2.1: 8 | 9 | * Change the order of Host Configuration auto-detect order to prefer loading 10 | from initrams over loading from EFI-NVRAM. 11 | 12 | This release has been tested to work with: 13 | 14 | * Artifacts being produced by stmgr v0.2.1 [2] 15 | 16 | This release implements the specifications at [3]. 17 | 18 | [1] https://git.glasklar.is/system-transparency/core/stboot/-/releases/v0.2.1 19 | [2] https://git.glasklar.is/system-transparency/core/stmgr/-/tree/v0.2.1 20 | [3] https://git.glasklar.is/system-transparency/project/documentation/-/tree/dd4469e99ae35faf5d2ea068066627559e4a71ef/docs.system-transparency.org/content/docs/reference 21 | -------------------------------------------------------------------------------- /host/efivarfs.go: -------------------------------------------------------------------------------- 1 | package host 2 | 3 | import ( 4 | "bytes" 5 | 6 | "github.com/u-root/u-root/pkg/efivarfs" 7 | "system-transparency.org/stboot/sterror" 8 | ) 9 | 10 | func readEFIVar(name string) (*bytes.Reader, error) { 11 | const operation = sterror.Op("read EFI var") 12 | 13 | e, err := efivarfs.New() 14 | if err != nil { 15 | return nil, sterror.E(ErrScope, operation, err.Error()) 16 | } 17 | 18 | _, r, err := efivarfs.SimpleReadVariable(e, name) 19 | if err != nil { 20 | return nil, sterror.E(ErrScope, operation, err.Error()) 21 | } 22 | 23 | return r, nil 24 | } 25 | -------------------------------------------------------------------------------- /host/host_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 the System Transparency Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package host 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | func Test(t *testing.T) { 12 | // Empty test to calculate coverage right. 13 | } 14 | -------------------------------------------------------------------------------- /host/network/network_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 the System Transparency Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package network 6 | 7 | import ( 8 | "net" 9 | "os" 10 | "path/filepath" 11 | "testing" 12 | ) 13 | 14 | func TestSetDNSServer(t *testing.T) { 15 | ip1 := net.ParseIP("0.0.0.0") 16 | ip2 := net.ParseIP("8.8.8.8") 17 | want := "nameserver 0.0.0.0\nnameserver 8.8.8.8\n" 18 | 19 | dest := filepath.Join(t.TempDir(), "resolve.conf") 20 | 21 | err := setDNSServer([]*net.IP{&ip1, &ip2}, dest) 22 | if err != nil { 23 | t.Fatal(err) 24 | } 25 | 26 | got, err := os.ReadFile(dest) 27 | if err != nil { 28 | t.Fatal(err) 29 | } 30 | 31 | if string(got) != want { 32 | t.Errorf("got %q, want %q", got, want) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /internal/certutil/certutil.go: -------------------------------------------------------------------------------- 1 | package certutil 2 | 3 | import ( 4 | "crypto/x509" 5 | "encoding/pem" 6 | "errors" 7 | ) 8 | 9 | func DecodePEM(pemBytes []byte) ([]*x509.Certificate, error) { 10 | var certs []*x509.Certificate 11 | 12 | for len(pemBytes) > 0 { 13 | block, rest := pem.Decode(pemBytes) 14 | if block == nil { 15 | break 16 | } 17 | 18 | if block.Type != "CERTIFICATE" { 19 | pemBytes = rest 20 | 21 | continue 22 | } 23 | 24 | cert, err := x509.ParseCertificate(block.Bytes) 25 | if err != nil { 26 | return nil, err 27 | } 28 | 29 | certs = append(certs, cert) 30 | pemBytes = rest 31 | } 32 | 33 | if len(certs) == 0 { 34 | return nil, errors.New("no PEM block of type CERTIFICATE found") 35 | } 36 | 37 | return certs, nil 38 | } 39 | -------------------------------------------------------------------------------- /internal/jsonutil/jsonutil.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 the System Transparency Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package host exposes functionality to interact with the host mashine. 6 | package jsonutil 7 | 8 | import ( 9 | "reflect" 10 | ) 11 | 12 | const Null = "null" 13 | 14 | // Tags returns the json tags of struct or struct pointer s. 15 | func Tags(s interface{}) []string { 16 | tags := make([]string, 0) 17 | 18 | typ := reflect.TypeOf(s) 19 | if typ.Kind() == reflect.Ptr { 20 | typ = typ.Elem() 21 | } 22 | 23 | if typ.Kind() != reflect.Struct { 24 | return []string{} 25 | } 26 | 27 | for i := 0; i < typ.NumField(); i++ { 28 | field := typ.Field(i) 29 | if tag := field.Tag.Get("json"); tag != "" { 30 | tags = append(tags, tag) 31 | } 32 | } 33 | 34 | return tags 35 | } 36 | -------------------------------------------------------------------------------- /opts/error.go: -------------------------------------------------------------------------------- 1 | package opts 2 | 3 | // Error reports problems while lodasing and validating configuration data. 4 | type Error string 5 | 6 | // Error implements error interface. 7 | func (e Error) Error() string { 8 | return string(e) 9 | } 10 | 11 | // ErrNonNil is used for testing. 12 | const ErrNonNil = Error("") 13 | -------------------------------------------------------------------------------- /opts/testdata/cert_bad_pem.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | FOO 3 | -----END CERTIFICATE----- 4 | -------------------------------------------------------------------------------- /opts/testdata/host_bad_unset.json: -------------------------------------------------------------------------------- 1 | { 2 | "network_mode":null, 3 | "host_ip":null, 4 | "gateway":null, 5 | "dns":null, 6 | "network_interface":null, 7 | "provisioning_urls":null, 8 | "identity":null, 9 | "authentication":null, 10 | "timestamp":null, 11 | "network_interfaces":null, 12 | "bonding_mode":null, 13 | "bond_name":null 14 | } 15 | -------------------------------------------------------------------------------- /opts/testdata/host_good_all_set.json: -------------------------------------------------------------------------------- 1 | { 2 | "network_mode":"static", 3 | "host_ip":"127.0.0.1/24", 4 | "gateway":"127.0.0.1", 5 | "dns":["127.0.0.1"], 6 | "network_interfaces":null, 7 | "ospkg_pointer":"http://server.com", 8 | "provisioning_urls":["http://server.com"], 9 | "identity":"some_id", 10 | "authentication":"1234", 11 | "timestamp":1, 12 | "bonding_mode": "", 13 | "bond_name": "" 14 | } 15 | -------------------------------------------------------------------------------- /opts/testdata/trust_policy_bad_unset.json: -------------------------------------------------------------------------------- 1 | { 2 | "ospkg_signature_threshold": null, 3 | "ospkg_fetch_method": null 4 | } 5 | -------------------------------------------------------------------------------- /opts/testdata/trust_policy_good_all_set.json: -------------------------------------------------------------------------------- 1 | { 2 | "ospkg_signature_threshold": 1, 3 | "ospkg_fetch_method": "network" 4 | } 5 | -------------------------------------------------------------------------------- /ospkg/descriptor_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 the System Transparency Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ospkg 6 | 7 | import ( 8 | "testing" 9 | 10 | "github.com/stretchr/testify/require" 11 | ) 12 | 13 | func TestBytes(t *testing.T) { 14 | var d = Descriptor{ 15 | PkgURL: "test.com", 16 | Certificates: [][]byte{{1, 2, 3}, {1, 2, 3}}, 17 | Signatures: [][]byte{{'a', 'b', 'c'}, {'a', 'b', 'c'}}, 18 | } 19 | 20 | b, err := d.Bytes() 21 | t.Log(b) 22 | require.NoError(t, err) 23 | } 24 | 25 | func TestDescriptorFromBytes(t *testing.T) { 26 | var b = []byte{ 27 | 123, 34, 111, 115, 95, 112, 107, 103, 95, 117, 114, 108, 28 | 34, 58, 34, 116, 101, 115, 116, 46, 99, 111, 109, 34, 44, 29 | 34, 99, 101, 114, 116, 105, 102, 105, 99, 97, 116, 101, 115, 30 | 34, 58, 91, 34, 65, 81, 73, 68, 34, 44, 34, 65, 81, 73, 68, 31 | 34, 93, 44, 34, 115, 105, 103, 110, 97, 116, 117, 114, 101, 32 | 115, 34, 58, 91, 34, 89, 87, 74, 106, 34, 44, 34, 89, 87, 74, 33 | 106, 34, 93, 125, 34 | } 35 | 36 | d, err := DescriptorFromBytes(b) 37 | t.Log(d) 38 | require.NoError(t, err) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - 1.3.x 5 | - 1.5.x 6 | - 1.6.x 7 | - 1.7.x 8 | - 1.8.x 9 | - 1.9.x 10 | - master 11 | matrix: 12 | allow_failures: 13 | - go: master 14 | fast_finish: true 15 | install: 16 | - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). 17 | script: 18 | - go get -t -v ./... 19 | - diff -u <(echo -n) <(gofmt -d -s .) 20 | - go tool vet . 21 | - go test -v -race ./... 22 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2005-2008 Dustin Sallings 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | 21 | 22 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/big.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import ( 4 | "math/big" 5 | ) 6 | 7 | // order of magnitude (to a max order) 8 | func oomm(n, b *big.Int, maxmag int) (float64, int) { 9 | mag := 0 10 | m := &big.Int{} 11 | for n.Cmp(b) >= 0 { 12 | n.DivMod(n, b, m) 13 | mag++ 14 | if mag == maxmag && maxmag >= 0 { 15 | break 16 | } 17 | } 18 | return float64(n.Int64()) + (float64(m.Int64()) / float64(b.Int64())), mag 19 | } 20 | 21 | // total order of magnitude 22 | // (same as above, but with no upper limit) 23 | func oom(n, b *big.Int) (float64, int) { 24 | mag := 0 25 | m := &big.Int{} 26 | for n.Cmp(b) >= 0 { 27 | n.DivMod(n, b, m) 28 | mag++ 29 | } 30 | return float64(n.Int64()) + (float64(m.Int64()) / float64(b.Int64())), mag 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/commaf.go: -------------------------------------------------------------------------------- 1 | // +build go1.6 2 | 3 | package humanize 4 | 5 | import ( 6 | "bytes" 7 | "math/big" 8 | "strings" 9 | ) 10 | 11 | // BigCommaf produces a string form of the given big.Float in base 10 12 | // with commas after every three orders of magnitude. 13 | func BigCommaf(v *big.Float) string { 14 | buf := &bytes.Buffer{} 15 | if v.Sign() < 0 { 16 | buf.Write([]byte{'-'}) 17 | v.Abs(v) 18 | } 19 | 20 | comma := []byte{','} 21 | 22 | parts := strings.Split(v.Text('f', -1), ".") 23 | pos := 0 24 | if len(parts[0])%3 != 0 { 25 | pos += len(parts[0]) % 3 26 | buf.WriteString(parts[0][:pos]) 27 | buf.Write(comma) 28 | } 29 | for ; pos < len(parts[0]); pos += 3 { 30 | buf.WriteString(parts[0][pos : pos+3]) 31 | buf.Write(comma) 32 | } 33 | buf.Truncate(buf.Len() - 1) 34 | 35 | if len(parts) > 1 { 36 | buf.Write([]byte{'.'}) 37 | buf.WriteString(parts[1]) 38 | } 39 | return buf.String() 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/ftoa.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import ( 4 | "strconv" 5 | "strings" 6 | ) 7 | 8 | func stripTrailingZeros(s string) string { 9 | offset := len(s) - 1 10 | for offset > 0 { 11 | if s[offset] == '.' { 12 | offset-- 13 | break 14 | } 15 | if s[offset] != '0' { 16 | break 17 | } 18 | offset-- 19 | } 20 | return s[:offset+1] 21 | } 22 | 23 | func stripTrailingDigits(s string, digits int) string { 24 | if i := strings.Index(s, "."); i >= 0 { 25 | if digits <= 0 { 26 | return s[:i] 27 | } 28 | i++ 29 | if i+digits >= len(s) { 30 | return s 31 | } 32 | return s[:i+digits] 33 | } 34 | return s 35 | } 36 | 37 | // Ftoa converts a float to a string with no trailing zeros. 38 | func Ftoa(num float64) string { 39 | return stripTrailingZeros(strconv.FormatFloat(num, 'f', 6, 64)) 40 | } 41 | 42 | // FtoaWithDigits converts a float to a string but limits the resulting string 43 | // to the given number of decimal places, and no trailing zeros. 44 | func FtoaWithDigits(num float64, digits int) string { 45 | return stripTrailingZeros(stripTrailingDigits(strconv.FormatFloat(num, 'f', 6, 64), digits)) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/humanize.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package humanize converts boring ugly numbers to human-friendly strings and back. 3 | 4 | Durations can be turned into strings such as "3 days ago", numbers 5 | representing sizes like 82854982 into useful strings like, "83 MB" or 6 | "79 MiB" (whichever you prefer). 7 | */ 8 | package humanize 9 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/ordinals.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import "strconv" 4 | 5 | // Ordinal gives you the input number in a rank/ordinal format. 6 | // 7 | // Ordinal(3) -> 3rd 8 | func Ordinal(x int) string { 9 | suffix := "th" 10 | switch x % 10 { 11 | case 1: 12 | if x%100 != 11 { 13 | suffix = "st" 14 | } 15 | case 2: 16 | if x%100 != 12 { 17 | suffix = "nd" 18 | } 19 | case 3: 20 | if x%100 != 13 { 21 | suffix = "rd" 22 | } 23 | } 24 | return strconv.Itoa(x) + suffix 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-tpm/tpm/open_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, Google LLC All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package tpm 16 | 17 | import ( 18 | "fmt" 19 | "io" 20 | 21 | "github.com/google/go-tpm/tpmutil" 22 | "github.com/google/go-tpm/tpmutil/tbs" 23 | ) 24 | 25 | // OpenTPM opens a channel to the TPM. 26 | func OpenTPM() (io.ReadWriteCloser, error) { 27 | info, err := tbs.GetDeviceInfo() 28 | if err != nil { 29 | return nil, err 30 | } 31 | 32 | if info.TPMVersion != tbs.TPMVersion12 { 33 | return nil, fmt.Errorf("openTPM: device is not a TPM 1.2") 34 | } 35 | 36 | return tpmutil.OpenTPM() 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-tpm/tpm2/open_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, Google LLC All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package tpm2 16 | 17 | import ( 18 | "fmt" 19 | "io" 20 | 21 | "github.com/google/go-tpm/tpmutil" 22 | "github.com/google/go-tpm/tpmutil/tbs" 23 | ) 24 | 25 | // OpenTPM opens a channel to the TPM. 26 | func OpenTPM() (io.ReadWriteCloser, error) { 27 | info, err := tbs.GetDeviceInfo() 28 | if err != nil { 29 | return nil, err 30 | } 31 | 32 | if info.TPMVersion != tbs.TPMVersion20 { 33 | return nil, fmt.Errorf("openTPM: device is not a TPM 2.0") 34 | } 35 | 36 | return tpmutil.OpenTPM() 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-tpm/tpmutil/poll_other.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!darwin 2 | 3 | package tpmutil 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | // Not implemented on Windows. 10 | func poll(f *os.File) error { return nil } 11 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-tpm/tpmutil/poll_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin 2 | 3 | package tpmutil 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | 9 | "golang.org/x/sys/unix" 10 | ) 11 | 12 | // poll blocks until the file descriptor is ready for reading or an error occurs. 13 | func poll(f *os.File) error { 14 | var ( 15 | fds = []unix.PollFd{{ 16 | Fd: int32(f.Fd()), 17 | Events: 0x1, // POLLIN 18 | }} 19 | timeout = -1 // Indefinite timeout 20 | ) 21 | 22 | if _, err := unix.Poll(fds, timeout); err != nil { 23 | return err 24 | } 25 | 26 | // Revents is filled in by the kernel. 27 | // If the expected event happened, Revents should match Events. 28 | if fds[0].Revents != fds[0].Events { 29 | return fmt.Errorf("unexpected poll Revents 0x%x", fds[0].Revents) 30 | } 31 | return nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.4.3 5 | - 1.5.3 6 | - tip 7 | 8 | script: 9 | - go test -v ./... 10 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We definitely welcome patches and contribution to this project! 4 | 5 | ### Legal requirements 6 | 7 | In order to protect both you and ourselves, you will need to sign the 8 | [Contributor License Agreement](https://cla.developers.google.com/clas). 9 | 10 | You may have already signed it for other Google projects. 11 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Paul Borman 2 | bmatsuo 3 | shawnps 4 | theory 5 | jboverfelt 6 | dsymonds 7 | cd1 8 | wallclockbuilder 9 | dansouza 10 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/README.md: -------------------------------------------------------------------------------- 1 | # uuid ![build status](https://travis-ci.org/google/uuid.svg?branch=master) 2 | The uuid package generates and inspects UUIDs based on 3 | [RFC 4122](http://tools.ietf.org/html/rfc4122) 4 | and DCE 1.1: Authentication and Security Services. 5 | 6 | This package is based on the github.com/pborman/uuid package (previously named 7 | code.google.com/p/go-uuid). It differs from these earlier packages in that 8 | a UUID is a 16 byte array rather than a byte slice. One loss due to this 9 | change is the ability to represent an invalid UUID (vs a NIL UUID). 10 | 11 | ###### Install 12 | `go get github.com/google/uuid` 13 | 14 | ###### Documentation 15 | [![GoDoc](https://godoc.org/github.com/google/uuid?status.svg)](http://godoc.org/github.com/google/uuid) 16 | 17 | Full `go doc` style documentation for the package can be viewed online without 18 | installing this package by using the GoDoc site here: 19 | http://pkg.go.dev/github.com/google/uuid 20 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package uuid generates and inspects UUIDs. 6 | // 7 | // UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security 8 | // Services. 9 | // 10 | // A UUID is a 16 byte (128 bit) array. UUIDs may be used as keys to 11 | // maps or compared directly. 12 | package uuid 13 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/marshal.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package uuid 6 | 7 | import "fmt" 8 | 9 | // MarshalText implements encoding.TextMarshaler. 10 | func (uuid UUID) MarshalText() ([]byte, error) { 11 | var js [36]byte 12 | encodeHex(js[:], uuid) 13 | return js[:], nil 14 | } 15 | 16 | // UnmarshalText implements encoding.TextUnmarshaler. 17 | func (uuid *UUID) UnmarshalText(data []byte) error { 18 | id, err := ParseBytes(data) 19 | if err != nil { 20 | return err 21 | } 22 | *uuid = id 23 | return nil 24 | } 25 | 26 | // MarshalBinary implements encoding.BinaryMarshaler. 27 | func (uuid UUID) MarshalBinary() ([]byte, error) { 28 | return uuid[:], nil 29 | } 30 | 31 | // UnmarshalBinary implements encoding.BinaryUnmarshaler. 32 | func (uuid *UUID) UnmarshalBinary(data []byte) error { 33 | if len(data) != 16 { 34 | return fmt.Errorf("invalid UUID (got %d bytes)", len(data)) 35 | } 36 | copy(uuid[:], data) 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/node_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build js 6 | 7 | package uuid 8 | 9 | // getHardwareInterface returns nil values for the JS version of the code. 10 | // This remvoves the "net" dependency, because it is not used in the browser. 11 | // Using the "net" library inflates the size of the transpiled JS code by 673k bytes. 12 | func getHardwareInterface(name string) (string, []byte) { return "", nil } 13 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/node_net.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !js 6 | 7 | package uuid 8 | 9 | import "net" 10 | 11 | var interfaces []net.Interface // cached list of interfaces 12 | 13 | // getHardwareInterface returns the name and hardware address of interface name. 14 | // If name is "" then the name and hardware address of one of the system's 15 | // interfaces is returned. If no interfaces are found (name does not exist or 16 | // there are no interfaces) then "", nil is returned. 17 | // 18 | // Only addresses of at least 6 bytes are returned. 19 | func getHardwareInterface(name string) (string, []byte) { 20 | if interfaces == nil { 21 | var err error 22 | interfaces, err = net.Interfaces() 23 | if err != nil { 24 | return "", nil 25 | } 26 | } 27 | for _, ifs := range interfaces { 28 | if len(ifs.HardwareAddr) >= 6 && (name == "" || name == ifs.Name) { 29 | return ifs.Name, ifs.HardwareAddr 30 | } 31 | } 32 | return "", nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | ## Contributors 2 | 3 | * Andrea Barberio (main author) 4 | * Pablo Mazzini (tons of fixes and new options) 5 | * Sean Karlage (BSDP package, and of tons of improvements to the DHCPv4 package) 6 | * Owen Mooney (several option fixes and modifiers) 7 | * Mikolaj Walczak (asynchronous DHCPv6 client) 8 | * Chris Koch (tons of improvements in DHCPv4 and DHCPv6 internals and interface) 9 | * Akshay Navale, Brandon Bennett and Chris Gorham (ZTPv6 and ZTPv4 packages) 10 | * Anatole Denis (tons of fixes and new options) 11 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv4/bindtointerface.go: -------------------------------------------------------------------------------- 1 | package dhcpv4 2 | 3 | import ( 4 | "github.com/insomniacslk/dhcp/interfaces" 5 | ) 6 | 7 | // BindToInterface (deprecated) redirects to interfaces.BindToInterface 8 | func BindToInterface(fd int, ifname string) error { 9 | return interfaces.BindToInterface(fd, ifname) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv4/defaults.go: -------------------------------------------------------------------------------- 1 | package dhcpv4 2 | 3 | const ( 4 | ServerPort = 67 5 | ClientPort = 68 6 | ) 7 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv4/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package dhcpv4 4 | 5 | import ( 6 | "fmt" 7 | "reflect" 8 | ) 9 | 10 | // Fuzz is the entrypoint for go-fuzz 11 | func Fuzz(data []byte) int { 12 | msg, err := FromBytes(data) 13 | if err != nil { 14 | return 0 15 | } 16 | 17 | serialized := msg.ToBytes() 18 | 19 | // Compared to dhcpv6, dhcpv4 has padding and fixed-size fields containing 20 | // variable-length data; We can't expect the library to output byte-for-byte 21 | // identical packets after a round-trip. 22 | // Instead, we check that after a round-trip, the packet reserializes to the 23 | // same internal representation 24 | rtMsg, err := FromBytes(serialized) 25 | 26 | if err != nil || !reflect.DeepEqual(msg, rtMsg) { 27 | fmt.Printf("Input: %x\n", data) 28 | fmt.Printf("Round-trip: %x\n", serialized) 29 | fmt.Println("Message: ", msg.Summary()) 30 | fmt.Printf("Go repr: %#v\n", msg) 31 | fmt.Println("Reserialized: ", rtMsg.Summary()) 32 | fmt.Printf("Go repr: %#v\n", rtMsg) 33 | if err != nil { 34 | fmt.Printf("Got error while reserializing: %v\n", err) 35 | panic("round-trip error: " + err.Error()) 36 | } 37 | panic("round-trip different: " + msg.Summary()) 38 | } 39 | 40 | return 1 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv4/nclient4/lease.go: -------------------------------------------------------------------------------- 1 | // This is lease support for nclient4 2 | 3 | package nclient4 4 | 5 | import ( 6 | "fmt" 7 | "net" 8 | "time" 9 | 10 | "github.com/insomniacslk/dhcp/dhcpv4" 11 | ) 12 | 13 | // Lease contains a DHCPv4 lease after DORA. 14 | // note: Lease doesn't include binding interface name 15 | type Lease struct { 16 | Offer *dhcpv4.DHCPv4 17 | ACK *dhcpv4.DHCPv4 18 | CreationTime time.Time 19 | } 20 | 21 | // Release send DHCPv4 release messsage to server, based on specified lease. 22 | // release is sent as unicast per RFC2131, section 4.4.4. 23 | // Note: some DHCP server requries of using assigned IP address as source IP, 24 | // use nclient4.WithUnicast to create client for such case. 25 | func (c *Client) Release(lease *Lease, modifiers ...dhcpv4.Modifier) error { 26 | if lease == nil { 27 | return fmt.Errorf("lease is nil") 28 | } 29 | req, err := dhcpv4.NewReleaseFromACK(lease.ACK, modifiers...) 30 | if err != nil { 31 | return fmt.Errorf("fail to create release request,%w", err) 32 | } 33 | _, err = c.conn.WriteTo(req.ToBytes(), &net.UDPAddr{IP: lease.ACK.Options.Get(dhcpv4.OptionServerIdentifier), Port: ServerPort}) 34 | if err == nil { 35 | c.logger.PrintMessage("sent message:", req) 36 | } 37 | return err 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv4/option_generic.go: -------------------------------------------------------------------------------- 1 | package dhcpv4 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // OptionGeneric is an option that only contains the option code and associated 8 | // data. Every option that does not have a specific implementation will fall 9 | // back to this option. 10 | type OptionGeneric struct { 11 | Data []byte 12 | } 13 | 14 | // ToBytes returns a serialized generic option as a slice of bytes. 15 | func (o OptionGeneric) ToBytes() []byte { 16 | return o.Data 17 | } 18 | 19 | // String returns a human-readable representation of a generic option. 20 | func (o OptionGeneric) String() string { 21 | return fmt.Sprintf("%v", o.Data) 22 | } 23 | 24 | // OptGeneric returns a generic option. 25 | func OptGeneric(code OptionCode, value []byte) Option { 26 | return Option{Code: code, Value: OptionGeneric{value}} 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv4/option_ip_address_lease_time.go: -------------------------------------------------------------------------------- 1 | package dhcpv4 2 | 3 | import ( 4 | "math" 5 | "time" 6 | 7 | "github.com/u-root/uio/uio" 8 | ) 9 | 10 | // MaxLeaseTime is the maximum lease time that can be encoded. 11 | var MaxLeaseTime = math.MaxUint32 * time.Second 12 | 13 | // Duration implements the IP address lease time option described by RFC 2132, 14 | // Section 9.2. 15 | type Duration time.Duration 16 | 17 | // FromBytes parses a duration from a byte stream according to RFC 2132, Section 9.2. 18 | func (d *Duration) FromBytes(data []byte) error { 19 | buf := uio.NewBigEndianBuffer(data) 20 | *d = Duration(time.Duration(buf.Read32()) * time.Second) 21 | return buf.FinError() 22 | } 23 | 24 | // ToBytes returns a serialized stream of bytes for this option. 25 | func (d Duration) ToBytes() []byte { 26 | buf := uio.NewBigEndianBuffer(nil) 27 | buf.Write32(uint32(time.Duration(d) / time.Second)) 28 | return buf.Data() 29 | } 30 | 31 | // String returns a human-readable string for this option. 32 | func (d Duration) String() string { 33 | return time.Duration(d).String() 34 | } 35 | 36 | // OptIPAddressLeaseTime returns a new IP address lease time option. 37 | // 38 | // The IP address lease time option is described by RFC 2132, Section 9.2. 39 | func OptIPAddressLeaseTime(d time.Duration) Option { 40 | return Option{Code: OptionIPAddressLeaseTime, Value: Duration(d)} 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv4/option_message_type.go: -------------------------------------------------------------------------------- 1 | package dhcpv4 2 | 3 | // OptMessageType returns a new DHCPv4 Message Type option. 4 | func OptMessageType(m MessageType) Option { 5 | return Option{Code: OptionDHCPMessageType, Value: m} 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv4/option_misc.go: -------------------------------------------------------------------------------- 1 | package dhcpv4 2 | 3 | import ( 4 | "github.com/insomniacslk/dhcp/iana" 5 | "github.com/insomniacslk/dhcp/rfc1035label" 6 | ) 7 | 8 | // OptDomainSearch returns a new domain search option. 9 | // 10 | // The domain search option is described by RFC 3397, Section 2. 11 | func OptDomainSearch(labels *rfc1035label.Labels) Option { 12 | return Option{Code: OptionDNSDomainSearchList, Value: labels} 13 | } 14 | 15 | // OptClientArch returns a new Client System Architecture Type option. 16 | func OptClientArch(archs ...iana.Arch) Option { 17 | return Option{Code: OptionClientSystemArchitectureType, Value: iana.Archs(archs)} 18 | } 19 | 20 | // OptClientIdentifier returns a new Client Identifier option. 21 | func OptClientIdentifier(ident []byte) Option { 22 | return OptGeneric(OptionClientIdentifier, ident) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv4/option_subnet_mask.go: -------------------------------------------------------------------------------- 1 | package dhcpv4 2 | 3 | import ( 4 | "net" 5 | 6 | "github.com/u-root/uio/uio" 7 | ) 8 | 9 | // IPMask represents an option encapsulating the subnet mask. 10 | // 11 | // This option implements the subnet mask option in RFC 2132, Section 3.3. 12 | type IPMask net.IPMask 13 | 14 | // ToBytes returns a serialized stream of bytes for this option. 15 | func (im IPMask) ToBytes() []byte { 16 | if len(im) > net.IPv4len { 17 | return im[:net.IPv4len] 18 | } 19 | return im 20 | } 21 | 22 | // String returns a human-readable string. 23 | func (im IPMask) String() string { 24 | return net.IPMask(im).String() 25 | } 26 | 27 | // FromBytes parses im from data per RFC 2132. 28 | func (im *IPMask) FromBytes(data []byte) error { 29 | buf := uio.NewBigEndianBuffer(data) 30 | *im = IPMask(buf.CopyN(net.IPv4len)) 31 | return buf.FinError() 32 | } 33 | 34 | // OptSubnetMask returns a new DHCPv4 SubnetMask option per RFC 2132, Section 3.3. 35 | func OptSubnetMask(mask net.IPMask) Option { 36 | return Option{ 37 | Code: OptionSubnetMask, 38 | Value: IPMask(mask), 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/defaults.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | import "net" 4 | 5 | // Default ports 6 | const ( 7 | DefaultClientPort = 546 8 | DefaultServerPort = 547 9 | ) 10 | 11 | // Default multicast groups 12 | var ( 13 | AllDHCPRelayAgentsAndServers = net.ParseIP("ff02::1:2") 14 | AllDHCPServers = net.ParseIP("ff05::1:3") 15 | ) 16 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package dhcpv6 4 | 5 | import ( 6 | "bytes" 7 | "fmt" 8 | ) 9 | 10 | // Fuzz is an entrypoint for go-fuzz (github.com/dvyukov/go-fuzz) 11 | func Fuzz(data []byte) int { 12 | msg, err := FromBytes(data) 13 | if err != nil { 14 | return 0 15 | } 16 | 17 | serialized := msg.ToBytes() 18 | if !bytes.Equal(data, serialized) { 19 | rtMsg, err := FromBytes(serialized) 20 | fmt.Printf("Input: %x\n", data) 21 | fmt.Printf("Round-trip: %x\n", serialized) 22 | fmt.Println("Message: ", msg.Summary()) 23 | fmt.Printf("Go repr: %#v\n", msg) 24 | fmt.Println("round-trip reserialized: ", rtMsg.Summary()) 25 | fmt.Printf("Go repr: %#v\n", rtMsg) 26 | if err != nil { 27 | fmt.Printf("failed to parse after deserialize-serialize: %v\n", err) 28 | } 29 | panic("round-trip different") 30 | } 31 | 32 | return 1 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_archtype.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/insomniacslk/dhcp/iana" 7 | ) 8 | 9 | // OptClientArchType represents an option CLIENT_ARCH_TYPE. 10 | // 11 | // This module defines the OptClientArchType structure. 12 | // https://www.ietf.org/rfc/rfc5970.txt 13 | func OptClientArchType(a ...iana.Arch) Option { 14 | return &optClientArchType{Archs: a} 15 | } 16 | 17 | type optClientArchType struct { 18 | iana.Archs 19 | } 20 | 21 | func (op *optClientArchType) Code() OptionCode { 22 | return OptionClientArchType 23 | } 24 | 25 | func (op optClientArchType) String() string { 26 | return fmt.Sprintf("ClientArchType: %s", op.Archs.String()) 27 | } 28 | 29 | // parseOptClientArchType builds an OptClientArchType structure from 30 | // a sequence of bytes The input data does not include option code and 31 | // length bytes. 32 | func parseOptClientArchType(data []byte) (*optClientArchType, error) { 33 | var opt optClientArchType 34 | return &opt, opt.FromBytes(data) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_bootfileurl.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // OptBootFileURL returns a OptionBootfileURL as defined by RFC 5970. 8 | func OptBootFileURL(url string) Option { 9 | return optBootFileURL(url) 10 | } 11 | 12 | type optBootFileURL string 13 | 14 | // Code returns the option code 15 | func (op optBootFileURL) Code() OptionCode { 16 | return OptionBootfileURL 17 | } 18 | 19 | // ToBytes serializes the option and returns it as a sequence of bytes 20 | func (op optBootFileURL) ToBytes() []byte { 21 | return []byte(op) 22 | } 23 | 24 | func (op optBootFileURL) String() string { 25 | return fmt.Sprintf("BootFileURL: %s", string(op)) 26 | } 27 | 28 | // parseOptBootFileURL builds an optBootFileURL structure from a sequence 29 | // of bytes. The input data does not include option code and length bytes. 30 | func parseOptBootFileURL(data []byte) (optBootFileURL, error) { 31 | return optBootFileURL(string(data)), nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_clientid.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // OptClientID represents a Client Identifier option as defined by RFC 3315 8 | // Section 22.2. 9 | func OptClientID(d Duid) Option { 10 | return &optClientID{d} 11 | } 12 | 13 | type optClientID struct { 14 | Duid 15 | } 16 | 17 | func (*optClientID) Code() OptionCode { 18 | return OptionClientID 19 | } 20 | 21 | func (op *optClientID) String() string { 22 | return fmt.Sprintf("ClientID: %v", op.Duid.String()) 23 | } 24 | 25 | // parseOptClientID builds an OptClientId structure from a sequence 26 | // of bytes. The input data does not include option code and length 27 | // bytes. 28 | func parseOptClientID(data []byte) (*optClientID, error) { 29 | cid, err := DuidFromBytes(data) 30 | if err != nil { 31 | return nil, err 32 | } 33 | return &optClientID{*cid}, nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_dhcpv4_msg.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/insomniacslk/dhcp/dhcpv4" 7 | ) 8 | 9 | // OptDHCPv4Msg represents a OptionDHCPv4Msg option 10 | // 11 | // This module defines the OptDHCPv4Msg structure. 12 | // https://www.ietf.org/rfc/rfc7341.txt 13 | type OptDHCPv4Msg struct { 14 | Msg *dhcpv4.DHCPv4 15 | } 16 | 17 | // Code returns the option code 18 | func (op *OptDHCPv4Msg) Code() OptionCode { 19 | return OptionDHCPv4Msg 20 | } 21 | 22 | // ToBytes returns the option serialized to bytes. 23 | func (op *OptDHCPv4Msg) ToBytes() []byte { 24 | return op.Msg.ToBytes() 25 | } 26 | 27 | func (op *OptDHCPv4Msg) String() string { 28 | return fmt.Sprintf("OptDHCPv4Msg{%v}", op.Msg) 29 | } 30 | 31 | // ParseOptDHCPv4Msg builds an OptDHCPv4Msg structure 32 | // from a sequence of bytes. The input data does not include option code and length 33 | // bytes. 34 | func ParseOptDHCPv4Msg(data []byte) (*OptDHCPv4Msg, error) { 35 | var opt OptDHCPv4Msg 36 | var err error 37 | opt.Msg, err = dhcpv4.FromBytes(data) 38 | return &opt, err 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_dns.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | 7 | "github.com/u-root/uio/uio" 8 | ) 9 | 10 | // OptDNS returns a DNS Recursive Name Server option as defined by RFC 3646. 11 | func OptDNS(ip ...net.IP) Option { 12 | return &optDNS{NameServers: ip} 13 | } 14 | 15 | type optDNS struct { 16 | NameServers []net.IP 17 | } 18 | 19 | // Code returns the option code 20 | func (op *optDNS) Code() OptionCode { 21 | return OptionDNSRecursiveNameServer 22 | } 23 | 24 | // ToBytes returns the option serialized to bytes. 25 | func (op *optDNS) ToBytes() []byte { 26 | buf := uio.NewBigEndianBuffer(nil) 27 | for _, ns := range op.NameServers { 28 | buf.WriteBytes(ns.To16()) 29 | } 30 | return buf.Data() 31 | } 32 | 33 | func (op *optDNS) String() string { 34 | return fmt.Sprintf("DNS: %v", op.NameServers) 35 | } 36 | 37 | // parseOptDNS builds an optDNS structure 38 | // from a sequence of bytes. The input data does not include option code and length 39 | // bytes. 40 | func parseOptDNS(data []byte) (*optDNS, error) { 41 | var opt optDNS 42 | buf := uio.NewBigEndianBuffer(data) 43 | for buf.Has(net.IPv6len) { 44 | opt.NameServers = append(opt.NameServers, buf.CopyN(net.IPv6len)) 45 | } 46 | return &opt, buf.FinError() 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_domainsearchlist.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/insomniacslk/dhcp/rfc1035label" 7 | ) 8 | 9 | // OptDomainSearchList returns a DomainSearchList option as defined by RFC 3646. 10 | func OptDomainSearchList(labels *rfc1035label.Labels) Option { 11 | return &optDomainSearchList{DomainSearchList: labels} 12 | } 13 | 14 | type optDomainSearchList struct { 15 | DomainSearchList *rfc1035label.Labels 16 | } 17 | 18 | func (op *optDomainSearchList) Code() OptionCode { 19 | return OptionDomainSearchList 20 | } 21 | 22 | // ToBytes marshals this option to bytes. 23 | func (op *optDomainSearchList) ToBytes() []byte { 24 | return op.DomainSearchList.ToBytes() 25 | } 26 | 27 | func (op *optDomainSearchList) String() string { 28 | return fmt.Sprintf("DomainSearchList: %s", op.DomainSearchList) 29 | } 30 | 31 | // ParseOptDomainSearchList builds an OptDomainSearchList structure from a sequence 32 | // of bytes. The input data does not include option code and length bytes. 33 | func parseOptDomainSearchList(data []byte) (*optDomainSearchList, error) { 34 | var opt optDomainSearchList 35 | var err error 36 | opt.DomainSearchList, err = rfc1035label.FromBytes(data) 37 | if err != nil { 38 | return nil, err 39 | } 40 | return &opt, nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_elapsedtime.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | 7 | "github.com/u-root/uio/uio" 8 | ) 9 | 10 | // OptElapsedTime returns an Elapsed Time option as defined by RFC 3315 Section 11 | // 22.9. 12 | func OptElapsedTime(dur time.Duration) Option { 13 | return &optElapsedTime{ElapsedTime: dur} 14 | } 15 | 16 | type optElapsedTime struct { 17 | ElapsedTime time.Duration 18 | } 19 | 20 | func (*optElapsedTime) Code() OptionCode { 21 | return OptionElapsedTime 22 | } 23 | 24 | // ToBytes marshals this option to bytes. 25 | func (op *optElapsedTime) ToBytes() []byte { 26 | buf := uio.NewBigEndianBuffer(nil) 27 | buf.Write16(uint16(op.ElapsedTime.Round(10*time.Millisecond) / (10 * time.Millisecond))) 28 | return buf.Data() 29 | } 30 | 31 | func (op *optElapsedTime) String() string { 32 | return fmt.Sprintf("ElapsedTime: %s", op.ElapsedTime) 33 | } 34 | 35 | // build an optElapsedTime structure from a sequence of bytes. 36 | // The input data does not include option code and length bytes. 37 | func parseOptElapsedTime(data []byte) (*optElapsedTime, error) { 38 | var opt optElapsedTime 39 | buf := uio.NewBigEndianBuffer(data) 40 | opt.ElapsedTime = time.Duration(buf.Read16()) * 10 * time.Millisecond 41 | return &opt, buf.FinError() 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_fqdn.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/insomniacslk/dhcp/rfc1035label" 7 | "github.com/u-root/uio/uio" 8 | ) 9 | 10 | // OptFQDN implements OptionFQDN option. 11 | // 12 | // https://tools.ietf.org/html/rfc4704 13 | type OptFQDN struct { 14 | Flags uint8 15 | DomainName *rfc1035label.Labels 16 | } 17 | 18 | // Code returns the option code. 19 | func (op *OptFQDN) Code() OptionCode { 20 | return OptionFQDN 21 | } 22 | 23 | // ToBytes serializes the option and returns it as a sequence of bytes 24 | func (op *OptFQDN) ToBytes() []byte { 25 | buf := uio.NewBigEndianBuffer(nil) 26 | buf.Write8(op.Flags) 27 | buf.WriteBytes(op.DomainName.ToBytes()) 28 | return buf.Data() 29 | } 30 | 31 | func (op *OptFQDN) String() string { 32 | return fmt.Sprintf("OptFQDN{flags=%d, domainname=%s}", op.Flags, op.DomainName) 33 | } 34 | 35 | // ParseOptFQDN deserializes from bytes to build a OptFQDN structure. 36 | func ParseOptFQDN(data []byte) (*OptFQDN, error) { 37 | var opt OptFQDN 38 | var err error 39 | buf := uio.NewBigEndianBuffer(data) 40 | opt.Flags = buf.Read8() 41 | opt.DomainName, err = rfc1035label.FromBytes(buf.ReadAll()) 42 | if err != nil { 43 | return nil, err 44 | } 45 | return &opt, buf.FinError() 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_interfaceid.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // OptInterfaceID returns an interface id option as defined by RFC 3315, 8 | // Section 22.18. 9 | func OptInterfaceID(id []byte) Option { 10 | return &optInterfaceID{ID: id} 11 | } 12 | 13 | type optInterfaceID struct { 14 | ID []byte 15 | } 16 | 17 | func (*optInterfaceID) Code() OptionCode { 18 | return OptionInterfaceID 19 | } 20 | 21 | func (op *optInterfaceID) ToBytes() []byte { 22 | return op.ID 23 | } 24 | 25 | func (op *optInterfaceID) String() string { 26 | return fmt.Sprintf("InterfaceID: %v", op.ID) 27 | } 28 | 29 | // build an optInterfaceID structure from a sequence of bytes. 30 | // The input data does not include option code and length bytes. 31 | func parseOptInterfaceID(data []byte) (*optInterfaceID, error) { 32 | var opt optInterfaceID 33 | opt.ID = append([]byte(nil), data...) 34 | return &opt, nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_relaymsg.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | // This module defines the optRelayMsg structure. 4 | // https://www.ietf.org/rfc/rfc3315.txt 5 | 6 | import ( 7 | "fmt" 8 | ) 9 | 10 | // OptRelayMessage embeds a message in a relay option. 11 | func OptRelayMessage(msg DHCPv6) Option { 12 | return &optRelayMsg{Msg: msg} 13 | } 14 | 15 | type optRelayMsg struct { 16 | Msg DHCPv6 17 | } 18 | 19 | func (op *optRelayMsg) Code() OptionCode { 20 | return OptionRelayMsg 21 | } 22 | 23 | func (op *optRelayMsg) ToBytes() []byte { 24 | return op.Msg.ToBytes() 25 | } 26 | 27 | func (op *optRelayMsg) String() string { 28 | return fmt.Sprintf("RelayMsg: %v", op.Msg) 29 | } 30 | 31 | // build an optRelayMsg structure from a sequence of bytes. 32 | // The input data does not include option code and length bytes. 33 | func parseOptRelayMsg(data []byte) (*optRelayMsg, error) { 34 | var err error 35 | var opt optRelayMsg 36 | opt.Msg, err = FromBytes(data) 37 | if err != nil { 38 | return nil, err 39 | } 40 | return &opt, nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_relayport.go: -------------------------------------------------------------------------------- 1 | // This module defines the optRelayPort structure. 2 | // https://www.ietf.org/rfc/rfc8357.txt 3 | 4 | package dhcpv6 5 | 6 | import ( 7 | "fmt" 8 | 9 | "github.com/u-root/uio/uio" 10 | ) 11 | 12 | // OptRelayPort specifies an UDP port to use for the downstream relay 13 | func OptRelayPort(port uint16) Option { 14 | return &optRelayPort{DownstreamSourcePort: port} 15 | } 16 | 17 | type optRelayPort struct { 18 | DownstreamSourcePort uint16 19 | } 20 | 21 | func (op *optRelayPort) Code() OptionCode { 22 | return OptionRelayPort 23 | } 24 | 25 | func (op *optRelayPort) ToBytes() []byte { 26 | buf := uio.NewBigEndianBuffer(nil) 27 | buf.Write16(op.DownstreamSourcePort) 28 | return buf.Data() 29 | } 30 | 31 | func (op *optRelayPort) String() string { 32 | return fmt.Sprintf("RelayPort: %d", op.DownstreamSourcePort) 33 | } 34 | 35 | // build an optRelayPort structure from a sequence of bytes. 36 | // The input data does not include option code and length bytes. 37 | func parseOptRelayPort(data []byte) (*optRelayPort, error) { 38 | var opt optRelayPort 39 | buf := uio.NewBigEndianBuffer(data) 40 | opt.DownstreamSourcePort = buf.Read16() 41 | return &opt, buf.FinError() 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_remoteid.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/u-root/uio/uio" 7 | ) 8 | 9 | // OptRemoteID implemens the Remote ID option as defined by RFC 4649. 10 | type OptRemoteID struct { 11 | EnterpriseNumber uint32 12 | RemoteID []byte 13 | } 14 | 15 | // Code implements Option.Code. 16 | func (*OptRemoteID) Code() OptionCode { 17 | return OptionRemoteID 18 | } 19 | 20 | // ToBytes serializes this option to a byte stream. 21 | func (op *OptRemoteID) ToBytes() []byte { 22 | buf := uio.NewBigEndianBuffer(nil) 23 | buf.Write32(op.EnterpriseNumber) 24 | buf.WriteBytes(op.RemoteID) 25 | return buf.Data() 26 | } 27 | 28 | func (op *OptRemoteID) String() string { 29 | return fmt.Sprintf("RemoteID: EnterpriseNumber %d RemoteID %v", 30 | op.EnterpriseNumber, op.RemoteID, 31 | ) 32 | } 33 | 34 | // ParseOptRemoteId builds an OptRemoteId structure from a sequence of bytes. 35 | // The input data does not include option code and length bytes. 36 | func ParseOptRemoteID(data []byte) (*OptRemoteID, error) { 37 | var opt OptRemoteID 38 | buf := uio.NewBigEndianBuffer(data) 39 | opt.EnterpriseNumber = buf.Read32() 40 | opt.RemoteID = buf.ReadAll() 41 | return &opt, buf.FinError() 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_serverid.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // OptServerID represents a Server Identifier option as defined by RFC 3315 8 | // Section 22.1. 9 | func OptServerID(d Duid) Option { 10 | return &optServerID{d} 11 | } 12 | 13 | type optServerID struct { 14 | Duid 15 | } 16 | 17 | func (*optServerID) Code() OptionCode { 18 | return OptionServerID 19 | } 20 | 21 | func (op *optServerID) String() string { 22 | return fmt.Sprintf("ServerID: %v", op.Duid.String()) 23 | } 24 | 25 | // parseOptServerID builds an optServerID structure from a sequence of bytes. 26 | // The input data does not include option code and length bytes. 27 | func parseOptServerID(data []byte) (*optServerID, error) { 28 | sid, err := DuidFromBytes(data) 29 | if err != nil { 30 | return nil, err 31 | } 32 | return &optServerID{*sid}, nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/dhcpv6/option_temporaryaddress.go: -------------------------------------------------------------------------------- 1 | package dhcpv6 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/u-root/uio/uio" 7 | ) 8 | 9 | // OptIATA implements the identity association for non-temporary addresses 10 | // option. 11 | // 12 | // This module defines the OptIATA structure. 13 | // https://www.ietf.org/rfc/rfc8415.txt 14 | type OptIATA struct { 15 | IaId [4]byte 16 | Options IdentityOptions 17 | } 18 | 19 | // Code returns the option code for an IA_TA 20 | func (op *OptIATA) Code() OptionCode { 21 | return OptionIATA 22 | } 23 | 24 | // ToBytes serializes IATA to DHCPv6 bytes. 25 | func (op *OptIATA) ToBytes() []byte { 26 | buf := uio.NewBigEndianBuffer(nil) 27 | buf.WriteBytes(op.IaId[:]) 28 | buf.WriteBytes(op.Options.ToBytes()) 29 | return buf.Data() 30 | } 31 | 32 | func (op *OptIATA) String() string { 33 | return fmt.Sprintf("IATA: {IAID=%v, options=%v}", 34 | op.IaId, op.Options) 35 | } 36 | 37 | // ParseOptIATA builds an OptIATA structure from a sequence of bytes. The 38 | // input data does not include option code and length bytes. 39 | func ParseOptIATA(data []byte) (*OptIATA, error) { 40 | var opt OptIATA 41 | buf := uio.NewBigEndianBuffer(data) 42 | buf.ReadBytes(opt.IaId[:]) 43 | 44 | if err := opt.Options.FromBytes(buf.ReadAll()); err != nil { 45 | return nil, err 46 | } 47 | return &opt, buf.FinError() 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/iana/entid.go: -------------------------------------------------------------------------------- 1 | package iana 2 | 3 | // EnterpriseID represents the Enterprise IDs as set by IANA 4 | type EnterpriseID int 5 | 6 | // See https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers for values 7 | const ( 8 | EnterpriseIDCiscoSystems EnterpriseID = 9 9 | EnterpriseIDCienaCorporation EnterpriseID = 1271 10 | ) 11 | 12 | var enterpriseIDToStringMap = map[EnterpriseID]string{ 13 | EnterpriseIDCiscoSystems: "Cisco Systems", 14 | EnterpriseIDCienaCorporation: "Ciena Corporation", 15 | } 16 | 17 | // String returns the vendor name for a given Enterprise ID 18 | func (e EnterpriseID) String() string { 19 | if vendor := enterpriseIDToStringMap[e]; vendor != "" { 20 | return vendor 21 | } 22 | return "Unknown" 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/iana/iana.go: -------------------------------------------------------------------------------- 1 | // Package iana contains constants defined by IANA. 2 | package iana 3 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/interfaces/bindtodevice_bsd.go: -------------------------------------------------------------------------------- 1 | // +build aix freebsd openbsd netbsd 2 | 3 | package interfaces 4 | 5 | import ( 6 | "net" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | // BindToInterface emulates linux's SO_BINDTODEVICE option for a socket by using 12 | // IP_RECVIF. 13 | func BindToInterface(fd int, ifname string) error { 14 | iface, err := net.InterfaceByName(ifname) 15 | if err != nil { 16 | return err 17 | } 18 | return unix.SetsockoptInt(fd, unix.IPPROTO_IP, unix.IP_RECVIF, iface.Index) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/interfaces/bindtodevice_darwin.go: -------------------------------------------------------------------------------- 1 | // +build darwin 2 | 3 | package interfaces 4 | 5 | import ( 6 | "net" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | // BindToInterface emulates linux's SO_BINDTODEVICE option for a socket by using 12 | // IP_BOUND_IF. 13 | func BindToInterface(fd int, ifname string) error { 14 | iface, err := net.InterfaceByName(ifname) 15 | if err != nil { 16 | return err 17 | } 18 | return unix.SetsockoptInt(fd, unix.IPPROTO_IP, unix.IP_BOUND_IF, iface.Index) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/interfaces/bindtodevice_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package interfaces 4 | 5 | import "golang.org/x/sys/unix" 6 | 7 | func BindToInterface(fd int, ifname string) error { 8 | return unix.BindToDevice(fd, ifname) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/insomniacslk/dhcp/interfaces/bindtodevice_windows.go: -------------------------------------------------------------------------------- 1 | package interfaces 2 | 3 | import "errors" 4 | 5 | // BindToInterface fails on Windows. 6 | func BindToInterface(fd int, ifname string) error { 7 | return errors.New("not implemented on Windows") 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/huff0/.gitignore: -------------------------------------------------------------------------------- 1 | /huff0-fuzz.zip 2 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/snappy/.gitignore: -------------------------------------------------------------------------------- 1 | cmd/snappytool/snappytool 2 | testdata/bench 3 | 4 | # These explicitly listed benchmark data files are for an obsolete version of 5 | # snappy_test.go. 6 | testdata/alice29.txt 7 | testdata/asyoulik.txt 8 | testdata/fireworks.jpeg 9 | testdata/geo.protodata 10 | testdata/html 11 | testdata/html_x_4 12 | testdata/kppkn.gtb 13 | testdata/lcet10.txt 14 | testdata/paper-100k.pdf 15 | testdata/plrabn12.txt 16 | testdata/urls.10K 17 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/snappy/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Snappy-Go authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | Damian Gryski 12 | Google Inc. 13 | Jan Mercl <0xjnml@gmail.com> 14 | Rodolfo Carvalho 15 | Sebastien Binet 16 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/snappy/decode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // decode has the same semantics as in decode_other.go. 12 | // 13 | //go:noescape 14 | func decode(dst, src []byte) int 15 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/snappy/encode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // emitLiteral has the same semantics as in encode_other.go. 12 | // 13 | //go:noescape 14 | func emitLiteral(dst, lit []byte) int 15 | 16 | // emitCopy has the same semantics as in encode_other.go. 17 | // 18 | //go:noescape 19 | func emitCopy(dst []byte, offset, length int) int 20 | 21 | // extendMatch has the same semantics as in encode_other.go. 22 | // 23 | //go:noescape 24 | func extendMatch(src []byte, i, j int) int 25 | 26 | // encodeBlock has the same semantics as in encode_other.go. 27 | // 28 | //go:noescape 29 | func encodeBlock(dst, src []byte) (d int) 30 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/snappy/runbench.cmd: -------------------------------------------------------------------------------- 1 | del old.txt 2 | go test -bench=. >>old.txt && go test -bench=. >>old.txt && go test -bench=. >>old.txt && benchstat -delta-test=ttest old.txt new.txt 3 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Caleb Spare 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | // +build gc 3 | // +build !purego 4 | 5 | package xxhash 6 | 7 | // Sum64 computes the 64-bit xxHash digest of b. 8 | // 9 | //go:noescape 10 | func Sum64(b []byte) uint64 11 | 12 | //go:noescape 13 | func writeBlocks(*Digest, []byte) int 14 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go: -------------------------------------------------------------------------------- 1 | package xxhash 2 | 3 | // Sum64String computes the 64-bit xxHash digest of s. 4 | func Sum64String(s string) uint64 { 5 | return Sum64([]byte(s)) 6 | } 7 | 8 | // WriteString adds more data to d. It always returns len(s), nil. 9 | func (d *Digest) WriteString(s string) (n int, err error) { 10 | return d.Write([]byte(s)) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/ethernet/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.x 4 | os: 5 | - linux 6 | before_install: 7 | - go get golang.org/x/lint/golint 8 | - go get honnef.co/go/tools/cmd/staticcheck 9 | - go get -d ./... 10 | script: 11 | - go build -tags=gofuzz ./... 12 | - go vet ./... 13 | - staticcheck ./... 14 | - golint -set_exit_status ./... 15 | - go test -v -race ./... 16 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/ethernet/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | =========== 3 | 4 | Copyright (C) 2015 Matt Layher 5 | 6 | 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: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | 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. 11 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/ethernet/README.md: -------------------------------------------------------------------------------- 1 | ethernet [![Build Status](https://travis-ci.org/mdlayher/ethernet.svg?branch=master)](https://travis-ci.org/mdlayher/ethernet) [![GoDoc](https://godoc.org/github.com/mdlayher/ethernet?status.svg)](https://godoc.org/github.com/mdlayher/ethernet) [![Go Report Card](https://goreportcard.com/badge/github.com/mdlayher/ethernet)](https://goreportcard.com/report/github.com/mdlayher/ethernet) 2 | ======== 3 | 4 | Package `ethernet` implements marshaling and unmarshaling of IEEE 802.3 5 | Ethernet II frames and IEEE 802.1Q VLAN tags. MIT Licensed. 6 | 7 | For more information about using Ethernet frames in Go, check out my blog 8 | post: [Network Protocol Breakdown: Ethernet and Go](https://medium.com/@mdlayher/network-protocol-breakdown-ethernet-and-go-de985d726cc1). -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/ethernet/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package ethernet 4 | 5 | func Fuzz(data []byte) int { 6 | f := new(Frame) 7 | if err := f.UnmarshalBinary(data); err != nil { 8 | return 0 9 | } 10 | 11 | if _, err := f.MarshalBinary(); err != nil { 12 | panic(err) 13 | } 14 | 15 | if err := f.UnmarshalFCS(data); err != nil { 16 | return 0 17 | } 18 | 19 | if _, err := f.MarshalFCS(); err != nil { 20 | panic(err) 21 | } 22 | 23 | return 1 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/ethernet/string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -output=string.go -type=EtherType"; DO NOT EDIT. 2 | 3 | package ethernet 4 | 5 | import "fmt" 6 | 7 | const ( 8 | _EtherType_name_0 = "EtherTypeIPv4" 9 | _EtherType_name_1 = "EtherTypeARP" 10 | _EtherType_name_2 = "EtherTypeVLAN" 11 | _EtherType_name_3 = "EtherTypeIPv6" 12 | _EtherType_name_4 = "EtherTypeServiceVLAN" 13 | ) 14 | 15 | var ( 16 | _EtherType_index_0 = [...]uint8{0, 13} 17 | _EtherType_index_1 = [...]uint8{0, 12} 18 | _EtherType_index_2 = [...]uint8{0, 13} 19 | _EtherType_index_3 = [...]uint8{0, 13} 20 | _EtherType_index_4 = [...]uint8{0, 20} 21 | ) 22 | 23 | func (i EtherType) String() string { 24 | switch { 25 | case i == 2048: 26 | return _EtherType_name_0 27 | case i == 2054: 28 | return _EtherType_name_1 29 | case i == 33024: 30 | return _EtherType_name_2 31 | case i == 34525: 32 | return _EtherType_name_3 33 | case i == 34984: 34 | return _EtherType_name_4 35 | default: 36 | return fmt.Sprintf("EtherType(%d)", i) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/raw/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | =========== 3 | 4 | Copyright (C) 2015 Matt Layher 5 | 6 | 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: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | 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. 11 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/raw/raw_direction_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd netbsd 2 | 3 | package raw 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | // setBPFDirection enables filtering traffic traveling in a specific direction 11 | // using BPF, so that traffic sent by this package is not captured when reading 12 | // using this package. 13 | func setBPFDirection(fd int, direction int) error { 14 | _, _, err := syscall.Syscall( 15 | syscall.SYS_IOCTL, 16 | uintptr(fd), 17 | // Even though BIOCSDIRECTION is preferred on FreeBSD, BIOCSSEESENT continues 18 | // to work, and is required for other BSD platforms 19 | syscall.BIOCSSEESENT, 20 | uintptr(unsafe.Pointer(&direction)), 21 | ) 22 | if err != 0 { 23 | return syscall.Errno(err) 24 | } 25 | 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/raw/raw_direction_openbsd.go: -------------------------------------------------------------------------------- 1 | // +build openbsd 2 | 3 | package raw 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | // setBPFDirection enables filtering traffic traveling in a specific direction 11 | // using BPF, so that traffic sent by this package is not captured when reading 12 | // using this package. 13 | func setBPFDirection(fd int, direction int) error { 14 | var dirfilt uint 15 | 16 | switch direction { 17 | case 0: 18 | // filter outbound 19 | dirfilt = syscall.BPF_DIRECTION_OUT 20 | default: 21 | // no filter 22 | } 23 | 24 | _, _, err := syscall.Syscall( 25 | syscall.SYS_IOCTL, 26 | uintptr(fd), 27 | syscall.BIOCSDIRFILT, 28 | uintptr(unsafe.Pointer(&dirfilt)), 29 | ) 30 | if err != 0 { 31 | return syscall.Errno(err) 32 | } 33 | 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/mdlayher/raw/staticcheck.conf: -------------------------------------------------------------------------------- 1 | # Do not flag deprecated syscall functions in BSD functionality. 2 | checks = ["all", "-SA1019"] 3 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/v4/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/macos 2 | 3 | ### macOS ### 4 | *.DS_Store 5 | .AppleDouble 6 | .LSOverride 7 | 8 | # Icon must end with two \r 9 | Icon 10 | 11 | 12 | # Thumbnails 13 | ._* 14 | 15 | # Files that might appear in the root of a volume 16 | .DocumentRevisions-V100 17 | .fseventsd 18 | .Spotlight-V100 19 | .TemporaryItems 20 | .Trashes 21 | .VolumeIcon.icns 22 | .com.apple.timemachine.donotpresent 23 | 24 | # Directories potentially created on remote AFP share 25 | .AppleDB 26 | .AppleDesktop 27 | Network Trash Folder 28 | Temporary Items 29 | .apdisk 30 | 31 | # End of https://www.gitignore.io/api/macos 32 | 33 | cmd/*/*exe 34 | .idea 35 | 36 | fuzz/*.zip 37 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_asm.go: -------------------------------------------------------------------------------- 1 | // +build amd64 arm arm64 2 | // +build !appengine 3 | // +build gc 4 | // +build !noasm 5 | 6 | package lz4block 7 | 8 | //go:noescape 9 | func decodeBlock(dst, src, dict []byte) int 10 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/v4/internal/lz4errors/errors.go: -------------------------------------------------------------------------------- 1 | package lz4errors 2 | 3 | type Error string 4 | 5 | func (e Error) Error() string { return string(e) } 6 | 7 | const ( 8 | ErrInvalidSourceShortBuffer Error = "lz4: invalid source or destination buffer too short" 9 | ErrInvalidFrame Error = "lz4: bad magic number" 10 | ErrInternalUnhandledState Error = "lz4: unhandled state" 11 | ErrInvalidHeaderChecksum Error = "lz4: invalid header checksum" 12 | ErrInvalidBlockChecksum Error = "lz4: invalid block checksum" 13 | ErrInvalidFrameChecksum Error = "lz4: invalid frame checksum" 14 | ErrOptionInvalidCompressionLevel Error = "lz4: invalid compression level" 15 | ErrOptionClosedOrError Error = "lz4: cannot apply options on closed or in error object" 16 | ErrOptionInvalidBlockSize Error = "lz4: invalid block size" 17 | ErrOptionNotApplicable Error = "lz4: option not applicable" 18 | ErrWriterNotClosed Error = "lz4: writer not closed" 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.go: -------------------------------------------------------------------------------- 1 | // +build !noasm 2 | 3 | package xxh32 4 | 5 | // ChecksumZero returns the 32-bit hash of input. 6 | // 7 | //go:noescape 8 | func ChecksumZero(input []byte) uint32 9 | 10 | //go:noescape 11 | func update(v *[4]uint32, buf *[16]byte, input []byte) 12 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go: -------------------------------------------------------------------------------- 1 | // +build !arm noasm 2 | 3 | package xxh32 4 | 5 | // ChecksumZero returns the 32-bit hash of input. 6 | func ChecksumZero(input []byte) uint32 { return checksumZeroGo(input) } 7 | 8 | func update(v *[4]uint32, buf *[16]byte, input []byte) { 9 | updateGo(v, buf, input) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/v4/state_gen.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=aState -output state_gen.go"; DO NOT EDIT. 2 | 3 | package lz4 4 | 5 | import "strconv" 6 | 7 | func _() { 8 | // An "invalid array index" compiler error signifies that the constant values have changed. 9 | // Re-run the stringer command to generate them again. 10 | var x [1]struct{} 11 | _ = x[noState-0] 12 | _ = x[errorState-1] 13 | _ = x[newState-2] 14 | _ = x[readState-3] 15 | _ = x[writeState-4] 16 | _ = x[closedState-5] 17 | } 18 | 19 | const _aState_name = "noStateerrorStatenewStatereadStatewriteStateclosedState" 20 | 21 | var _aState_index = [...]uint8{0, 7, 17, 25, 34, 44, 55} 22 | 23 | func (i aState) String() string { 24 | if i >= aState(len(_aState_index)-1) { 25 | return "aState(" + strconv.FormatInt(int64(i), 10) + ")" 26 | } 27 | return _aState_name[_aState_index[i]:_aState_index[i+1]] 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentFormat}} 2 | func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { 3 | if h, ok := t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | if h, ok := a.t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs" 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/doc.go: -------------------------------------------------------------------------------- 1 | // Package require implements the same assertions as the `assert` package but 2 | // stops test execution when a test fails. 3 | // 4 | // Example Usage 5 | // 6 | // The following is a complete example using require in a standard test function: 7 | // import ( 8 | // "testing" 9 | // "github.com/stretchr/testify/require" 10 | // ) 11 | // 12 | // func TestSomething(t *testing.T) { 13 | // 14 | // var a string = "Hello" 15 | // var b string = "Hello" 16 | // 17 | // require.Equal(t, a, b, "The two words should be the same.") 18 | // 19 | // } 20 | // 21 | // Assertions 22 | // 23 | // The `require` package have same global functions as in the `assert` package, 24 | // but instead of returning a boolean result they call `t.FailNow()`. 25 | // 26 | // Every assertion function also takes an optional string message as the final argument, 27 | // allowing custom error messages to be appended to the message the assertion method outputs. 28 | package require 29 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/forward_requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=require -template=require_forward.go.tmpl -include-format-funcs" 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Comment}} 2 | func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { 3 | if h, ok := t.(tHelper); ok { h.Helper() } 4 | if assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { return } 5 | t.FailNow() 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { 3 | if h, ok := a.t.(tHelper); ok { h.Helper() } 4 | {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // TestingT is an interface wrapper around *testing.T 4 | type TestingT interface { 5 | Errorf(format string, args ...interface{}) 6 | FailNow() 7 | } 8 | 9 | type tHelper interface { 10 | Helper() 11 | } 12 | 13 | // ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful 14 | // for table driven tests. 15 | type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{}) 16 | 17 | // ValueAssertionFunc is a common function prototype when validating a single value. Can be useful 18 | // for table driven tests. 19 | type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) 20 | 21 | // BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful 22 | // for table driven tests. 23 | type BoolAssertionFunc func(TestingT, bool, ...interface{}) 24 | 25 | // ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful 26 | // for table driven tests. 27 | type ErrorAssertionFunc func(TestingT, error, ...interface{}) 28 | 29 | //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=require -template=require.go.tmpl -include-format-funcs" 30 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of u-root authors for copyright purposes. This will 2 | # not list all people who have contributed; for example, many Google employee 3 | # contributors are not listed here, since Google holds the copyright to their 4 | # contributions. 5 | # 6 | # This list is not complete and does not strive to be. 7 | 8 | # Names should be added to this file as one of 9 | # Organization's name 10 | # Organization's name 11 | # Individual's name 12 | # Individual's name 13 | 14 | Andrey Mirtchovski 15 | Facebook, Inc. 16 | Genesys Telecommunications Laboratories, Inc. 17 | Google LLC 18 | Oracle Corporation 19 | Ron Minnich 20 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/align/align.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2022 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package align provides helpers for doing uint alignment. 6 | // 7 | // alignment is done via bit operation at the moment, so alignment 8 | // size need be a power of 2. 9 | package align 10 | 11 | import "os" 12 | 13 | var pageSize = uint(os.Getpagesize()) 14 | 15 | // Up aligns v up to next multiple of alignSize. 16 | // 17 | // alignSize need be a power of 2. 18 | func Up(v uint, alignSize uint) uint { 19 | mask := alignSize - 1 20 | return (v + mask) &^ mask 21 | } 22 | 23 | // Down aligns v down to a previous multiple of alignSize. 24 | // 25 | // alignSize need be a power of 2. 26 | func Down(v uint, alignSize uint) uint { 27 | return Up(v-(alignSize-1), alignSize) 28 | } 29 | 30 | // UpPage aligns v up by system page size. 31 | func UpPage(v uint) uint { 32 | return Up(v, pageSize) 33 | } 34 | 35 | // DownPage aligns v down by system page size. 36 | func DownPage(v uint) uint { 37 | return Down(v, pageSize) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/boot/boot.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package boot is the high-level interface for booting another operating 6 | // system from Linux using kexec. 7 | package boot 8 | 9 | import ( 10 | "fmt" 11 | 12 | "github.com/u-root/u-root/pkg/boot/kexec" 13 | ) 14 | 15 | // OSImage represents a bootable OS package. 16 | type OSImage interface { 17 | fmt.Stringer 18 | 19 | // Label is a name or short description for this OSImage. 20 | // 21 | // Label is intended for boot menus. 22 | Label() string 23 | 24 | // Rank the priority of the images for boot menus. 25 | // 26 | // The larger the number, the prior the image shows in the menu. 27 | Rank() int 28 | 29 | // Edit the kernel command line if possible. Must be called before 30 | // Load. 31 | Edit(func(cmdline string) string) 32 | 33 | // Load loads the OS image into kernel memory, ready for execution. 34 | // 35 | // After Load is called, call boot.Execute() to stop Linux and boot the 36 | // loaded OSImage. 37 | Load(verbose bool) error 38 | } 39 | 40 | // Execute executes a previously loaded OSImage. 41 | // 42 | // This will only work if OSImage.Load was called on some OSImage. 43 | func Execute() error { 44 | return kexec.Reboot() 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/boot/kexec/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package kexec implements kexec load and file load syscall API. 6 | package kexec 7 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/boot/kexec/kexec_fileload_implemented_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2017 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 || arm64 || riscv64 6 | // +build amd64 arm64 riscv64 7 | 8 | package kexec 9 | 10 | import ( 11 | "fmt" 12 | "os" 13 | 14 | "golang.org/x/sys/unix" 15 | ) 16 | 17 | // FileLoad loads the given kernel as the new kernel with the given ramfs and 18 | // cmdline. 19 | // 20 | // The kexec_file_load(2) syscall is x86-64 and arm64 only. 21 | func FileLoad(kernel, ramfs *os.File, cmdline string) error { 22 | var flags int 23 | var ramfsfd int 24 | if ramfs != nil { 25 | ramfsfd = int(ramfs.Fd()) 26 | } else { 27 | flags |= unix.KEXEC_FILE_NO_INITRAMFS 28 | } 29 | 30 | if err := unix.KexecFileLoad(int(kernel.Fd()), ramfsfd, cmdline, flags); err != nil { 31 | return fmt.Errorf("SYS_kexec_file_load(%d, %d, %s, %x) = %v", kernel.Fd(), ramfsfd, cmdline, flags, err) 32 | } 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/boot/kexec/kexec_fileload_other_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2017 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !amd64 && !arm64 && !riscv64 6 | // +build !amd64,!arm64,!riscv64 7 | 8 | package kexec 9 | 10 | import ( 11 | "os" 12 | "syscall" 13 | ) 14 | 15 | // FileLoad is not implemented for platforms other than amd64, arm64 and riscv64. 16 | func FileLoad(kernel, ramfs *os.File, cmdline string) error { 17 | return syscall.ENOSYS 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/boot/kexec/kexec_reboot_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2017 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package kexec 6 | 7 | import ( 8 | "fmt" 9 | "log" 10 | "os" 11 | "syscall" 12 | 13 | "github.com/u-root/u-root/pkg/watchdogd" 14 | ) 15 | 16 | // Reboot executes a kernel previously loaded with FileInit. 17 | func Reboot() error { 18 | // Optionally disarm the watchdog. 19 | if os.Getenv("UROOT_KEXEC_DISARM_WATCHDOG") == "1" { 20 | d, err := watchdogd.NewClient() 21 | if err != nil { 22 | log.Printf("Error dialing watchdog daemon: %v", err) 23 | } else if err := d.Disarm(); err != nil { 24 | log.Printf("Error disarming watchdog: %v", err) 25 | } 26 | } 27 | 28 | if err := syscall.Reboot(syscall.LINUX_REBOOT_CMD_KEXEC); err != nil { 29 | return fmt.Errorf("sys_reboot(..., kexec) = %v", err) 30 | } 31 | return nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/boot/linux/debug.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package linux 6 | 7 | var ( 8 | // Debug is called to print out verbose debug info. 9 | // 10 | // Set this to appropriate output stream for display 11 | // of useful debug info. 12 | Debug = func(string, ...interface{}) {} 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/boot/linux/load_other_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !amd64 && !arm64 6 | // +build !amd64,!arm64 7 | 8 | package linux 9 | 10 | import ( 11 | "os" 12 | 13 | "golang.org/x/sys/unix" 14 | ) 15 | 16 | // KexecLoad is not implemented for platforms other than amd64 and arm64. 17 | func KexecLoad(kernel, ramfs *os.File, cmdline string, opts KexecOptions) error { 18 | return unix.ENOSYS 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/boot/multiboot/internal/trampoline/trampoline.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux || !amd64 6 | // +build !linux !amd64 7 | 8 | package trampoline 9 | 10 | import "errors" 11 | 12 | func Setup(path string, magic, infoAddr, entryPoint uintptr) ([]byte, error) { 13 | return nil, errors.New("not implemented yet") 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/boot/purgatory/purgatory.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package purgatory 6 | 7 | // Purgatory abstracts a executable kexec purgatory in golang. 8 | // 9 | // What is a purgatory ? It is a binary object that runs between 10 | // two kernels. See more https://lwn.net/Articles/582711/. 11 | // 12 | // We currently short circuit by generating purgatory executable 13 | // via non-go toolchain. See generation logic from genpurg.go and 14 | // finall generated golang purgatories code in asm.go 15 | // 16 | // See doc.go for more reading. 17 | type Purgatory struct { 18 | // Name is a human readable alis to this purgatory executable. 19 | Name string 20 | // Hexdump is a hexdump of the executabl. 21 | Hexdump string 22 | // Code is the executable code in bytes slice that will be loaded 23 | // in memory as a kexec segment during kexec load. 24 | Code []byte 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/boot/util/reader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package util 6 | 7 | import ( 8 | "bytes" 9 | "compress/gzip" 10 | "io" 11 | 12 | "github.com/u-root/u-root/pkg/uio" 13 | ) 14 | 15 | func readGzip(r io.Reader) ([]byte, error) { 16 | z, err := gzip.NewReader(r) 17 | if err != nil { 18 | return nil, err 19 | } 20 | defer z.Close() 21 | return io.ReadAll(z) 22 | } 23 | 24 | // TryGzipFilter tries to read from an io.ReaderAt to see if it is a Gzip. If it is not, the 25 | // io.ReaderAt is returned. 26 | // TODO: could be tryCompressionFilters, grub support gz,xz and lzop 27 | // TODO: do we want to keep the filter inside multiboot? This could be the responsibility of the caller... 28 | func TryGzipFilter(r io.ReaderAt) io.ReaderAt { 29 | b, err := readGzip(uio.Reader(r)) 30 | if err == nil { 31 | return bytes.NewReader(b) 32 | } 33 | return r 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/cpio/mknod_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpio 6 | 7 | import ( 8 | "syscall" 9 | ) 10 | 11 | func mknod(path string, mode uint32, dev int) (err error) { 12 | return syscall.Mknod(path, mode, uint64(dev)) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/cpio/mknod_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !freebsd && !plan9 6 | // +build !freebsd,!plan9 7 | 8 | package cpio 9 | 10 | import ( 11 | "syscall" 12 | ) 13 | 14 | func mknod(path string, mode uint32, dev int) (err error) { 15 | return syscall.Mknod(path, mode, dev) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/cpio/sysinfo_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2017 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpio 6 | 7 | import ( 8 | "syscall" 9 | ) 10 | 11 | func sysInfo(n string, sys *syscall.Stat_t) Info { 12 | return Info{ 13 | Ino: sys.Ino, 14 | Mode: uint64(sys.Mode), 15 | UID: uint64(sys.Uid), 16 | GID: uint64(sys.Gid), 17 | NLink: uint64(sys.Nlink), 18 | MTime: uint64(sys.Mtimespec.Sec), 19 | FileSize: uint64(sys.Size), 20 | Dev: uint64(sys.Dev), 21 | Major: uint64(sys.Dev >> 8), 22 | Minor: uint64(sys.Dev & 0xff), 23 | Rmajor: uint64(sys.Rdev >> 8), 24 | Rminor: uint64(sys.Rdev & 0xff), 25 | Name: n, 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/cpio/sysinfo_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpio 6 | 7 | import ( 8 | "syscall" 9 | ) 10 | 11 | func sysInfo(n string, sys *syscall.Stat_t) Info { 12 | return Info{ 13 | Ino: sys.Ino, 14 | Mode: uint64(sys.Mode), 15 | UID: uint64(sys.Uid), 16 | GID: uint64(sys.Gid), 17 | NLink: sys.Nlink, 18 | FileSize: uint64(sys.Size), 19 | Major: sys.Dev >> 8, 20 | Minor: sys.Dev & 0xff, 21 | Rmajor: sys.Rdev >> 8, 22 | Rminor: sys.Rdev & 0xff, 23 | Name: n, 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/cpio/sysinfo_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2017 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpio 6 | 7 | import ( 8 | "syscall" 9 | ) 10 | 11 | func sysInfo(n string, sys *syscall.Stat_t) Info { 12 | return Info{ 13 | Ino: sys.Ino, 14 | Mode: uint64(sys.Mode), 15 | UID: uint64(sys.Uid), 16 | GID: uint64(sys.Gid), 17 | NLink: uint64(sys.Nlink), 18 | MTime: uint64(sys.Mtim.Sec), 19 | FileSize: uint64(sys.Size), 20 | Dev: uint64(sys.Dev), 21 | Major: uint64(sys.Dev >> 8), 22 | Minor: uint64(sys.Dev & 0xff), 23 | Rmajor: uint64(sys.Rdev >> 8), 24 | Rminor: uint64(sys.Rdev & 0xff), 25 | Name: n, 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/cpio/sysinfo_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2017 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpio 6 | 7 | import "syscall" 8 | 9 | func sysInfo(n string, sys *syscall.Dir) Info { 10 | // Similar to how the standard library converts Plan 9 Dir to os.FileInfo: 11 | // https://github.com/golang/go/blob/go1.16beta1/src/os/stat_plan9.go#L14 12 | mode := sys.Mode & 0o777 13 | if sys.Mode&syscall.DMDIR != 0 { 14 | mode |= modeDir 15 | } else { 16 | mode |= modeFile 17 | } 18 | return Info{ 19 | Mode: uint64(mode), 20 | UID: 0, 21 | MTime: uint64(sys.Mtime), 22 | FileSize: uint64(sys.Length), 23 | Name: n, 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/dt/print.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package dt 6 | 7 | import ( 8 | "errors" 9 | "fmt" 10 | "io" 11 | ) 12 | 13 | // PrintDTS prints the FDT in the .dts format. 14 | // TODO: not yet implemented 15 | func (fdt *FDT) PrintDTS(f io.Writer) error { 16 | return errors.New("not yet implemented") 17 | } 18 | 19 | // String implements String() for an FDT 20 | func (fdt *FDT) String() string { 21 | return fmt.Sprintf("%#04x %s", fdt.Header, fdt.RootNode) 22 | } 23 | 24 | func (p *Property) String() string { 25 | var more string 26 | l := len(p.Value) 27 | if l > 64 { 28 | more = "..." 29 | l = 64 30 | } 31 | return fmt.Sprintf("%s[%#02x]%q{%#x}%s", p.Name, len(p.Value), p.Value[:l], p.Value[:l], more) 32 | } 33 | 34 | func (n *Node) String() string { 35 | var s string 36 | var indent string 37 | n.Walk(func(n *Node) error { 38 | i := indent 39 | indent += "\t" 40 | s += fmt.Sprintf("%s%s: [", indent, n.Name) 41 | for _, p := range n.Properties { 42 | s += fmt.Sprintf("%s, ", &p) 43 | } 44 | s += "]\n" 45 | indent = i 46 | return nil 47 | }) 48 | return s 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/efivarfs/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // DISCLAIMER 6 | // The code of pkg/efivarfs was originally based on this file 7 | // github.com/canonical/go-efilib/blob/main/vars_linux.go so 8 | // credits go their authors. The code has undergone several revisions 9 | // and has been changed up several times, so that only most crucial parts 10 | // still look familiar to the old code. At the date of writing the code 11 | // in u-root has been simplified so much, that it doesn't resemble most of 12 | // the old code anymore. If a more broader set of features and edge cases 13 | // is required then users should look into importing canonicals library 14 | // instead, as this code only covers the bare minimum! 15 | // Canonical has been made aware this simplified version of their file 16 | // exists and the reason a simplified version had to be created in the 17 | // first place were license concerns. 18 | 19 | // The code allows interaction with the efivarfs via u-root which means 20 | // both read and write support. As the efivarfs is part of the Linux kernel, 21 | // this code is only intended to be run under Linux environments. 22 | 23 | package efivarfs 24 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/ls/ls.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package ls implements formatting tools to list files like the Linux ls tool. 6 | package ls 7 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/tss/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package tss 6 | 7 | // TPMVersion is used to configure a preference in 8 | // which TPM to use, if multiple are available. 9 | type TPMVersion uint8 10 | 11 | // TPM versions 12 | const ( 13 | TPMVersionAgnostic TPMVersion = iota 14 | TPMVersion12 15 | TPMVersion20 16 | ) 17 | 18 | const ( 19 | nvPerOwnerRead = 0x00100000 20 | nvPerAuthRead = 0x00200000 21 | ) 22 | 23 | // TPMInterface indicates how the client communicates 24 | // with the TPM. 25 | type TPMInterface uint8 26 | 27 | // TPM interfaces 28 | const ( 29 | TPMInterfaceDirect TPMInterface = iota 30 | TPMInterfaceKernelManaged 31 | TPMInterfaceDaemonManaged 32 | ) 33 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/ubinary/big_endian.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build mips || mips64 || ppc64 || s390x 6 | // +build mips mips64 ppc64 s390x 7 | 8 | package ubinary 9 | 10 | import ( 11 | "encoding/binary" 12 | ) 13 | 14 | // NativeEndian is $GOARCH's implementation of byte order. 15 | var NativeEndian = binary.BigEndian 16 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/ubinary/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package ubinary provides a native endian binary.ByteOrder. 6 | package ubinary 7 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/ubinary/little_endian.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 || amd64 || arm || arm64 || mipsle || mips64le || ppc64le || riscv || riscv64 6 | // +build 386 amd64 arm arm64 mipsle mips64le ppc64le riscv riscv64 7 | 8 | package ubinary 9 | 10 | import ( 11 | "encoding/binary" 12 | ) 13 | 14 | // NativeEndian is $GOARCH's implementation of byte order. 15 | var NativeEndian = binary.LittleEndian 16 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/uio/alignreader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package uio 6 | 7 | import ( 8 | "io" 9 | ) 10 | 11 | // AlignReader keeps track of how many bytes were read so the reader can be 12 | // aligned at a future time. 13 | type AlignReader struct { 14 | R io.Reader 15 | N int 16 | } 17 | 18 | // Read reads from the underlying io.Reader. 19 | func (r *AlignReader) Read(b []byte) (int, error) { 20 | n, err := r.R.Read(b) 21 | r.N += n 22 | return n, err 23 | } 24 | 25 | // ReadByte reads one byte from the underlying io.Reader. 26 | func (r *AlignReader) ReadByte() (byte, error) { 27 | b := make([]byte, 1) 28 | _, err := io.ReadFull(r, b) 29 | return b[0], err 30 | } 31 | 32 | // Align aligns the reader to the given number of bytes and returns the 33 | // bytes read to pad it. 34 | func (r *AlignReader) Align(n int) ([]byte, error) { 35 | if r.N%n == 0 { 36 | return []byte{}, nil 37 | } 38 | pad := make([]byte, n-r.N%n) 39 | m, err := io.ReadFull(r, pad) 40 | return pad[:m], err 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/uio/alignwriter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package uio 6 | 7 | import ( 8 | "bytes" 9 | "io" 10 | ) 11 | 12 | // AlignWriter keeps track of how many bytes were written so the writer can be 13 | // aligned at a future time. 14 | type AlignWriter struct { 15 | W io.Writer 16 | N int 17 | } 18 | 19 | // Write writes to the underlying io.Writew. 20 | func (w *AlignWriter) Write(b []byte) (int, error) { 21 | n, err := w.W.Write(b) 22 | w.N += n 23 | return n, err 24 | } 25 | 26 | // Align aligns the writer to the given number of bytes using the given pad 27 | // value. 28 | func (w *AlignWriter) Align(n int, pad byte) error { 29 | if w.N%n == 0 { 30 | return nil 31 | } 32 | _, err := w.Write(bytes.Repeat([]byte{pad}, n-w.N%n)) 33 | return err 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/uio/multiwriter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package uio 6 | 7 | import ( 8 | "io" 9 | ) 10 | 11 | type multiCloser struct { 12 | io.Writer 13 | writers []io.Writer 14 | } 15 | 16 | // Close implements io.Closer and closes any io.Writers that are also 17 | // io.Closers. 18 | func (mc *multiCloser) Close() error { 19 | var allErr error 20 | for _, w := range mc.writers { 21 | if c, ok := w.(io.Closer); ok { 22 | if err := c.Close(); err != nil { 23 | allErr = err 24 | } 25 | } 26 | } 27 | return allErr 28 | } 29 | 30 | // MultiWriteCloser is an io.MultiWriter that has an io.Closer and attempts to 31 | // close those w's that have optional io.Closers. 32 | func MultiWriteCloser(w ...io.Writer) io.WriteCloser { 33 | return &multiCloser{ 34 | Writer: io.MultiWriter(w...), 35 | writers: w, 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/uio/progress.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package uio 6 | 7 | import ( 8 | "io" 9 | "strings" 10 | ) 11 | 12 | // ProgressReadCloser implements io.ReadCloser and prints Symbol to W after every 13 | // Interval bytes passes through RC. 14 | type ProgressReadCloser struct { 15 | RC io.ReadCloser 16 | 17 | Symbol string 18 | Interval int 19 | W io.Writer 20 | 21 | counter int 22 | written bool 23 | } 24 | 25 | // Read implements io.Reader for ProgressReadCloser. 26 | func (rc *ProgressReadCloser) Read(p []byte) (n int, err error) { 27 | defer func() { 28 | numSymbols := (rc.counter%rc.Interval + n) / rc.Interval 29 | rc.W.Write([]byte(strings.Repeat(rc.Symbol, numSymbols))) 30 | rc.counter += n 31 | rc.written = (rc.written || numSymbols > 0) 32 | if err == io.EOF && rc.written { 33 | rc.W.Write([]byte("\n")) 34 | } 35 | }() 36 | return rc.RC.Read(p) 37 | } 38 | 39 | // Read implements io.Closer for ProgressReader. 40 | func (rc *ProgressReadCloser) Close() error { 41 | return rc.RC.Close() 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/uio/uio.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package uio unifies commonly used io utilities for u-root. 6 | // 7 | // uio's most used feature is the Buffer/Lexer combination to parse binary data 8 | // of arbitrary endianness into data structures. 9 | package uio 10 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/upath/safejoin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !windows 6 | // +build !windows 7 | 8 | package upath 9 | 10 | import ( 11 | "fmt" 12 | "path/filepath" 13 | "strings" 14 | ) 15 | 16 | // SafeFilepathJoin safely joins two paths path1+path2. The resulting path will 17 | // always be contained within path1 even if path2 tries to escape with "../". 18 | // If that path is not possible, an error is returned. The resulting path is 19 | // cleaned. 20 | func SafeFilepathJoin(path1, path2 string) (string, error) { 21 | relPath, err := filepath.Rel(".", path2) 22 | if err != nil || strings.HasPrefix(relPath, "..") { 23 | return "", fmt.Errorf("(zipslip) filepath is unsafe %q: %v", path2, err) 24 | } 25 | if path1 == "" { 26 | path1 = "." 27 | } 28 | return filepath.Join(path1, filepath.Join("/", relPath)), nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/u-root/pkg/upath/urootpath.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2017 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package upath 6 | 7 | import ( 8 | "os" 9 | "path/filepath" 10 | ) 11 | 12 | var root = os.Getenv("UROOT_ROOT") 13 | 14 | // UrootPath returns the absolute path for a uroot file with the UROOT_ROOT 15 | // environment variable taken into account. 16 | // 17 | // It returns a proper value if UROOT_ROOT is not set. u-root was built to 18 | // assume everything is rooted at /, and in most cases that is still true. But 19 | // in hosted mode, e.g. on developer mode chromebooks, it's far better if 20 | // u-root can be rooted in /usr/local, so successive kernel/root file system 21 | // upgrades do not wipe it out. 22 | func UrootPath(n ...string) string { 23 | return filepath.Join("/", root, filepath.Join(n...)) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/uio/rand/random_std.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build plan9 windows 6 | 7 | package rand 8 | 9 | import ( 10 | "context" 11 | "crypto/rand" 12 | ) 13 | 14 | var defaultContextReader = &cryptoRandReader{} 15 | 16 | type cryptoRandReader struct{} 17 | 18 | // ReadContext implements a cancelable read. 19 | func (r *cryptoRandReader) ReadContext(ctx context.Context, b []byte) (n int, err error) { 20 | ch := make(chan struct{}) 21 | go func() { 22 | n, err = rand.Reader.Read(b) 23 | close(ch) 24 | }() 25 | select { 26 | case <-ctx.Done(): 27 | return 0, ctx.Err() 28 | case <-ch: 29 | return n, err 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/uio/rand/random_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd nacl netbsd openbsd solaris 6 | 7 | package rand 8 | 9 | var defaultContextReader = &urandomReader{} 10 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/uio/ubinary/big_endian.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build mips mips64 ppc64 s390x 6 | 7 | package ubinary 8 | 9 | import ( 10 | "encoding/binary" 11 | ) 12 | 13 | // NativeEndian is $GOARCH's implementation of byte order. 14 | var NativeEndian = binary.BigEndian 15 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/uio/ubinary/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package ubinary provides a native endian binary.ByteOrder. 6 | package ubinary 7 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/uio/ubinary/little_endian.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386 amd64 arm arm64 mipsle mips64le ppc64le riscv riscv64 6 | 7 | package ubinary 8 | 9 | import ( 10 | "encoding/binary" 11 | ) 12 | 13 | // NativeEndian is $GOARCH's implementation of byte order. 14 | var NativeEndian = binary.LittleEndian 15 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/uio/uio/alignreader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package uio 6 | 7 | import ( 8 | "io" 9 | ) 10 | 11 | // AlignReader keeps track of how many bytes were read so the reader can be 12 | // aligned at a future time. 13 | type AlignReader struct { 14 | R io.Reader 15 | N int 16 | } 17 | 18 | // Read reads from the underlying io.Reader. 19 | func (r *AlignReader) Read(b []byte) (int, error) { 20 | n, err := r.R.Read(b) 21 | r.N += n 22 | return n, err 23 | } 24 | 25 | // ReadByte reads one byte from the underlying io.Reader. 26 | func (r *AlignReader) ReadByte() (byte, error) { 27 | b := make([]byte, 1) 28 | _, err := io.ReadFull(r, b) 29 | return b[0], err 30 | } 31 | 32 | // Align aligns the reader to the given number of bytes and returns the 33 | // bytes read to pad it. 34 | func (r *AlignReader) Align(n int) ([]byte, error) { 35 | if r.N%n == 0 { 36 | return []byte{}, nil 37 | } 38 | pad := make([]byte, n-r.N%n) 39 | m, err := io.ReadFull(r, pad) 40 | return pad[:m], err 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/uio/uio/alignwriter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package uio 6 | 7 | import ( 8 | "bytes" 9 | "io" 10 | ) 11 | 12 | // AlignWriter keeps track of how many bytes were written so the writer can be 13 | // aligned at a future time. 14 | type AlignWriter struct { 15 | W io.Writer 16 | N int 17 | } 18 | 19 | // Write writes to the underlying io.Writew. 20 | func (w *AlignWriter) Write(b []byte) (int, error) { 21 | n, err := w.W.Write(b) 22 | w.N += n 23 | return n, err 24 | } 25 | 26 | // Align aligns the writer to the given number of bytes using the given pad 27 | // value. 28 | func (w *AlignWriter) Align(n int, pad byte) error { 29 | if w.N%n == 0 { 30 | return nil 31 | } 32 | _, err := w.Write(bytes.Repeat([]byte{pad}, n-w.N%n)) 33 | return err 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/uio/uio/multiwriter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package uio 6 | 7 | import ( 8 | "io" 9 | ) 10 | 11 | type multiCloser struct { 12 | io.Writer 13 | writers []io.Writer 14 | } 15 | 16 | // Close implements io.Closer and closes any io.Writers that are also 17 | // io.Closers. 18 | func (mc *multiCloser) Close() error { 19 | var allErr error 20 | for _, w := range mc.writers { 21 | if c, ok := w.(io.Closer); ok { 22 | if err := c.Close(); err != nil { 23 | allErr = err 24 | } 25 | } 26 | } 27 | return allErr 28 | } 29 | 30 | // MultiWriteCloser is an io.MultiWriter that has an io.Closer and attempts to 31 | // close those w's that have optional io.Closers. 32 | func MultiWriteCloser(w ...io.Writer) io.WriteCloser { 33 | return &multiCloser{ 34 | Writer: io.MultiWriter(w...), 35 | writers: w, 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/uio/uio/progress.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package uio 6 | 7 | import ( 8 | "io" 9 | "strings" 10 | ) 11 | 12 | // ProgressReadCloser implements io.ReadCloser and prints Symbol to W after every 13 | // Interval bytes passes through RC. 14 | type ProgressReadCloser struct { 15 | RC io.ReadCloser 16 | 17 | Symbol string 18 | Interval int 19 | W io.Writer 20 | 21 | counter int 22 | written bool 23 | } 24 | 25 | // Read implements io.Reader for ProgressReadCloser. 26 | func (rc *ProgressReadCloser) Read(p []byte) (n int, err error) { 27 | defer func() { 28 | numSymbols := (rc.counter%rc.Interval + n) / rc.Interval 29 | rc.W.Write([]byte(strings.Repeat(rc.Symbol, numSymbols))) 30 | rc.counter += n 31 | rc.written = (rc.written || numSymbols > 0) 32 | if err == io.EOF && rc.written { 33 | rc.W.Write([]byte("\n")) 34 | } 35 | }() 36 | return rc.RC.Read(p) 37 | } 38 | 39 | // Close implements io.Closer for ProgressReader. 40 | func (rc *ProgressReadCloser) Close() error { 41 | return rc.RC.Close() 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/uio/uio/reader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package uio 6 | 7 | import ( 8 | "bytes" 9 | "io" 10 | "io/ioutil" 11 | "math" 12 | "reflect" 13 | ) 14 | 15 | type inMemReaderAt interface { 16 | Bytes() []byte 17 | } 18 | 19 | // ReadAll reads everything that r contains. 20 | // 21 | // Callers *must* not modify bytes in the returned byte slice. 22 | // 23 | // If r is an in-memory representation, ReadAll will attempt to return a 24 | // pointer to those bytes directly. 25 | func ReadAll(r io.ReaderAt) ([]byte, error) { 26 | if imra, ok := r.(inMemReaderAt); ok { 27 | return imra.Bytes(), nil 28 | } 29 | return ioutil.ReadAll(Reader(r)) 30 | } 31 | 32 | // Reader generates a Reader from a ReaderAt. 33 | func Reader(r io.ReaderAt) io.Reader { 34 | return io.NewSectionReader(r, 0, math.MaxInt64) 35 | } 36 | 37 | // ReaderAtEqual compares the contents of r1 and r2. 38 | func ReaderAtEqual(r1, r2 io.ReaderAt) bool { 39 | var c, d []byte 40 | var r1err, r2err error 41 | if r1 != nil { 42 | c, r1err = ReadAll(r1) 43 | } 44 | if r2 != nil { 45 | d, r2err = ReadAll(r2) 46 | } 47 | return bytes.Equal(c, d) && reflect.DeepEqual(r1err, r2err) 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/u-root/uio/uio/uio.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 the u-root Authors. All rights reserved 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package uio unifies commonly used io utilities for u-root. 6 | // 7 | // uio's most used feature is the Buffer/Lexer combination to parse binary data 8 | // of arbitrary endianness into data structures. 9 | package uio 10 | -------------------------------------------------------------------------------- /vendor/github.com/ulikunitz/xz/internal/hash/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014-2019 Ulrich Kunitz. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Package hash provides rolling hashes. 7 | 8 | Rolling hashes have to be used for maintaining the positions of n-byte 9 | sequences in the dictionary buffer. 10 | 11 | The package provides currently the Rabin-Karp rolling hash and a Cyclic 12 | Polynomial hash. Both support the Hashes method to be used with an interface. 13 | */ 14 | package hash 15 | -------------------------------------------------------------------------------- /vendor/github.com/ulikunitz/xz/internal/hash/roller.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014-2019 Ulrich Kunitz. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package hash 6 | 7 | // Roller provides an interface for rolling hashes. The hash value will become 8 | // valid after hash has been called Len times. 9 | type Roller interface { 10 | Len() int 11 | RollByte(x byte) uint64 12 | } 13 | 14 | // Hashes computes all hash values for the array p. Note that the state of the 15 | // roller is changed. 16 | func Hashes(r Roller, p []byte) []uint64 { 17 | n := r.Len() 18 | if len(p) < n { 19 | return nil 20 | } 21 | h := make([]uint64, len(p)-n+1) 22 | for i := 0; i < n-1; i++ { 23 | r.RollByte(p[i]) 24 | } 25 | for i := range h { 26 | h[i] = r.RollByte(p[i+n-1]) 27 | } 28 | return h 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/ulikunitz/xz/lzma/bitops.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014-2019 Ulrich Kunitz. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package lzma 6 | 7 | /* Naming conventions follows the CodeReviewComments in the Go Wiki. */ 8 | 9 | // ntz32Const is used by the functions NTZ and NLZ. 10 | const ntz32Const = 0x04d7651f 11 | 12 | // ntz32Table is a helper table for de Bruijn algorithm by Danny Dubé. 13 | // See Henry S. Warren, Jr. "Hacker's Delight" section 5-1 figure 5-26. 14 | var ntz32Table = [32]int8{ 15 | 0, 1, 2, 24, 3, 19, 6, 25, 16 | 22, 4, 20, 10, 16, 7, 12, 26, 17 | 31, 23, 18, 5, 21, 9, 15, 11, 18 | 30, 17, 8, 14, 29, 13, 28, 27, 19 | } 20 | 21 | // ntz32 computes the number of trailing zeros for an unsigned 32-bit integer. 22 | func ntz32(x uint32) int { 23 | if x == 0 { 24 | return 32 25 | } 26 | x = (x & -x) * ntz32Const 27 | return int(ntz32Table[x>>27]) 28 | } 29 | 30 | // nlz32 computes the number of leading zeros for an unsigned 32-bit integer. 31 | func nlz32(x uint32) int { 32 | // Smear left most bit to the right 33 | x |= x >> 1 34 | x |= x >> 2 35 | x |= x >> 4 36 | x |= x >> 8 37 | x |= x >> 16 38 | // Use ntz mechanism to calculate nlz. 39 | x++ 40 | if x == 0 { 41 | return 0 42 | } 43 | x *= ntz32Const 44 | return 32 - int(ntz32Table[x>>27]) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/ulikunitz/xz/lzma/breader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014-2019 Ulrich Kunitz. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package lzma 6 | 7 | import ( 8 | "errors" 9 | "io" 10 | ) 11 | 12 | // breader provides the ReadByte function for a Reader. It doesn't read 13 | // more data from the reader than absolutely necessary. 14 | type breader struct { 15 | io.Reader 16 | // helper slice to save allocations 17 | p []byte 18 | } 19 | 20 | // ByteReader converts an io.Reader into an io.ByteReader. 21 | func ByteReader(r io.Reader) io.ByteReader { 22 | br, ok := r.(io.ByteReader) 23 | if !ok { 24 | return &breader{r, make([]byte, 1)} 25 | } 26 | return br 27 | } 28 | 29 | // ReadByte read byte function. 30 | func (r *breader) ReadByte() (c byte, err error) { 31 | n, err := r.Reader.Read(r.p) 32 | if n < 1 { 33 | if err == nil { 34 | err = errors.New("breader.ReadByte: no data") 35 | } 36 | return 0, err 37 | } 38 | return r.p[0], nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/ulikunitz/xz/lzma/bytewriter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014-2019 Ulrich Kunitz. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package lzma 6 | 7 | import ( 8 | "errors" 9 | "io" 10 | ) 11 | 12 | // ErrLimit indicates that the limit of the LimitedByteWriter has been 13 | // reached. 14 | var ErrLimit = errors.New("limit reached") 15 | 16 | // LimitedByteWriter provides a byte writer that can be written until a 17 | // limit is reached. The field N provides the number of remaining 18 | // bytes. 19 | type LimitedByteWriter struct { 20 | BW io.ByteWriter 21 | N int64 22 | } 23 | 24 | // WriteByte writes a single byte to the limited byte writer. It returns 25 | // ErrLimit if the limit has been reached. If the byte is successfully 26 | // written the field N of the LimitedByteWriter will be decremented by 27 | // one. 28 | func (l *LimitedByteWriter) WriteByte(c byte) error { 29 | if l.N <= 0 { 30 | return ErrLimit 31 | } 32 | if err := l.BW.WriteByte(c); err != nil { 33 | return err 34 | } 35 | l.N-- 36 | return nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/ulikunitz/xz/lzma/fox.lzma: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/system-transparency/stboot/3934def0959e6b0f6f9fe39e3d66639fdaa6d1c5/vendor/github.com/ulikunitz/xz/lzma/fox.lzma -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - "1.12.x" 4 | - "1.13.x" 5 | - "1.14.x" 6 | before_script: 7 | # make sure we keep path in tact when we sudo 8 | - sudo sed -i -e 's/^Defaults\tsecure_path.*$//' /etc/sudoers 9 | # modprobe ip_gre or else the first gre device can't be deleted 10 | - sudo modprobe ip_gre 11 | # modprobe nf_conntrack for the conntrack testing 12 | - sudo modprobe nf_conntrack 13 | - sudo modprobe nf_conntrack_netlink 14 | - sudo modprobe nf_conntrack_ipv4 15 | - sudo modprobe nf_conntrack_ipv6 16 | - sudo modprobe sch_hfsc 17 | - sudo modprobe sch_sfq 18 | install: 19 | - go get -v -t ./... 20 | go_import_path: github.com/vishvananda/netlink 21 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 1.0.0 (2018-03-15) 4 | 5 | Initial release tagging -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/Makefile: -------------------------------------------------------------------------------- 1 | DIRS := \ 2 | . \ 3 | nl 4 | 5 | DEPS = \ 6 | github.com/vishvananda/netns \ 7 | golang.org/x/sys/unix 8 | 9 | uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))) 10 | testdirs = $(call uniq,$(foreach d,$(1),$(dir $(wildcard $(d)/*_test.go)))) 11 | goroot = $(addprefix ../../../,$(1)) 12 | unroot = $(subst ../../../,,$(1)) 13 | fmt = $(addprefix fmt-,$(1)) 14 | 15 | all: test 16 | 17 | $(call goroot,$(DEPS)): 18 | go get $(call unroot,$@) 19 | 20 | .PHONY: $(call testdirs,$(DIRS)) 21 | $(call testdirs,$(DIRS)): 22 | go test -test.exec sudo -test.parallel 4 -timeout 60s -test.v github.com/vishvananda/netlink/$@ 23 | 24 | $(call fmt,$(call testdirs,$(DIRS))): 25 | ! gofmt -l $(subst fmt-,,$@)/*.go | grep -q . 26 | 27 | .PHONY: fmt 28 | fmt: $(call fmt,$(call testdirs,$(DIRS))) 29 | 30 | test: fmt $(call goroot,$(DEPS)) $(call testdirs,$(DIRS)) 31 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/fou.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | var ( 8 | // ErrAttrHeaderTruncated is returned when a netlink attribute's header is 9 | // truncated. 10 | ErrAttrHeaderTruncated = errors.New("attribute header truncated") 11 | // ErrAttrBodyTruncated is returned when a netlink attribute's body is 12 | // truncated. 13 | ErrAttrBodyTruncated = errors.New("attribute body truncated") 14 | ) 15 | 16 | type Fou struct { 17 | Family int 18 | Port int 19 | Protocol int 20 | EncapType int 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/fou_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package netlink 4 | 5 | func FouAdd(f Fou) error { 6 | return ErrNotImplemented 7 | } 8 | 9 | func FouDel(f Fou) error { 10 | return ErrNotImplemented 11 | } 12 | 13 | func FouList(fam int) ([]Fou, error) { 14 | return nil, ErrNotImplemented 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/genetlink_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package netlink 4 | 5 | type GenlOp struct{} 6 | 7 | type GenlMulticastGroup struct{} 8 | 9 | type GenlFamily struct{} 10 | 11 | func (h *Handle) GenlFamilyList() ([]*GenlFamily, error) { 12 | return nil, ErrNotImplemented 13 | } 14 | 15 | func GenlFamilyList() ([]*GenlFamily, error) { 16 | return nil, ErrNotImplemented 17 | } 18 | 19 | func (h *Handle) GenlFamilyGet(name string) (*GenlFamily, error) { 20 | return nil, ErrNotImplemented 21 | } 22 | 23 | func GenlFamilyGet(name string) (*GenlFamily, error) { 24 | return nil, ErrNotImplemented 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/inet_diag.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | // INET_DIAG constatns 4 | const ( 5 | INET_DIAG_NONE = iota 6 | INET_DIAG_MEMINFO 7 | INET_DIAG_INFO 8 | INET_DIAG_VEGASINFO 9 | INET_DIAG_CONG 10 | INET_DIAG_TOS 11 | INET_DIAG_TCLASS 12 | INET_DIAG_SKMEMINFO 13 | INET_DIAG_SHUTDOWN 14 | INET_DIAG_DCTCPINFO 15 | INET_DIAG_PROTOCOL 16 | INET_DIAG_SKV6ONLY 17 | INET_DIAG_LOCALS 18 | INET_DIAG_PEERS 19 | INET_DIAG_PAD 20 | INET_DIAG_MARK 21 | INET_DIAG_BBRINFO 22 | INET_DIAG_CLASS_ID 23 | INET_DIAG_MD5SIG 24 | INET_DIAG_MAX 25 | ) 26 | 27 | type InetDiagTCPInfoResp struct { 28 | InetDiagMsg *Socket 29 | TCPInfo *TCPInfo 30 | TCPBBRInfo *TCPBBRInfo 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/link_tuntap_linux.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | // ideally golang.org/x/sys/unix would define IfReq but it only has 4 | // IFNAMSIZ, hence this minimalistic implementation 5 | const ( 6 | SizeOfIfReq = 40 7 | IFNAMSIZ = 16 8 | ) 9 | 10 | type ifReq struct { 11 | Name [IFNAMSIZ]byte 12 | Flags uint16 13 | pad [SizeOfIfReq - IFNAMSIZ - 2]byte 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/neigh.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | // Neigh represents a link layer neighbor from netlink. 9 | type Neigh struct { 10 | LinkIndex int 11 | Family int 12 | State int 13 | Type int 14 | Flags int 15 | FlagsExt int 16 | IP net.IP 17 | HardwareAddr net.HardwareAddr 18 | LLIPAddr net.IP //Used in the case of NHRP 19 | Vlan int 20 | VNI int 21 | MasterIndex int 22 | } 23 | 24 | // String returns $ip/$hwaddr $label 25 | func (neigh *Neigh) String() string { 26 | return fmt.Sprintf("%s %s", neigh.IP, neigh.HardwareAddr) 27 | } 28 | 29 | // NeighUpdate is sent when a neighbor changes - type is RTM_NEWNEIGH or RTM_DELNEIGH. 30 | type NeighUpdate struct { 31 | Type uint16 32 | Neigh 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/netlink_linux.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import "github.com/vishvananda/netlink/nl" 4 | 5 | // Family type definitions 6 | const ( 7 | FAMILY_ALL = nl.FAMILY_ALL 8 | FAMILY_V4 = nl.FAMILY_V4 9 | FAMILY_V6 = nl.FAMILY_V6 10 | FAMILY_MPLS = nl.FAMILY_MPLS 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/netns_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package netlink 4 | 5 | func GetNetNsIdByPid(pid int) (int, error) { 6 | return 0, ErrNotImplemented 7 | } 8 | 9 | func SetNetNsIdByPid(pid, nsid int) error { 10 | return ErrNotImplemented 11 | } 12 | 13 | func GetNetNsIdByFd(fd int) (int, error) { 14 | return 0, ErrNotImplemented 15 | } 16 | 17 | func SetNetNsIdByFd(fd, nsid int) error { 18 | return ErrNotImplemented 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/nl/lwt_linux.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | const ( 4 | LWT_BPF_PROG_UNSPEC = iota 5 | LWT_BPF_PROG_FD 6 | LWT_BPF_PROG_NAME 7 | __LWT_BPF_PROG_MAX 8 | ) 9 | 10 | const ( 11 | LWT_BPF_PROG_MAX = __LWT_BPF_PROG_MAX - 1 12 | ) 13 | 14 | const ( 15 | LWT_BPF_UNSPEC = iota 16 | LWT_BPF_IN 17 | LWT_BPF_OUT 18 | LWT_BPF_XMIT 19 | LWT_BPF_XMIT_HEADROOM 20 | __LWT_BPF_MAX 21 | ) 22 | 23 | const ( 24 | LWT_BPF_MAX = __LWT_BPF_MAX - 1 25 | ) 26 | 27 | const ( 28 | LWT_BPF_MAX_HEADROOM = 256 29 | ) 30 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/nl/mpls_linux.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | import "encoding/binary" 4 | 5 | const ( 6 | MPLS_LS_LABEL_SHIFT = 12 7 | MPLS_LS_S_SHIFT = 8 8 | ) 9 | 10 | func EncodeMPLSStack(labels ...int) []byte { 11 | b := make([]byte, 4*len(labels)) 12 | for idx, label := range labels { 13 | l := label << MPLS_LS_LABEL_SHIFT 14 | if idx == len(labels)-1 { 15 | l |= 1 << MPLS_LS_S_SHIFT 16 | } 17 | binary.BigEndian.PutUint32(b[idx*4:], uint32(l)) 18 | } 19 | return b 20 | } 21 | 22 | func DecodeMPLSStack(buf []byte) []int { 23 | if len(buf)%4 != 0 { 24 | return nil 25 | } 26 | stack := make([]int, 0, len(buf)/4) 27 | for len(buf) > 0 { 28 | l := binary.BigEndian.Uint32(buf[:4]) 29 | buf = buf[4:] 30 | stack = append(stack, int(l)>>MPLS_LS_LABEL_SHIFT) 31 | if (l>>MPLS_LS_S_SHIFT)&1 > 0 { 32 | break 33 | } 34 | } 35 | return stack 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/nl/nl_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package nl 4 | 5 | import "encoding/binary" 6 | 7 | var SupportedNlFamilies = []int{} 8 | 9 | func NativeEndian() binary.ByteOrder { 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/nl/rdma_link_linux.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | const ( 4 | RDMA_NL_GET_CLIENT_SHIFT = 10 5 | ) 6 | 7 | const ( 8 | RDMA_NL_NLDEV = 5 9 | ) 10 | 11 | const ( 12 | RDMA_NLDEV_CMD_GET = 1 13 | RDMA_NLDEV_CMD_SET = 2 14 | RDMA_NLDEV_CMD_NEWLINK = 3 15 | RDMA_NLDEV_CMD_DELLINK = 4 16 | RDMA_NLDEV_CMD_SYS_GET = 6 17 | RDMA_NLDEV_CMD_SYS_SET = 7 18 | ) 19 | 20 | const ( 21 | RDMA_NLDEV_ATTR_DEV_INDEX = 1 22 | RDMA_NLDEV_ATTR_DEV_NAME = 2 23 | RDMA_NLDEV_ATTR_PORT_INDEX = 3 24 | RDMA_NLDEV_ATTR_CAP_FLAGS = 4 25 | RDMA_NLDEV_ATTR_FW_VERSION = 5 26 | RDMA_NLDEV_ATTR_NODE_GUID = 6 27 | RDMA_NLDEV_ATTR_SYS_IMAGE_GUID = 7 28 | RDMA_NLDEV_ATTR_SUBNET_PREFIX = 8 29 | RDMA_NLDEV_ATTR_LID = 9 30 | RDMA_NLDEV_ATTR_SM_LID = 10 31 | RDMA_NLDEV_ATTR_LMC = 11 32 | RDMA_NLDEV_ATTR_PORT_STATE = 12 33 | RDMA_NLDEV_ATTR_PORT_PHYS_STATE = 13 34 | RDMA_NLDEV_ATTR_DEV_NODE_TYPE = 14 35 | RDMA_NLDEV_ATTR_NDEV_NAME = 51 36 | RDMA_NLDEV_ATTR_LINK_TYPE = 65 37 | RDMA_NLDEV_SYS_ATTR_NETNS_MODE = 66 38 | RDMA_NLDEV_NET_NS_FD = 68 39 | ) 40 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/nl/xfrm_monitor_linux.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | import ( 4 | "unsafe" 5 | ) 6 | 7 | const ( 8 | SizeofXfrmUserExpire = 0xe8 9 | ) 10 | 11 | // struct xfrm_user_expire { 12 | // struct xfrm_usersa_info state; 13 | // __u8 hard; 14 | // }; 15 | 16 | type XfrmUserExpire struct { 17 | XfrmUsersaInfo XfrmUsersaInfo 18 | Hard uint8 19 | Pad [7]byte 20 | } 21 | 22 | func (msg *XfrmUserExpire) Len() int { 23 | return SizeofXfrmUserExpire 24 | } 25 | 26 | func DeserializeXfrmUserExpire(b []byte) *XfrmUserExpire { 27 | return (*XfrmUserExpire)(unsafe.Pointer(&b[0:SizeofXfrmUserExpire][0])) 28 | } 29 | 30 | func (msg *XfrmUserExpire) Serialize() []byte { 31 | return (*(*[SizeofXfrmUserExpire]byte)(unsafe.Pointer(msg)))[:] 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/order.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "encoding/binary" 5 | 6 | "github.com/vishvananda/netlink/nl" 7 | ) 8 | 9 | var ( 10 | native = nl.NativeEndian() 11 | networkOrder = binary.BigEndian 12 | ) 13 | 14 | func htonl(val uint32) []byte { 15 | bytes := make([]byte, 4) 16 | binary.BigEndian.PutUint32(bytes, val) 17 | return bytes 18 | } 19 | 20 | func htons(val uint16) []byte { 21 | bytes := make([]byte, 2) 22 | binary.BigEndian.PutUint16(bytes, val) 23 | return bytes 24 | } 25 | 26 | func ntohl(buf []byte) uint32 { 27 | return binary.BigEndian.Uint32(buf) 28 | } 29 | 30 | func ntohs(buf []byte) uint16 { 31 | return binary.BigEndian.Uint16(buf) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/route_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package netlink 4 | 5 | import "strconv" 6 | 7 | func (r *Route) ListFlags() []string { 8 | return []string{} 9 | } 10 | 11 | func (n *NexthopInfo) ListFlags() []string { 12 | return []string{} 13 | } 14 | 15 | func (s Scope) String() string { 16 | return "unknown" 17 | } 18 | 19 | func (p RouteProtocol) String() string { 20 | return strconv.Itoa(int(p)) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/socket.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import "net" 4 | 5 | // SocketID identifies a single socket. 6 | type SocketID struct { 7 | SourcePort uint16 8 | DestinationPort uint16 9 | Source net.IP 10 | Destination net.IP 11 | Interface uint32 12 | Cookie [2]uint32 13 | } 14 | 15 | // Socket represents a netlink socket. 16 | type Socket struct { 17 | Family uint8 18 | State uint8 19 | Timer uint8 20 | Retrans uint8 21 | ID SocketID 22 | Expires uint32 23 | RQueue uint32 24 | WQueue uint32 25 | UID uint32 26 | INode uint32 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netns/netns_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package netns 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | var ( 10 | ErrNotImplemented = errors.New("not implemented") 11 | ) 12 | 13 | func Set(ns NsHandle) (err error) { 14 | return ErrNotImplemented 15 | } 16 | 17 | func New() (ns NsHandle, err error) { 18 | return -1, ErrNotImplemented 19 | } 20 | 21 | func Get() (NsHandle, error) { 22 | return -1, ErrNotImplemented 23 | } 24 | 25 | func GetFromPath(path string) (NsHandle, error) { 26 | return -1, ErrNotImplemented 27 | } 28 | 29 | func GetFromName(name string) (NsHandle, error) { 30 | return -1, ErrNotImplemented 31 | } 32 | 33 | func GetFromPid(pid int) (NsHandle, error) { 34 | return -1, ErrNotImplemented 35 | } 36 | 37 | func GetFromThread(pid, tid int) (NsHandle, error) { 38 | return -1, ErrNotImplemented 39 | } 40 | 41 | func GetFromDocker(id string) (NsHandle, error) { 42 | return -1, ErrNotImplemented 43 | } 44 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/bpf/setter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bpf 6 | 7 | // A Setter is a type which can attach a compiled BPF filter to itself. 8 | type Setter interface { 9 | SetBPF(filter []RawInstruction) error 10 | } 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package unsafeheader contains header declarations for the Go runtime's 6 | // slice and string implementations. 7 | // 8 | // This package allows x/sys to use types equivalent to 9 | // reflect.SliceHeader and reflect.StringHeader without introducing 10 | // a dependency on the (relatively heavy) "reflect" package. 11 | package unsafeheader 12 | 13 | import ( 14 | "unsafe" 15 | ) 16 | 17 | // Slice is the runtime representation of a slice. 18 | // It cannot be used safely or portably and its representation may change in a later release. 19 | type Slice struct { 20 | Data unsafe.Pointer 21 | Len int 22 | Cap int 23 | } 24 | 25 | // String is the runtime representation of a string. 26 | // It cannot be used safely or portably and its representation may change in a later release. 27 | type String struct { 28 | Data unsafe.Pointer 29 | Len int 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | // +build go1.9 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | type Signal = syscall.Signal 14 | type Errno = syscall.Errno 15 | type SysProcAttr = syscall.SysProcAttr 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 12 | // 13 | 14 | TEXT ·syscall6(SB),NOSPLIT,$0-88 15 | JMP syscall·syscall6(SB) 16 | 17 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 18 | JMP syscall·rawSyscall6(SB) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | // +build freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for 386 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | // +build darwin dragonfly freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for AMD64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | // +build freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for ARM BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | // +build darwin freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for ARM64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for arm, Linux 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 24 | BL runtime·entersyscall(SB) 25 | MOVW trap+0(FP), R7 26 | MOVW a1+4(FP), R0 27 | MOVW a2+8(FP), R1 28 | MOVW a3+12(FP), R2 29 | MOVW $0, R3 30 | MOVW $0, R4 31 | MOVW $0, R5 32 | SWI $0 33 | MOVW R0, r1+16(FP) 34 | MOVW $0, R0 35 | MOVW R0, r2+20(FP) 36 | BL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 40 | B syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 43 | B syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 46 | MOVW trap+0(FP), R7 // syscall entry 47 | MOVW a1+4(FP), R0 48 | MOVW a2+8(FP), R1 49 | MOVW a3+12(FP), R2 50 | SWI $0 51 | MOVW R0, r1+16(FP) 52 | MOVW $0, R0 53 | MOVW R0, r2+20(FP) 54 | RET 55 | 56 | TEXT ·seek(SB),NOSPLIT,$0-28 57 | B syscall·seek(SB) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && arm64 && gc 6 | // +build linux 7 | // +build arm64 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // Just jump to package syscall's implementation for all these functions. 13 | // The runtime may know about them. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | B syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | B syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | BL runtime·entersyscall(SB) 23 | MOVD a1+8(FP), R0 24 | MOVD a2+16(FP), R1 25 | MOVD a3+24(FP), R2 26 | MOVD $0, R3 27 | MOVD $0, R4 28 | MOVD $0, R5 29 | MOVD trap+0(FP), R8 // syscall entry 30 | SVC 31 | MOVD R0, r1+32(FP) // r1 32 | MOVD R1, r2+40(FP) // r2 33 | BL runtime·exitsyscall(SB) 34 | RET 35 | 36 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 37 | B syscall·RawSyscall(SB) 38 | 39 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 40 | B syscall·RawSyscall6(SB) 41 | 42 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 43 | MOVD a1+8(FP), R0 44 | MOVD a2+16(FP), R1 45 | MOVD a3+24(FP), R2 46 | MOVD $0, R3 47 | MOVD $0, R4 48 | MOVD $0, R5 49 | MOVD trap+0(FP), R8 // syscall entry 50 | SVC 51 | MOVD R0, r1+32(FP) 52 | MOVD R1, r2+40(FP) 53 | RET 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_loong64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && loong64 && gc 6 | // +build linux 7 | // +build loong64 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 23 | JAL runtime·entersyscall(SB) 24 | MOVV a1+8(FP), R4 25 | MOVV a2+16(FP), R5 26 | MOVV a3+24(FP), R6 27 | MOVV R0, R7 28 | MOVV R0, R8 29 | MOVV R0, R9 30 | MOVV trap+0(FP), R11 // syscall entry 31 | SYSCALL 32 | MOVV R4, r1+32(FP) 33 | MOVV R5, r2+40(FP) 34 | JAL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | JMP syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | JMP syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVV a1+8(FP), R4 45 | MOVV a2+16(FP), R5 46 | MOVV a3+24(FP), R6 47 | MOVV R0, R7 48 | MOVV R0, R8 49 | MOVV R0, R9 50 | MOVV trap+0(FP), R11 // syscall entry 51 | SYSCALL 52 | MOVV R4, r1+32(FP) 53 | MOVV R5, r2+40(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64 || ppc64le) && gc 6 | // +build linux 7 | // +build ppc64 ppc64le 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for ppc64, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 20 | BL runtime·entersyscall(SB) 21 | MOVD a1+8(FP), R3 22 | MOVD a2+16(FP), R4 23 | MOVD a3+24(FP), R5 24 | MOVD R0, R6 25 | MOVD R0, R7 26 | MOVD R0, R8 27 | MOVD trap+0(FP), R9 // syscall entry 28 | SYSCALL R9 29 | MOVD R3, r1+32(FP) 30 | MOVD R4, r2+40(FP) 31 | BL runtime·exitsyscall(SB) 32 | RET 33 | 34 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 35 | MOVD a1+8(FP), R3 36 | MOVD a2+16(FP), R4 37 | MOVD a3+24(FP), R5 38 | MOVD R0, R6 39 | MOVD R0, R7 40 | MOVD R0, R8 41 | MOVD trap+0(FP), R9 // syscall entry 42 | SYSCALL R9 43 | MOVD R3, r1+32(FP) 44 | MOVD R4, r2+40(FP) 45 | RET 46 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && gc 6 | // +build riscv64 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for linux/riscv64. 13 | // 14 | // Where available, just jump to package syscall's implementation of 15 | // these functions. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 24 | CALL runtime·entersyscall(SB) 25 | MOV a1+8(FP), A0 26 | MOV a2+16(FP), A1 27 | MOV a3+24(FP), A2 28 | MOV trap+0(FP), A7 // syscall entry 29 | ECALL 30 | MOV A0, r1+32(FP) // r1 31 | MOV A1, r2+40(FP) // r2 32 | CALL runtime·exitsyscall(SB) 33 | RET 34 | 35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 36 | JMP syscall·RawSyscall(SB) 37 | 38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 39 | JMP syscall·RawSyscall6(SB) 40 | 41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 42 | MOV a1+8(FP), A0 43 | MOV a2+16(FP), A1 44 | MOV a3+24(FP), A2 45 | MOV trap+0(FP), A7 // syscall entry 46 | ECALL 47 | MOV A0, r1+32(FP) 48 | MOV A1, r2+40(FP) 49 | RET 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for mips64, OpenBSD 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | JMP syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | JMP syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | JMP syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 12 | // 13 | 14 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 15 | JMP syscall·sysvicall6(SB) 16 | 17 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 18 | JMP syscall·rawSysvicall6(SB) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | const ( 11 | R_OK = 0x4 12 | W_OK = 0x2 13 | X_OK = 0x1 14 | ) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc 6 | // +build aix,ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc64 6 | // +build aix,ppc64 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev & 0x3fffffff00000000) >> 32) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32((dev & 0x00000000ffffffff) >> 0) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | var DEVNO64 uint64 27 | DEVNO64 = 0x8000000000000000 28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build zos && s390x 6 | // +build zos,s390x 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by z/OS. 10 | // 11 | // The information below is extracted and adapted from macros. 12 | 13 | package unix 14 | 15 | // Major returns the major component of a z/OS device number. 16 | func Major(dev uint64) uint32 { 17 | return uint32((dev >> 16) & 0x0000FFFF) 18 | } 19 | 20 | // Minor returns the minor component of a z/OS device number. 21 | func Minor(dev uint64) uint32 { 22 | return uint32(dev & 0x0000FFFF) 23 | } 24 | 25 | // Mkdev returns a z/OS device number generated from the given major and minor 26 | // components. 27 | func Mkdev(major, minor uint32) uint64 { 28 | return (uint64(major) << 16) | uint64(minor) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | // +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64 7 | 8 | package unix 9 | 10 | const isBigEndian = true 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 6 | // +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh 7 | 8 | package unix 9 | 10 | const isBigEndian = false 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | // Unix environment variables. 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Getenv(key string) (value string, found bool) { 15 | return syscall.Getenv(key) 16 | } 17 | 18 | func Setenv(key, value string) error { 19 | return syscall.Setenv(key, value) 20 | } 21 | 22 | func Clearenv() { 23 | syscall.Clearenv() 24 | } 25 | 26 | func Environ() []string { 27 | return syscall.Environ() 28 | } 29 | 30 | func Unsetenv(key string) error { 31 | return syscall.Unsetenv(key) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Constants that were deprecated or moved to enums in the FreeBSD headers. Keep 6 | // them here for backwards compatibility. 7 | 8 | package unix 9 | 10 | const ( 11 | DLT_HHDLC = 0x79 12 | IPV6_MIN_MEMBERSHIPS = 0x1f 13 | IP_MAX_SOURCE_FILTER = 0x400 14 | IP_MIN_MEMBERSHIPS = 0x1f 15 | RT_CACHING_CONTEXT = 0x1 16 | RT_NORTREF = 0x2 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build dragonfly || freebsd || linux || netbsd || openbsd 6 | // +build dragonfly freebsd linux netbsd openbsd 7 | 8 | package unix 9 | 10 | import "unsafe" 11 | 12 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 13 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64. 14 | var fcntl64Syscall uintptr = SYS_FCNTL 15 | 16 | func fcntl(fd int, cmd, arg int) (int, error) { 17 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) 18 | var err error 19 | if errno != 0 { 20 | err = errno 21 | } 22 | return int(valptr), err 23 | } 24 | 25 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 26 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 27 | return fcntl(int(fd), cmd, arg) 28 | } 29 | 30 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 31 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 32 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 33 | if errno == 0 { 34 | return nil 35 | } 36 | return errno 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 6 | // +build linux,386 linux,arm linux,mips linux,mipsle linux,ppc 7 | 8 | package unix 9 | 10 | func init() { 11 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 12 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 13 | fcntl64Syscall = SYS_FCNTL64 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | // Set adds fd to the set fds. 11 | func (fds *FdSet) Set(fd int) { 12 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 13 | } 14 | 15 | // Clear removes fd from the set fds. 16 | func (fds *FdSet) Clear(fd int) { 17 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 18 | } 19 | 20 | // IsSet returns whether fd is in the set fds. 21 | func (fds *FdSet) IsSet(fd int) bool { 22 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 23 | } 24 | 25 | // Zero clears the set fds. 26 | func (fds *FdSet) Zero() { 27 | for i := range fds.Bits { 28 | fds.Bits[i] = 0 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && linux && amd64 6 | // +build gccgo,linux,amd64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //extern gettimeofday 13 | func realGettimeofday(*Timeval, *byte) int32 14 | 15 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 16 | r := realGettimeofday(tv, nil) 17 | if r < 0 { 18 | return syscall.GetErrno() 19 | } 20 | return 0 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 7 | 8 | // For Unix, get the pagesize from the runtime. 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Getpagesize() int { 15 | return syscall.Getpagesize() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | // +build darwin,!ios 7 | 8 | package unix 9 | 10 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 11 | return ptrace1(request, pid, addr, data) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ios 6 | // +build ios 7 | 8 | package unix 9 | 10 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 11 | return ENOTSUP 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && race) || (linux && race) || (freebsd && race) 6 | // +build darwin,race linux,race freebsd,race 7 | 8 | package unix 9 | 10 | import ( 11 | "runtime" 12 | "unsafe" 13 | ) 14 | 15 | const raceenabled = true 16 | 17 | func raceAcquire(addr unsafe.Pointer) { 18 | runtime.RaceAcquire(addr) 19 | } 20 | 21 | func raceReleaseMerge(addr unsafe.Pointer) { 22 | runtime.RaceReleaseMerge(addr) 23 | } 24 | 25 | func raceReadRange(addr unsafe.Pointer, len int) { 26 | runtime.RaceReadRange(addr, len) 27 | } 28 | 29 | func raceWriteRange(addr unsafe.Pointer, len int) { 30 | runtime.RaceWriteRange(addr, len) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 6 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly zos 7 | 8 | package unix 9 | 10 | import ( 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = false 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | } 18 | 19 | func raceReleaseMerge(addr unsafe.Pointer) { 20 | } 21 | 22 | func raceReadRange(addr unsafe.Pointer, len int) { 23 | } 24 | 25 | func raceWriteRange(addr unsafe.Pointer, len int) { 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd 6 | // +build aix dragonfly freebsd linux netbsd openbsd 7 | 8 | package unix 9 | 10 | // ReadDirent reads directory entries from fd and writes them into buf. 11 | func ReadDirent(fd int, buf []byte) (n int, err error) { 12 | return Getdents(fd, buf) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin 6 | // +build darwin 7 | 8 | package unix 9 | 10 | import "unsafe" 11 | 12 | // ReadDirent reads directory entries from fd and writes them into buf. 13 | func ReadDirent(fd int, buf []byte) (n int, err error) { 14 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 15 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 16 | // actual system call is getdirentries64, 64 is a good guess. 17 | // TODO(rsc): Can we use a single global basep for all calls? 18 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 19 | return Getdirentries(fd, buf, base) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 7 | 8 | package unix 9 | 10 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 11 | if val < 0 { 12 | return "-" + uitoa(uint(-val)) 13 | } 14 | return uitoa(uint(val)) 15 | } 16 | 17 | func uitoa(val uint) string { 18 | var buf [32]byte // big enough for int64 19 | i := len(buf) - 1 20 | for val >= 10 { 21 | buf[i] = byte(val%10 + '0') 22 | i-- 23 | val /= 10 24 | } 25 | buf[i] = byte(val + '0') 26 | return string(buf[i:]) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && go1.12 && !go1.13 6 | // +build darwin,go1.12,!go1.13 7 | 8 | package unix 9 | 10 | import ( 11 | "unsafe" 12 | ) 13 | 14 | const _SYS_GETDIRENTRIES64 = 344 15 | 16 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 17 | // To implement this using libSystem we'd need syscall_syscallPtr for 18 | // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall 19 | // back to raw syscalls for this func on Go 1.12. 20 | var p unsafe.Pointer 21 | if len(buf) > 0 { 22 | p = unsafe.Pointer(&buf[0]) 23 | } else { 24 | p = unsafe.Pointer(&_zero) 25 | } 26 | r0, _, e1 := Syscall6(_SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) 27 | n = int(r0) 28 | if e1 != 0 { 29 | return n, errnoErr(e1) 30 | } 31 | return n, nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && go1.12 6 | // +build darwin,go1.12 7 | 8 | package unix 9 | 10 | import _ "unsafe" 11 | 12 | // Implemented in the runtime package (runtime/sys_darwin.go) 13 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 16 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only 17 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 18 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 19 | func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 20 | 21 | //go:linkname syscall_syscall syscall.syscall 22 | //go:linkname syscall_syscall6 syscall.syscall6 23 | //go:linkname syscall_syscall6X syscall.syscall6X 24 | //go:linkname syscall_syscall9 syscall.syscall9 25 | //go:linkname syscall_rawSyscall syscall.rawSyscall 26 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 27 | //go:linkname syscall_syscallPtr syscall.syscallPtr 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_alarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) 6 | // +build linux 7 | // +build 386 amd64 mips mipsle mips64 mipsle ppc64 ppc64le ppc s390x sparc64 8 | 9 | package unix 10 | 11 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 12 | // values. 13 | 14 | //sys Alarm(seconds uint) (remaining uint, err error) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && linux && gc 6 | // +build amd64,linux,gc 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc 6 | // +build linux,gc 7 | 8 | package unix 9 | 10 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 11 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 12 | 13 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 14 | // fail. 15 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc && 386 6 | // +build linux,gc,386 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | // Underlying system call writes to newoffset via pointer. 13 | // Implemented in assembly to avoid allocation. 14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 15 | 16 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && gc && linux 6 | // +build arm,gc,linux 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | // Underlying system call writes to newoffset via pointer. 13 | // Implemented in assembly to avoid allocation. 14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && 386 6 | // +build linux,gccgo,386 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 16 | var newoffset int64 17 | offsetLow := uint32(offset & 0xffffffff) 18 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 19 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 20 | return newoffset, err 21 | } 22 | 23 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 24 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 25 | return int(fd), err 26 | } 27 | 28 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 29 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 30 | return int(fd), err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && arm 6 | // +build linux,gccgo,arm 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 16 | var newoffset int64 17 | offsetLow := uint32(offset & 0xffffffff) 18 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 19 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 20 | return newoffset, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && netbsd 6 | // +build 386,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && netbsd 6 | // +build amd64,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && netbsd 6 | // +build arm,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && netbsd 6 | // +build arm64,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && openbsd 6 | // +build 386,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && openbsd 6 | // +build amd64,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && openbsd 6 | // +build arm,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && openbsd 6 | // +build arm64,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | func setTimespec(sec, nsec int64) Timespec { 8 | return Timespec{Sec: sec, Nsec: nsec} 9 | } 10 | 11 | func setTimeval(sec, usec int64) Timeval { 12 | return Timeval{Sec: sec, Usec: usec} 13 | } 14 | 15 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 16 | k.Ident = uint64(fd) 17 | k.Filter = int16(mode) 18 | k.Flags = uint16(flags) 19 | } 20 | 21 | func (iov *Iovec) SetLen(length int) { 22 | iov.Len = uint64(length) 23 | } 24 | 25 | func (msghdr *Msghdr) SetControllen(length int) { 26 | msghdr.Controllen = uint32(length) 27 | } 28 | 29 | func (cmsg *Cmsghdr) SetLen(length int) { 30 | cmsg.Len = uint32(length) 31 | } 32 | 33 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 34 | // of OpenBSD the syscall is called sysctl instead of __sysctl. 35 | const SYS___SYSCTL = SYS_SYSCTL 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && solaris 6 | // +build amd64,solaris 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func (iov *Iovec) SetLen(length int) { 19 | iov.Len = uint64(length) 20 | } 21 | 22 | func (msghdr *Msghdr) SetIovlen(length int) { 23 | msghdr.Iovlen = int32(length) 24 | } 25 | 26 | func (cmsg *Cmsghdr) SetLen(length int) { 27 | cmsg.Len = uint32(length) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && gc && !ppc64le && !ppc64 6 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 7 | // +build gc 8 | // +build !ppc64le 9 | // +build !ppc64 10 | 11 | package unix 12 | 13 | import "syscall" 14 | 15 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 18 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64le || ppc64) && gc 6 | // +build linux 7 | // +build ppc64le ppc64 8 | // +build gc 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall(trap, a1, a2, a3) 16 | } 17 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 19 | } 20 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall(trap, a1, a2, a3) 22 | } 23 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 24 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux 6 | // +build linux 7 | 8 | package unix 9 | 10 | import "runtime" 11 | 12 | // SysvShmCtl performs control operations on the shared memory segment 13 | // specified by id. 14 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 15 | if runtime.GOARCH == "arm" || 16 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 17 | cmd |= ipc_64 18 | } 19 | 20 | return shmctl(id, cmd, desc) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | // +build darwin,!ios 7 | 8 | package unix 9 | 10 | // SysvShmCtl performs control operations on the shared memory segment 11 | // specified by id. 12 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 13 | return shmctl(id, cmd, desc) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/unveil_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | // Unveil implements the unveil syscall. 13 | // For more information see unveil(2). 14 | // Note that the special case of blocking further 15 | // unveil calls is handled by UnveilBlock. 16 | func Unveil(path string, flags string) error { 17 | pathPtr, err := syscall.BytePtrFromString(path) 18 | if err != nil { 19 | return err 20 | } 21 | flagsPtr, err := syscall.BytePtrFromString(flags) 22 | if err != nil { 23 | return err 24 | } 25 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) 26 | if e != 0 { 27 | return e 28 | } 29 | return nil 30 | } 31 | 32 | // UnveilBlock blocks future unveil calls. 33 | // For more information see unveil(2). 34 | func UnveilBlock() error { 35 | // Both pointers must be nil. 36 | var pathUnsafe, flagsUnsafe unsafe.Pointer 37 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) 38 | if e != 0 { 39 | return e 40 | } 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go: -------------------------------------------------------------------------------- 1 | // go run mksyscall.go -tags darwin,amd64,go1.13 syscall_darwin.1_13.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | //go:build darwin && amd64 && go1.13 5 | // +build darwin,amd64,go1.13 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | var _ syscall.Errno 15 | 16 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 17 | 18 | func closedir(dir uintptr) (err error) { 19 | _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) 20 | if e1 != 0 { 21 | err = errnoErr(e1) 22 | } 23 | return 24 | } 25 | 26 | var libc_closedir_trampoline_addr uintptr 27 | 28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" 29 | 30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 31 | 32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { 33 | r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) 34 | res = Errno(r0) 35 | return 36 | } 37 | 38 | var libc_readdir_r_trampoline_addr uintptr 39 | 40 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go amd64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | //go:build go1.13 5 | // +build go1.13 6 | 7 | #include "textflag.h" 8 | 9 | TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 10 | JMP libc_fdopendir(SB) 11 | 12 | GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 13 | DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) 14 | 15 | TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 16 | JMP libc_closedir(SB) 17 | 18 | GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 19 | DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) 20 | 21 | TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 22 | JMP libc_readdir_r(SB) 23 | 24 | GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 25 | DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go: -------------------------------------------------------------------------------- 1 | // go run mksyscall.go -tags darwin,arm64,go1.13 syscall_darwin.1_13.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | //go:build darwin && arm64 && go1.13 5 | // +build darwin,arm64,go1.13 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | var _ syscall.Errno 15 | 16 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 17 | 18 | func closedir(dir uintptr) (err error) { 19 | _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) 20 | if e1 != 0 { 21 | err = errnoErr(e1) 22 | } 23 | return 24 | } 25 | 26 | var libc_closedir_trampoline_addr uintptr 27 | 28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" 29 | 30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 31 | 32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { 33 | r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) 34 | res = Errno(r0) 35 | return 36 | } 37 | 38 | var libc_readdir_r_trampoline_addr uintptr 39 | 40 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go arm64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | //go:build go1.13 5 | // +build go1.13 6 | 7 | #include "textflag.h" 8 | 9 | TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 10 | JMP libc_fdopendir(SB) 11 | 12 | GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 13 | DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) 14 | 15 | TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 16 | JMP libc_closedir(SB) 17 | 18 | GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 19 | DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) 20 | 21 | TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 22 | JMP libc_readdir_r(SB) 23 | 24 | GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 25 | DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go: -------------------------------------------------------------------------------- 1 | // cgo -godefs types_illumos.go | go run mkpost.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | //go:build amd64 && illumos 5 | // +build amd64,illumos 6 | 7 | package unix 8 | 9 | const ( 10 | TUNNEWPPA = 0x540001 11 | TUNSETPPA = 0x540002 12 | 13 | I_STR = 0x5308 14 | I_POP = 0x5303 15 | I_PUSH = 0x5302 16 | I_LINK = 0x530c 17 | I_UNLINK = 0x530d 18 | I_PLINK = 0x5316 19 | I_PUNLINK = 0x5317 20 | 21 | IF_UNITSEL = -0x7ffb8cca 22 | ) 23 | 24 | type strbuf struct { 25 | Maxlen int32 26 | Len int32 27 | Buf *int8 28 | } 29 | 30 | type Strioctl struct { 31 | Cmd int32 32 | Timout int32 33 | Len int32 34 | Dp *int8 35 | } 36 | 37 | type Lifreq struct { 38 | Name [32]int8 39 | Lifru1 [4]byte 40 | Type uint32 41 | Lifru [336]byte 42 | } 43 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v3/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - "1.4.x" 5 | - "1.5.x" 6 | - "1.6.x" 7 | - "1.7.x" 8 | - "1.8.x" 9 | - "1.9.x" 10 | - "1.10.x" 11 | - "1.11.x" 12 | - "1.12.x" 13 | - "1.13.x" 14 | - "tip" 15 | 16 | go_import_path: gopkg.in/yaml.v3 17 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v3/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | --------------------------------------------------------------------------------