mirror of
https://github.com/containers/skopeo.git
synced 2025-07-06 19:29:18 +00:00
Enable 'OptimizeDestinationImageAlreadyExists' feature
Signed-off-by: George Jenkins <gjenkins8@bloomberg.net>
This commit is contained in:
parent
2c8655e251
commit
61b62f9e93
@ -556,11 +556,12 @@ func (opts *syncOptions) run(args []string, stdout io.Writer) error {
|
||||
|
||||
imagesNumber := 0
|
||||
options := copy.Options{
|
||||
RemoveSignatures: opts.removeSignatures,
|
||||
SignBy: opts.signByFingerprint,
|
||||
ReportWriter: os.Stdout,
|
||||
DestinationCtx: destinationCtx,
|
||||
ImageListSelection: imageListSelection,
|
||||
RemoveSignatures: opts.removeSignatures,
|
||||
SignBy: opts.signByFingerprint,
|
||||
ReportWriter: os.Stdout,
|
||||
DestinationCtx: destinationCtx,
|
||||
ImageListSelection: imageListSelection,
|
||||
OptimizeDestinationImageAlreadyExists: true,
|
||||
}
|
||||
|
||||
for _, srcRepo := range srcRepoList {
|
||||
|
2
go.mod
2
go.mod
@ -4,7 +4,7 @@ go 1.12
|
||||
|
||||
require (
|
||||
github.com/containers/common v0.34.0
|
||||
github.com/containers/image/v5 v5.10.3
|
||||
github.com/containers/image/v5 v5.10.2-0.20210219165336-d21b4da7f368
|
||||
github.com/containers/ocicrypt v1.1.0
|
||||
github.com/containers/storage v1.26.0
|
||||
github.com/docker/docker v17.12.0-ce-rc1.0.20201020191947-73dc6a680cdd+incompatible
|
||||
|
14
go.sum
14
go.sum
@ -66,15 +66,14 @@ github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kw
|
||||
github.com/containers/common v0.34.0 h1:RM7L2ySdtLGpsTOixUglRwDwCXWDbERv2MpGKgdEtEg=
|
||||
github.com/containers/common v0.34.0/go.mod h1:HRfMBV9lPXaKWPW7dVgBe7fixLKLqcEQN7ndGyGXiAA=
|
||||
github.com/containers/image/v5 v5.10.1/go.mod h1:JlRLJZv7elVbtHaaaR6Kz8i6G3k2ttj4t7fubwxD9Hs=
|
||||
github.com/containers/image/v5 v5.10.3 h1:DHgdrNkiBVav/ca/5EdAzn682Zuy1gp6PQgK83fiAkw=
|
||||
github.com/containers/image/v5 v5.10.3/go.mod h1:SgIbWEedCNBbn2FI5cH0/jed1Ecy2s8XK5zTxvJTzII=
|
||||
github.com/containers/image/v5 v5.10.2-0.20210219165336-d21b4da7f368 h1:PRy034NcOmbuc6i5a5SRqei+vNiUfy//E7vN0qN2+RM=
|
||||
github.com/containers/image/v5 v5.10.2-0.20210219165336-d21b4da7f368/go.mod h1:f9mda5nhBwEiuduTbFS1Lm1CfcmxcflpOz/vpQGJXy0=
|
||||
github.com/containers/libtrust v0.0.0-20190913040956-14b96171aa3b h1:Q8ePgVfHDplZ7U33NwHZkrVELsZP5fYj9pM5WBZB2GE=
|
||||
github.com/containers/libtrust v0.0.0-20190913040956-14b96171aa3b/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY=
|
||||
github.com/containers/ocicrypt v1.0.3/go.mod h1:CUBa+8MRNL/VkpxYIpaMtgn1WgXGyvPQj8jcy0EVG6g=
|
||||
github.com/containers/ocicrypt v1.1.0 h1:A6UzSUFMla92uxO43O6lm86i7evMGjTY7wTKB2DyGPY=
|
||||
github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4=
|
||||
github.com/containers/storage v1.24.5/go.mod h1:YC+2pY8SkfEAcZkwycxYbpK8EiRbx5soPPwz9dxe4IQ=
|
||||
github.com/containers/storage v1.24.8/go.mod h1:YC+2pY8SkfEAcZkwycxYbpK8EiRbx5soPPwz9dxe4IQ=
|
||||
github.com/containers/storage v1.26.0 h1:YmD4x0m6/nruGf2Ev+MQ5FDyT3hjMyWVCsFSB9To2ZI=
|
||||
github.com/containers/storage v1.26.0/go.mod h1:o7PtlRZpFleYVu0TRAFSb/dPJHZnEk5GMFbVLsf0NOI=
|
||||
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
@ -244,6 +243,8 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx
|
||||
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg=
|
||||
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
||||
github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
|
||||
github.com/mattn/go-shellwords v1.0.11 h1:vCoR9VPpsk/TZFW2JwK5I9S0xdrtUq2bph6/YjEPnaw=
|
||||
github.com/mattn/go-shellwords v1.0.11/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
|
||||
@ -346,6 +347,9 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT
|
||||
github.com/prometheus/procfs v0.0.3 h1:CTwfnzjQ+8dS6MhHHu4YswVAD99sL2wjPqP+VkURmKE=
|
||||
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
|
||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/russross/blackfriday v2.0.0+incompatible h1:cBXrhZNUf9C+La9/YpS+UHpUT8YD6Td9ZMSU9APFcsk=
|
||||
@ -404,6 +408,8 @@ github.com/vbatts/tar-split v0.11.1 h1:0Odu65rhcZ3JZaPHxl7tCI3V/C/Q9Zf82UFravl02
|
||||
github.com/vbatts/tar-split v0.11.1/go.mod h1:LEuURwDEiWjRjwu46yU3KVGuUdVv/dcnpcEPSzR8z6g=
|
||||
github.com/vbauerster/mpb/v5 v5.4.0 h1:n8JPunifvQvh6P1D1HAl2Ur9YcmKT1tpoUuiea5mlmg=
|
||||
github.com/vbauerster/mpb/v5 v5.4.0/go.mod h1:fi4wVo7BVQ22QcvFObm+VwliQXlV1eBT8JDaKXR4JGI=
|
||||
github.com/vbauerster/mpb/v6 v6.0.2 h1:DWFnBOcgHi9GUNduC1MbQ936Z7B77wvOnZexP9Hjzcw=
|
||||
github.com/vbauerster/mpb/v6 v6.0.2/go.mod h1:JDNVbdx4oAMMxZNXodDH2DeDY5xBJC8bDGHNFZwRqQM=
|
||||
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
|
||||
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
|
||||
github.com/willf/bitset v1.1.11 h1:N7Z7E9UvjW+sGsEl7k/SJrvY2reP1A07MrGuCjIOjRE=
|
||||
@ -539,6 +545,8 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201218084310-7d0127a74742 h1:+CBz4km/0KPU3RGTwARGh/noP3bEwtHcq+0YcBQM2JQ=
|
||||
golang.org/x/sys v0.0.0-20201218084310-7d0127a74742/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 h1:nVuTkr9L6Bq62qpUqKo/RnZCFfzDBL0bYo6w9OJUqZY=
|
||||
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
|
138
vendor/github.com/containers/image/v5/copy/copy.go
generated
vendored
138
vendor/github.com/containers/image/v5/copy/copy.go
generated
vendored
@ -28,8 +28,8 @@ import (
|
||||
imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/vbauerster/mpb/v5"
|
||||
"github.com/vbauerster/mpb/v5/decor"
|
||||
"github.com/vbauerster/mpb/v6"
|
||||
"github.com/vbauerster/mpb/v6/decor"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
"golang.org/x/sync/semaphore"
|
||||
)
|
||||
@ -194,6 +194,10 @@ type Options struct {
|
||||
OciDecryptConfig *encconfig.DecryptConfig
|
||||
// MaxParallelDownloads indicates the maximum layers to pull at the same time. A reasonable default is used if this is left as 0.
|
||||
MaxParallelDownloads uint
|
||||
// When OptimizeDestinationImageAlreadyExists is set, optimize the copy assuming that the destination image already
|
||||
// exists (and is equivalent). Making the eventual (no-op) copy more performant for this case. Enabling the option
|
||||
// is slightly pessimistic if the destination image doesn't exist, or is not equivalent.
|
||||
OptimizeDestinationImageAlreadyExists bool
|
||||
}
|
||||
|
||||
// validateImageListSelection returns an error if the passed-in value is not one that we recognize as a valid ImageListSelection value
|
||||
@ -361,6 +365,45 @@ func supportsMultipleImages(dest types.ImageDestination) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// compareImageDestinationManifestEqual compares the `src` and `dest` image manifests (reading the manifest from the
|
||||
// (possibly remote) destination). Returning true and the destination's manifest, type and digest if they compare equal.
|
||||
func compareImageDestinationManifestEqual(ctx context.Context, options *Options, src types.Image, targetInstance *digest.Digest, dest types.ImageDestination) (bool, []byte, string, digest.Digest, error) {
|
||||
srcManifest, _, err := src.Manifest(ctx)
|
||||
if err != nil {
|
||||
return false, nil, "", "", errors.Wrapf(err, "Error reading manifest from image")
|
||||
}
|
||||
|
||||
srcManifestDigest, err := manifest.Digest(srcManifest)
|
||||
if err != nil {
|
||||
return false, nil, "", "", errors.Wrapf(err, "Error calculating manifest digest")
|
||||
}
|
||||
|
||||
destImageSource, err := dest.Reference().NewImageSource(ctx, options.DestinationCtx)
|
||||
if err != nil {
|
||||
logrus.Debugf("Unable to create destination image %s source: %v", dest.Reference(), err)
|
||||
return false, nil, "", "", nil
|
||||
}
|
||||
|
||||
destManifest, destManifestType, err := destImageSource.GetManifest(ctx, targetInstance)
|
||||
if err != nil {
|
||||
logrus.Debugf("Unable to get destination image %s/%s manifest: %v", destImageSource, targetInstance, err)
|
||||
return false, nil, "", "", nil
|
||||
}
|
||||
|
||||
destManifestDigest, err := manifest.Digest(destManifest)
|
||||
if err != nil {
|
||||
return false, nil, "", "", errors.Wrapf(err, "Error calculating manifest digest")
|
||||
}
|
||||
|
||||
logrus.Debugf("Comparing source and destination manifest digests: %v vs. %v", srcManifestDigest, destManifestDigest)
|
||||
if srcManifestDigest != destManifestDigest {
|
||||
return false, nil, "", "", nil
|
||||
}
|
||||
|
||||
// Destination and source manifests, types and digests should all be equivalent
|
||||
return true, destManifest, destManifestType, destManifestDigest, nil
|
||||
}
|
||||
|
||||
// copyMultipleImages copies some or all of an image list's instances, using
|
||||
// policyContext to validate source image admissibility.
|
||||
func (c *copier) copyMultipleImages(ctx context.Context, policyContext *signature.PolicyContext, options *Options, unparsedToplevel *image.UnparsedImage) (copiedManifest []byte, copiedManifestType string, retErr error) {
|
||||
@ -646,6 +689,26 @@ func (c *copier) copyOneImage(ctx context.Context, policyContext *signature.Poli
|
||||
// If encrypted and decryption keys provided, we should try to decrypt
|
||||
ic.diffIDsAreNeeded = ic.diffIDsAreNeeded || (isEncrypted(src) && ic.c.ociDecryptConfig != nil) || ic.c.ociEncryptConfig != nil
|
||||
|
||||
// If enabled, fetch and compare the destination's manifest. And as an optimization skip updating the destination iff equal
|
||||
if options.OptimizeDestinationImageAlreadyExists {
|
||||
shouldUpdateSigs := len(sigs) > 0 || options.SignBy != "" // TODO: Consider allowing signatures updates only and skipping the image's layers/manifest copy if possible
|
||||
noPendingManifestUpdates := ic.noPendingManifestUpdates()
|
||||
|
||||
logrus.Debugf("Checking if we can skip copying: has signatures=%t, OCI encryption=%t, no manifest updates=%t", shouldUpdateSigs, destRequiresOciEncryption, noPendingManifestUpdates)
|
||||
if !shouldUpdateSigs && !destRequiresOciEncryption && noPendingManifestUpdates {
|
||||
isSrcDestManifestEqual, retManifest, retManifestType, retManifestDigest, err := compareImageDestinationManifestEqual(ctx, options, src, targetInstance, c.dest)
|
||||
if err != nil {
|
||||
logrus.Warnf("Failed to compare destination image manifest: %v", err)
|
||||
return nil, "", "", err
|
||||
}
|
||||
|
||||
if isSrcDestManifestEqual {
|
||||
c.Printf("Skipping: image already present at destination\n")
|
||||
return retManifest, retManifestType, retManifestDigest, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err := ic.copyLayers(ctx); err != nil {
|
||||
return nil, "", "", err
|
||||
}
|
||||
@ -702,6 +765,9 @@ func (c *copier) copyOneImage(ctx context.Context, policyContext *signature.Poli
|
||||
return nil, "", "", fmt.Errorf("Uploading manifest failed, attempted the following formats: %s", strings.Join(errs, ", "))
|
||||
}
|
||||
}
|
||||
if targetInstance != nil {
|
||||
targetInstance = &retManifestDigest
|
||||
}
|
||||
|
||||
if options.SignBy != "" {
|
||||
newSig, err := c.createSignature(manifestBytes, options.SignBy)
|
||||
@ -781,6 +847,10 @@ func (ic *imageCopier) updateEmbeddedDockerReference() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ic *imageCopier) noPendingManifestUpdates() bool {
|
||||
return reflect.DeepEqual(*ic.manifestUpdates, types.ManifestUpdateOptions{InformationOnly: ic.manifestUpdates.InformationOnly})
|
||||
}
|
||||
|
||||
// isTTY returns true if the io.Writer is a file and a tty.
|
||||
func isTTY(w io.Writer) bool {
|
||||
if f, ok := w.(*os.File); ok {
|
||||
@ -901,6 +971,8 @@ func (ic *imageCopier) copyLayers(ctx context.Context) error {
|
||||
diffIDs[i] = cld.diffID
|
||||
}
|
||||
|
||||
// WARNING: If you are adding new reasons to change ic.manifestUpdates, also update the
|
||||
// OptimizeDestinationImageAlreadyExists short-circuit conditions
|
||||
ic.manifestUpdates.InformationOnly.LayerInfos = destInfos
|
||||
if ic.diffIDsAreNeeded {
|
||||
ic.manifestUpdates.InformationOnly.LayerDiffIDs = diffIDs
|
||||
@ -929,7 +1001,7 @@ func layerDigestsDiffer(a, b []types.BlobInfo) bool {
|
||||
// and its digest.
|
||||
func (ic *imageCopier) copyUpdatedConfigAndManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, digest.Digest, error) {
|
||||
pendingImage := ic.src
|
||||
if !reflect.DeepEqual(*ic.manifestUpdates, types.ManifestUpdateOptions{InformationOnly: ic.manifestUpdates.InformationOnly}) {
|
||||
if !ic.noPendingManifestUpdates() {
|
||||
if !ic.canModifyManifest {
|
||||
return nil, "", errors.Errorf("Internal error: copy needs an updated manifest but that was known to be forbidden")
|
||||
}
|
||||
@ -1012,10 +1084,9 @@ func (c *copier) createProgressBar(pool *mpb.Progress, info types.BlobInfo, kind
|
||||
),
|
||||
)
|
||||
} else {
|
||||
bar = pool.AddSpinner(info.Size,
|
||||
mpb.SpinnerOnLeft,
|
||||
bar = pool.Add(0,
|
||||
mpb.NewSpinnerFiller([]string{".", "..", "...", "....", ""}, mpb.SpinnerOnLeft),
|
||||
mpb.BarFillerClearOnComplete(),
|
||||
mpb.SpinnerStyle([]string{".", "..", "...", "....", ""}),
|
||||
mpb.PrependDecorators(
|
||||
decor.OnComplete(decor.Name(prefix), onComplete),
|
||||
),
|
||||
@ -1067,6 +1138,26 @@ type diffIDResult struct {
|
||||
// copyLayer copies a layer with srcInfo (with known Digest and Annotations and possibly known Size) in src to dest, perhaps (de/re/)compressing it,
|
||||
// and returns a complete blobInfo of the copied layer, and a value for LayerDiffIDs if diffIDIsNeeded
|
||||
func (ic *imageCopier) copyLayer(ctx context.Context, srcInfo types.BlobInfo, toEncrypt bool, pool *mpb.Progress) (types.BlobInfo, digest.Digest, error) {
|
||||
// If the srcInfo doesn't contain compression information, try to compute it from the
|
||||
// MediaType, which was either read from a manifest by way of LayerInfos() or constructed
|
||||
// by LayerInfosForCopy(), if it was supplied at all. If we succeed in copying the blob,
|
||||
// the BlobInfo we return will be passed to UpdatedImage() and then to UpdateLayerInfos(),
|
||||
// which uses the compression information to compute the updated MediaType values.
|
||||
// (Sadly UpdatedImage() is documented to not update MediaTypes from
|
||||
// ManifestUpdateOptions.LayerInfos[].MediaType, so we are doing it indirectly.)
|
||||
//
|
||||
// This MIME type → compression mapping belongs in manifest-specific code in our manifest
|
||||
// package (but we should preferably replace/change UpdatedImage instead of productizing
|
||||
// this workaround).
|
||||
if srcInfo.CompressionAlgorithm == nil {
|
||||
switch srcInfo.MediaType {
|
||||
case manifest.DockerV2Schema2LayerMediaType, imgspecv1.MediaTypeImageLayerGzip:
|
||||
srcInfo.CompressionAlgorithm = &compression.Gzip
|
||||
case imgspecv1.MediaTypeImageLayerZstd:
|
||||
srcInfo.CompressionAlgorithm = &compression.Zstd
|
||||
}
|
||||
}
|
||||
|
||||
cachedDiffID := ic.c.blobInfoCache.UncompressedDigest(srcInfo.Digest) // May be ""
|
||||
// Diffs are needed if we are encrypting an image or trying to decrypt an image
|
||||
diffIDIsNeeded := ic.diffIDsAreNeeded && cachedDiffID == "" || toEncrypt || (isOciEncrypted(srcInfo.MediaType) && ic.c.ociDecryptConfig != nil)
|
||||
@ -1095,6 +1186,19 @@ func (ic *imageCopier) copyLayer(ctx context.Context, srcInfo types.BlobInfo, to
|
||||
Artifact: srcInfo,
|
||||
}
|
||||
}
|
||||
|
||||
// If the reused blob has the same digest as the one we asked for, but
|
||||
// the transport didn't/couldn't supply compression info, fill it in based
|
||||
// on what we know from the srcInfos we were given.
|
||||
// If the srcInfos came from LayerInfosForCopy(), then UpdatedImage() will
|
||||
// call UpdateLayerInfos(), which uses this information to compute the
|
||||
// MediaType value for the updated layer infos, and it the transport
|
||||
// didn't pass the information along from its input to its output, then
|
||||
// it can derive the MediaType incorrectly.
|
||||
if blobInfo.Digest == srcInfo.Digest && blobInfo.CompressionAlgorithm == nil {
|
||||
blobInfo.CompressionOperation = srcInfo.CompressionOperation
|
||||
blobInfo.CompressionAlgorithm = srcInfo.CompressionAlgorithm
|
||||
}
|
||||
return blobInfo, cachedDiffID, nil
|
||||
}
|
||||
}
|
||||
@ -1234,8 +1338,9 @@ func (c *copier) copyBlobFromStream(ctx context.Context, srcStream io.Reader, sr
|
||||
if err != nil {
|
||||
return types.BlobInfo{}, errors.Wrapf(err, "Error preparing to verify blob %s", srcInfo.Digest)
|
||||
}
|
||||
|
||||
var destStream io.Reader = digestingReader
|
||||
|
||||
// === Decrypt the stream, if required.
|
||||
var decrypted bool
|
||||
if isOciEncrypted(srcInfo.MediaType) && c.ociDecryptConfig != nil {
|
||||
newDesc := imgspecv1.Descriptor{
|
||||
@ -1265,12 +1370,13 @@ func (c *copier) copyBlobFromStream(ctx context.Context, srcStream io.Reader, sr
|
||||
return types.BlobInfo{}, errors.Wrapf(err, "Error reading blob %s", srcInfo.Digest)
|
||||
}
|
||||
isCompressed := decompressor != nil
|
||||
destStream = bar.ProxyReader(destStream)
|
||||
|
||||
if expectedCompressionFormat, known := expectedCompressionFormats[srcInfo.MediaType]; known && isCompressed && compressionFormat.Name() != expectedCompressionFormat.Name() {
|
||||
logrus.Debugf("blob %s with type %s should be compressed with %s, but compressor appears to be %s", srcInfo.Digest.String(), srcInfo.MediaType, expectedCompressionFormat.Name(), compressionFormat.Name())
|
||||
}
|
||||
|
||||
// === Update progress bars
|
||||
destStream = bar.ProxyReader(destStream)
|
||||
|
||||
// === Send a copy of the original, uncompressed, stream, to a separate path if necessary.
|
||||
var originalLayerReader io.Reader // DO NOT USE this other than to drain the input if no other consumer in the pipeline has done so.
|
||||
if getOriginalLayerCopyWriter != nil {
|
||||
@ -1279,6 +1385,8 @@ func (c *copier) copyBlobFromStream(ctx context.Context, srcStream io.Reader, sr
|
||||
}
|
||||
|
||||
// === Deal with layer compression/decompression if necessary
|
||||
// WARNING: If you are adding new reasons to change the blob, update also the OptimizeDestinationImageAlreadyExists
|
||||
// short-circuit conditions
|
||||
var inputInfo types.BlobInfo
|
||||
var compressionOperation types.LayerCompression
|
||||
uploadCompressionFormat := &c.compressionFormat
|
||||
@ -1349,10 +1457,18 @@ func (c *copier) copyBlobFromStream(ctx context.Context, srcStream io.Reader, sr
|
||||
compressionOperation = types.PreserveOriginal
|
||||
inputInfo = srcInfo
|
||||
uploadCompressorName = srcCompressorName
|
||||
uploadCompressionFormat = nil
|
||||
// Remember if the original blob was compressed, and if so how, so that if
|
||||
// LayerInfosForCopy() returned something that differs from what was in the
|
||||
// source's manifest, and UpdatedImage() needs to call UpdateLayerInfos(),
|
||||
// it will be able to correctly derive the MediaType for the copied blob.
|
||||
if isCompressed {
|
||||
uploadCompressionFormat = &compressionFormat
|
||||
} else {
|
||||
uploadCompressionFormat = nil
|
||||
}
|
||||
}
|
||||
|
||||
// Perform image encryption for valid mediatypes if ociEncryptConfig provided
|
||||
// === Encrypt the stream for valid mediatypes if ociEncryptConfig provided
|
||||
var (
|
||||
encrypted bool
|
||||
finalizer ocicrypt.EncryptLayerFinalizer
|
||||
|
6
vendor/github.com/containers/image/v5/version/version.go
generated
vendored
6
vendor/github.com/containers/image/v5/version/version.go
generated
vendored
@ -6,12 +6,12 @@ const (
|
||||
// VersionMajor is for an API incompatible changes
|
||||
VersionMajor = 5
|
||||
// VersionMinor is for functionality in a backwards-compatible manner
|
||||
VersionMinor = 10
|
||||
VersionMinor = 11
|
||||
// VersionPatch is for backwards-compatible bug fixes
|
||||
VersionPatch = 3
|
||||
VersionPatch = 0
|
||||
|
||||
// VersionDev indicates development branch. Releases will be empty string.
|
||||
VersionDev = ""
|
||||
VersionDev = "-dev"
|
||||
)
|
||||
|
||||
// Version is the specification version that the package types support.
|
||||
|
2
vendor/github.com/mattn/go-runewidth/go.mod
generated
vendored
2
vendor/github.com/mattn/go-runewidth/go.mod
generated
vendored
@ -1,3 +1,5 @@
|
||||
module github.com/mattn/go-runewidth
|
||||
|
||||
go 1.9
|
||||
|
||||
require github.com/rivo/uniseg v0.1.0
|
||||
|
2
vendor/github.com/mattn/go-runewidth/go.sum
generated
vendored
Normal file
2
vendor/github.com/mattn/go-runewidth/go.sum
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY=
|
||||
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
80
vendor/github.com/mattn/go-runewidth/runewidth.go
generated
vendored
80
vendor/github.com/mattn/go-runewidth/runewidth.go
generated
vendored
@ -2,6 +2,8 @@ package runewidth
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/rivo/uniseg"
|
||||
)
|
||||
|
||||
//go:generate go run script/generate.go
|
||||
@ -10,9 +12,6 @@ var (
|
||||
// EastAsianWidth will be set true if the current locale is CJK
|
||||
EastAsianWidth bool
|
||||
|
||||
// ZeroWidthJoiner is flag to set to use UTR#51 ZWJ
|
||||
ZeroWidthJoiner bool
|
||||
|
||||
// DefaultCondition is a condition in current locale
|
||||
DefaultCondition = &Condition{}
|
||||
)
|
||||
@ -30,7 +29,6 @@ func handleEnv() {
|
||||
}
|
||||
// update DefaultCondition
|
||||
DefaultCondition.EastAsianWidth = EastAsianWidth
|
||||
DefaultCondition.ZeroWidthJoiner = ZeroWidthJoiner
|
||||
}
|
||||
|
||||
type interval struct {
|
||||
@ -85,15 +83,13 @@ var nonprint = table{
|
||||
|
||||
// Condition have flag EastAsianWidth whether the current locale is CJK or not.
|
||||
type Condition struct {
|
||||
EastAsianWidth bool
|
||||
ZeroWidthJoiner bool
|
||||
EastAsianWidth bool
|
||||
}
|
||||
|
||||
// NewCondition return new instance of Condition which is current locale.
|
||||
func NewCondition() *Condition {
|
||||
return &Condition{
|
||||
EastAsianWidth: EastAsianWidth,
|
||||
ZeroWidthJoiner: ZeroWidthJoiner,
|
||||
EastAsianWidth: EastAsianWidth,
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,38 +106,20 @@ func (c *Condition) RuneWidth(r rune) int {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Condition) stringWidth(s string) (width int) {
|
||||
for _, r := range []rune(s) {
|
||||
width += c.RuneWidth(r)
|
||||
}
|
||||
return width
|
||||
}
|
||||
|
||||
func (c *Condition) stringWidthZeroJoiner(s string) (width int) {
|
||||
r1, r2 := rune(0), rune(0)
|
||||
for _, r := range []rune(s) {
|
||||
if r == 0xFE0E || r == 0xFE0F {
|
||||
continue
|
||||
}
|
||||
w := c.RuneWidth(r)
|
||||
if r2 == 0x200D && inTables(r, emoji) && inTables(r1, emoji) {
|
||||
if width < w {
|
||||
width = w
|
||||
}
|
||||
} else {
|
||||
width += w
|
||||
}
|
||||
r1, r2 = r2, r
|
||||
}
|
||||
return width
|
||||
}
|
||||
|
||||
// StringWidth return width as you can see
|
||||
func (c *Condition) StringWidth(s string) (width int) {
|
||||
if c.ZeroWidthJoiner {
|
||||
return c.stringWidthZeroJoiner(s)
|
||||
g := uniseg.NewGraphemes(s)
|
||||
for g.Next() {
|
||||
var chWidth int
|
||||
for _, r := range g.Runes() {
|
||||
chWidth = c.RuneWidth(r)
|
||||
if chWidth > 0 {
|
||||
break // Our best guess at this point is to use the width of the first non-zero-width rune.
|
||||
}
|
||||
}
|
||||
width += chWidth
|
||||
}
|
||||
return c.stringWidth(s)
|
||||
return
|
||||
}
|
||||
|
||||
// Truncate return string truncated with w cells
|
||||
@ -149,19 +127,25 @@ func (c *Condition) Truncate(s string, w int, tail string) string {
|
||||
if c.StringWidth(s) <= w {
|
||||
return s
|
||||
}
|
||||
r := []rune(s)
|
||||
tw := c.StringWidth(tail)
|
||||
w -= tw
|
||||
width := 0
|
||||
i := 0
|
||||
for ; i < len(r); i++ {
|
||||
cw := c.RuneWidth(r[i])
|
||||
if width+cw > w {
|
||||
w -= c.StringWidth(tail)
|
||||
var width int
|
||||
pos := len(s)
|
||||
g := uniseg.NewGraphemes(s)
|
||||
for g.Next() {
|
||||
var chWidth int
|
||||
for _, r := range g.Runes() {
|
||||
chWidth = c.RuneWidth(r)
|
||||
if chWidth > 0 {
|
||||
break // See StringWidth() for details.
|
||||
}
|
||||
}
|
||||
if width+chWidth > w {
|
||||
pos, _ = g.Positions()
|
||||
break
|
||||
}
|
||||
width += cw
|
||||
width += chWidth
|
||||
}
|
||||
return string(r[0:i]) + tail
|
||||
return s[:pos] + tail
|
||||
}
|
||||
|
||||
// Wrap return string wrapped with w cells
|
||||
@ -169,7 +153,7 @@ func (c *Condition) Wrap(s string, w int) string {
|
||||
width := 0
|
||||
out := ""
|
||||
for _, r := range []rune(s) {
|
||||
cw := RuneWidth(r)
|
||||
cw := c.RuneWidth(r)
|
||||
if r == '\n' {
|
||||
out += string(r)
|
||||
width = 0
|
||||
|
21
vendor/github.com/rivo/uniseg/LICENSE.txt
generated
vendored
Normal file
21
vendor/github.com/rivo/uniseg/LICENSE.txt
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Oliver Kuederle
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
62
vendor/github.com/rivo/uniseg/README.md
generated
vendored
Normal file
62
vendor/github.com/rivo/uniseg/README.md
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
# Unicode Text Segmentation for Go
|
||||
|
||||
[](https://godoc.org/github.com/rivo/uniseg)
|
||||
[](https://goreportcard.com/report/github.com/rivo/uniseg)
|
||||
|
||||
This Go package implements Unicode Text Segmentation according to [Unicode Standard Annex #29](http://unicode.org/reports/tr29/) (Unicode version 12.0.0).
|
||||
|
||||
At this point, only the determination of grapheme cluster boundaries is implemented.
|
||||
|
||||
## Background
|
||||
|
||||
In Go, [strings are read-only slices of bytes](https://blog.golang.org/strings). They can be turned into Unicode code points using the `for` loop or by casting: `[]rune(str)`. However, multiple code points may be combined into one user-perceived character or what the Unicode specification calls "grapheme cluster". Here are some examples:
|
||||
|
||||
|String|Bytes (UTF-8)|Code points (runes)|Grapheme clusters|
|
||||
|-|-|-|-|
|
||||
|Käse|6 bytes: `4b 61 cc 88 73 65`|5 code points: `4b 61 308 73 65`|4 clusters: `[4b],[61 308],[73],[65]`|
|
||||
|🏳️🌈|14 bytes: `f0 9f 8f b3 ef b8 8f e2 80 8d f0 9f 8c 88`|4 code points: `1f3f3 fe0f 200d 1f308`|1 cluster: `[1f3f3 fe0f 200d 1f308]`|
|
||||
|🇩🇪|8 bytes: `f0 9f 87 a9 f0 9f 87 aa`|2 code points: `1f1e9 1f1ea`|1 cluster: `[1f1e9 1f1ea]`|
|
||||
|
||||
This package provides a tool to iterate over these grapheme clusters. This may be used to determine the number of user-perceived characters, to split strings in their intended places, or to extract individual characters which form a unit.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
go get github.com/rivo/uniseg
|
||||
```
|
||||
|
||||
## Basic Example
|
||||
|
||||
```go
|
||||
package uniseg
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/rivo/uniseg"
|
||||
)
|
||||
|
||||
func main() {
|
||||
gr := uniseg.NewGraphemes("👍🏼!")
|
||||
for gr.Next() {
|
||||
fmt.Printf("%x ", gr.Runes())
|
||||
}
|
||||
// Output: [1f44d 1f3fc] [21]
|
||||
}
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
Refer to https://godoc.org/github.com/rivo/uniseg for the package's documentation.
|
||||
|
||||
## Dependencies
|
||||
|
||||
This package does not depend on any packages outside the standard library.
|
||||
|
||||
## Your Feedback
|
||||
|
||||
Add your issue here on GitHub. Feel free to get in touch if you have any questions.
|
||||
|
||||
## Version
|
||||
|
||||
Version tags will be introduced once Golang modules are official. Consider this version 0.1.
|
8
vendor/github.com/rivo/uniseg/doc.go
generated
vendored
Normal file
8
vendor/github.com/rivo/uniseg/doc.go
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/*
|
||||
Package uniseg implements Unicode Text Segmentation according to Unicode
|
||||
Standard Annex #29 (http://unicode.org/reports/tr29/).
|
||||
|
||||
At this point, only the determination of grapheme cluster boundaries is
|
||||
implemented.
|
||||
*/
|
||||
package uniseg
|
3
vendor/github.com/rivo/uniseg/go.mod
generated
vendored
Normal file
3
vendor/github.com/rivo/uniseg/go.mod
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
module github.com/rivo/uniseg
|
||||
|
||||
go 1.12
|
268
vendor/github.com/rivo/uniseg/grapheme.go
generated
vendored
Normal file
268
vendor/github.com/rivo/uniseg/grapheme.go
generated
vendored
Normal file
@ -0,0 +1,268 @@
|
||||
package uniseg
|
||||
|
||||
import "unicode/utf8"
|
||||
|
||||
// The states of the grapheme cluster parser.
|
||||
const (
|
||||
grAny = iota
|
||||
grCR
|
||||
grControlLF
|
||||
grL
|
||||
grLVV
|
||||
grLVTT
|
||||
grPrepend
|
||||
grExtendedPictographic
|
||||
grExtendedPictographicZWJ
|
||||
grRIOdd
|
||||
grRIEven
|
||||
)
|
||||
|
||||
// The grapheme cluster parser's breaking instructions.
|
||||
const (
|
||||
grNoBoundary = iota
|
||||
grBoundary
|
||||
)
|
||||
|
||||
// The grapheme cluster parser's state transitions. Maps (state, property) to
|
||||
// (new state, breaking instruction, rule number). The breaking instruction
|
||||
// always refers to the boundary between the last and next code point.
|
||||
//
|
||||
// This map is queried as follows:
|
||||
//
|
||||
// 1. Find specific state + specific property. Stop if found.
|
||||
// 2. Find specific state + any property.
|
||||
// 3. Find any state + specific property.
|
||||
// 4. If only (2) or (3) (but not both) was found, stop.
|
||||
// 5. If both (2) and (3) were found, use state and breaking instruction from
|
||||
// the transition with the lower rule number, prefer (3) if rule numbers
|
||||
// are equal. Stop.
|
||||
// 6. Assume grAny and grBoundary.
|
||||
var grTransitions = map[[2]int][3]int{
|
||||
// GB5
|
||||
{grAny, prCR}: {grCR, grBoundary, 50},
|
||||
{grAny, prLF}: {grControlLF, grBoundary, 50},
|
||||
{grAny, prControl}: {grControlLF, grBoundary, 50},
|
||||
|
||||
// GB4
|
||||
{grCR, prAny}: {grAny, grBoundary, 40},
|
||||
{grControlLF, prAny}: {grAny, grBoundary, 40},
|
||||
|
||||
// GB3.
|
||||
{grCR, prLF}: {grAny, grNoBoundary, 30},
|
||||
|
||||
// GB6.
|
||||
{grAny, prL}: {grL, grBoundary, 9990},
|
||||
{grL, prL}: {grL, grNoBoundary, 60},
|
||||
{grL, prV}: {grLVV, grNoBoundary, 60},
|
||||
{grL, prLV}: {grLVV, grNoBoundary, 60},
|
||||
{grL, prLVT}: {grLVTT, grNoBoundary, 60},
|
||||
|
||||
// GB7.
|
||||
{grAny, prLV}: {grLVV, grBoundary, 9990},
|
||||
{grAny, prV}: {grLVV, grBoundary, 9990},
|
||||
{grLVV, prV}: {grLVV, grNoBoundary, 70},
|
||||
{grLVV, prT}: {grLVTT, grNoBoundary, 70},
|
||||
|
||||
// GB8.
|
||||
{grAny, prLVT}: {grLVTT, grBoundary, 9990},
|
||||
{grAny, prT}: {grLVTT, grBoundary, 9990},
|
||||
{grLVTT, prT}: {grLVTT, grNoBoundary, 80},
|
||||
|
||||
// GB9.
|
||||
{grAny, prExtend}: {grAny, grNoBoundary, 90},
|
||||
{grAny, prZWJ}: {grAny, grNoBoundary, 90},
|
||||
|
||||
// GB9a.
|
||||
{grAny, prSpacingMark}: {grAny, grNoBoundary, 91},
|
||||
|
||||
// GB9b.
|
||||
{grAny, prPreprend}: {grPrepend, grBoundary, 9990},
|
||||
{grPrepend, prAny}: {grAny, grNoBoundary, 92},
|
||||
|
||||
// GB11.
|
||||
{grAny, prExtendedPictographic}: {grExtendedPictographic, grBoundary, 9990},
|
||||
{grExtendedPictographic, prExtend}: {grExtendedPictographic, grNoBoundary, 110},
|
||||
{grExtendedPictographic, prZWJ}: {grExtendedPictographicZWJ, grNoBoundary, 110},
|
||||
{grExtendedPictographicZWJ, prExtendedPictographic}: {grExtendedPictographic, grNoBoundary, 110},
|
||||
|
||||
// GB12 / GB13.
|
||||
{grAny, prRegionalIndicator}: {grRIOdd, grBoundary, 9990},
|
||||
{grRIOdd, prRegionalIndicator}: {grRIEven, grNoBoundary, 120},
|
||||
{grRIEven, prRegionalIndicator}: {grRIOdd, grBoundary, 120},
|
||||
}
|
||||
|
||||
// Graphemes implements an iterator over Unicode extended grapheme clusters,
|
||||
// specified in the Unicode Standard Annex #29. Grapheme clusters correspond to
|
||||
// "user-perceived characters". These characters often consist of multiple
|
||||
// code points (e.g. the "woman kissing woman" emoji consists of 8 code points:
|
||||
// woman + ZWJ + heavy black heart (2 code points) + ZWJ + kiss mark + ZWJ +
|
||||
// woman) and the rules described in Annex #29 must be applied to group those
|
||||
// code points into clusters perceived by the user as one character.
|
||||
type Graphemes struct {
|
||||
// The code points over which this class iterates.
|
||||
codePoints []rune
|
||||
|
||||
// The (byte-based) indices of the code points into the original string plus
|
||||
// len(original string). Thus, len(indices) = len(codePoints) + 1.
|
||||
indices []int
|
||||
|
||||
// The current grapheme cluster to be returned. These are indices into
|
||||
// codePoints/indices. If start == end, we either haven't started iterating
|
||||
// yet (0) or the iteration has already completed (1).
|
||||
start, end int
|
||||
|
||||
// The index of the next code point to be parsed.
|
||||
pos int
|
||||
|
||||
// The current state of the code point parser.
|
||||
state int
|
||||
}
|
||||
|
||||
// NewGraphemes returns a new grapheme cluster iterator.
|
||||
func NewGraphemes(s string) *Graphemes {
|
||||
l := utf8.RuneCountInString(s)
|
||||
codePoints := make([]rune, l)
|
||||
indices := make([]int, l+1)
|
||||
i := 0
|
||||
for pos, r := range s {
|
||||
codePoints[i] = r
|
||||
indices[i] = pos
|
||||
i++
|
||||
}
|
||||
indices[l] = len(s)
|
||||
g := &Graphemes{
|
||||
codePoints: codePoints,
|
||||
indices: indices,
|
||||
}
|
||||
g.Next() // Parse ahead.
|
||||
return g
|
||||
}
|
||||
|
||||
// Next advances the iterator by one grapheme cluster and returns false if no
|
||||
// clusters are left. This function must be called before the first cluster is
|
||||
// accessed.
|
||||
func (g *Graphemes) Next() bool {
|
||||
g.start = g.end
|
||||
|
||||
// The state transition gives us a boundary instruction BEFORE the next code
|
||||
// point so we always need to stay ahead by one code point.
|
||||
|
||||
// Parse the next code point.
|
||||
for g.pos <= len(g.codePoints) {
|
||||
// GB2.
|
||||
if g.pos == len(g.codePoints) {
|
||||
g.end = g.pos
|
||||
g.pos++
|
||||
break
|
||||
}
|
||||
|
||||
// Determine the property of the next character.
|
||||
nextProperty := property(g.codePoints[g.pos])
|
||||
g.pos++
|
||||
|
||||
// Find the applicable transition.
|
||||
var boundary bool
|
||||
transition, ok := grTransitions[[2]int{g.state, nextProperty}]
|
||||
if ok {
|
||||
// We have a specific transition. We'll use it.
|
||||
g.state = transition[0]
|
||||
boundary = transition[1] == grBoundary
|
||||
} else {
|
||||
// No specific transition found. Try the less specific ones.
|
||||
transAnyProp, okAnyProp := grTransitions[[2]int{g.state, prAny}]
|
||||
transAnyState, okAnyState := grTransitions[[2]int{grAny, nextProperty}]
|
||||
if okAnyProp && okAnyState {
|
||||
// Both apply. We'll use a mix (see comments for grTransitions).
|
||||
g.state = transAnyState[0]
|
||||
boundary = transAnyState[1] == grBoundary
|
||||
if transAnyProp[2] < transAnyState[2] {
|
||||
g.state = transAnyProp[0]
|
||||
boundary = transAnyProp[1] == grBoundary
|
||||
}
|
||||
} else if okAnyProp {
|
||||
// We only have a specific state.
|
||||
g.state = transAnyProp[0]
|
||||
boundary = transAnyProp[1] == grBoundary
|
||||
// This branch will probably never be reached because okAnyState will
|
||||
// always be true given the current transition map. But we keep it here
|
||||
// for future modifications to the transition map where this may not be
|
||||
// true anymore.
|
||||
} else if okAnyState {
|
||||
// We only have a specific property.
|
||||
g.state = transAnyState[0]
|
||||
boundary = transAnyState[1] == grBoundary
|
||||
} else {
|
||||
// No known transition. GB999: Any x Any.
|
||||
g.state = grAny
|
||||
boundary = true
|
||||
}
|
||||
}
|
||||
|
||||
// If we found a cluster boundary, let's stop here. The current cluster will
|
||||
// be the one that just ended.
|
||||
if g.pos-1 == 0 /* GB1 */ || boundary {
|
||||
g.end = g.pos - 1
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return g.start != g.end
|
||||
}
|
||||
|
||||
// Runes returns a slice of runes (code points) which corresponds to the current
|
||||
// grapheme cluster. If the iterator is already past the end or Next() has not
|
||||
// yet been called, nil is returned.
|
||||
func (g *Graphemes) Runes() []rune {
|
||||
if g.start == g.end {
|
||||
return nil
|
||||
}
|
||||
return g.codePoints[g.start:g.end]
|
||||
}
|
||||
|
||||
// Str returns a substring of the original string which corresponds to the
|
||||
// current grapheme cluster. If the iterator is already past the end or Next()
|
||||
// has not yet been called, an empty string is returned.
|
||||
func (g *Graphemes) Str() string {
|
||||
if g.start == g.end {
|
||||
return ""
|
||||
}
|
||||
return string(g.codePoints[g.start:g.end])
|
||||
}
|
||||
|
||||
// Bytes returns a byte slice which corresponds to the current grapheme cluster.
|
||||
// If the iterator is already past the end or Next() has not yet been called,
|
||||
// nil is returned.
|
||||
func (g *Graphemes) Bytes() []byte {
|
||||
if g.start == g.end {
|
||||
return nil
|
||||
}
|
||||
return []byte(string(g.codePoints[g.start:g.end]))
|
||||
}
|
||||
|
||||
// Positions returns the interval of the current grapheme cluster as byte
|
||||
// positions into the original string. The first returned value "from" indexes
|
||||
// the first byte and the second returned value "to" indexes the first byte that
|
||||
// is not included anymore, i.e. str[from:to] is the current grapheme cluster of
|
||||
// the original string "str". If Next() has not yet been called, both values are
|
||||
// 0. If the iterator is already past the end, both values are 1.
|
||||
func (g *Graphemes) Positions() (int, int) {
|
||||
return g.indices[g.start], g.indices[g.end]
|
||||
}
|
||||
|
||||
// Reset puts the iterator into its initial state such that the next call to
|
||||
// Next() sets it to the first grapheme cluster again.
|
||||
func (g *Graphemes) Reset() {
|
||||
g.start, g.end, g.pos, g.state = 0, 0, 0, grAny
|
||||
g.Next() // Parse ahead again.
|
||||
}
|
||||
|
||||
// GraphemeClusterCount returns the number of user-perceived characters
|
||||
// (grapheme clusters) for the given string. To calculate this number, it
|
||||
// iterates through the string using the Graphemes iterator.
|
||||
func GraphemeClusterCount(s string) (n int) {
|
||||
g := NewGraphemes(s)
|
||||
for g.Next() {
|
||||
n++
|
||||
}
|
||||
return
|
||||
}
|
1658
vendor/github.com/rivo/uniseg/properties.go
generated
vendored
Normal file
1658
vendor/github.com/rivo/uniseg/properties.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10
vendor/github.com/vbauerster/mpb/v5/go.mod
generated
vendored
10
vendor/github.com/vbauerster/mpb/v5/go.mod
generated
vendored
@ -1,10 +0,0 @@
|
||||
module github.com/vbauerster/mpb/v5
|
||||
|
||||
require (
|
||||
github.com/VividCortex/ewma v1.1.1
|
||||
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
|
||||
github.com/mattn/go-runewidth v0.0.9
|
||||
golang.org/x/sys v0.0.0-20201218084310-7d0127a74742
|
||||
)
|
||||
|
||||
go 1.14
|
8
vendor/github.com/vbauerster/mpb/v5/go.sum
generated
vendored
8
vendor/github.com/vbauerster/mpb/v5/go.sum
generated
vendored
@ -1,8 +0,0 @@
|
||||
github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM=
|
||||
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
|
||||
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=
|
||||
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo=
|
||||
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
golang.org/x/sys v0.0.0-20201218084310-7d0127a74742 h1:+CBz4km/0KPU3RGTwARGh/noP3bEwtHcq+0YcBQM2JQ=
|
||||
golang.org/x/sys v0.0.0-20201218084310-7d0127a74742/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
8
vendor/github.com/vbauerster/mpb/v5/internal/width.go
generated
vendored
8
vendor/github.com/vbauerster/mpb/v5/internal/width.go
generated
vendored
@ -1,8 +0,0 @@
|
||||
package internal
|
||||
|
||||
func WidthForBarFiller(reqWidth, available int) int {
|
||||
if reqWidth <= 0 || reqWidth >= available {
|
||||
return available
|
||||
}
|
||||
return reqWidth
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
# Multi Progress Bar
|
||||
|
||||
[](https://godoc.org/github.com/vbauerster/mpb)
|
||||
[](https://pkg.go.dev/github.com/vbauerster/mpb/v6)
|
||||
[](https://travis-ci.org/vbauerster/mpb)
|
||||
[](https://goreportcard.com/report/github.com/vbauerster/mpb)
|
||||
|
||||
@ -8,16 +8,17 @@
|
||||
|
||||
## Features
|
||||
|
||||
* __Multiple Bars__: Multiple progress bars are supported
|
||||
* __Dynamic Total__: Set total while bar is running
|
||||
* __Dynamic Add/Remove__: Dynamically add or remove bars
|
||||
* __Cancellation__: Cancel whole rendering process
|
||||
* __Predefined Decorators__: Elapsed time, [ewma](https://github.com/VividCortex/ewma) based ETA, Percentage, Bytes counter
|
||||
* __Decorator's width sync__: Synchronized decorator's width among multiple bars
|
||||
- **Multiple Bars**: Multiple progress bars are supported
|
||||
- **Dynamic Total**: Set total while bar is running
|
||||
- **Dynamic Add/Remove**: Dynamically add or remove bars
|
||||
- **Cancellation**: Cancel whole rendering process
|
||||
- **Predefined Decorators**: Elapsed time, [ewma](https://github.com/VividCortex/ewma) based ETA, Percentage, Bytes counter
|
||||
- **Decorator's width sync**: Synchronized decorator's width among multiple bars
|
||||
|
||||
## Usage
|
||||
|
||||
#### [Rendering single bar](_examples/singleBar/main.go)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
@ -25,8 +26,8 @@ import (
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/vbauerster/mpb/v5"
|
||||
"github.com/vbauerster/mpb/v5/decor"
|
||||
"github.com/vbauerster/mpb/v6"
|
||||
"github.com/vbauerster/mpb/v6/decor"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -36,9 +37,9 @@ func main() {
|
||||
total := 100
|
||||
name := "Single Bar:"
|
||||
// adding a single bar, which will inherit container's width
|
||||
bar := p.AddBar(int64(total),
|
||||
// override DefaultBarStyle, which is "[=>-]<+"
|
||||
mpb.BarStyle("╢▌▌░╟"),
|
||||
bar := p.Add(int64(total),
|
||||
// progress bar filler with customized style
|
||||
mpb.NewBarFiller("╢▌▌░╟"),
|
||||
mpb.PrependDecorators(
|
||||
// display our name with one space on the right
|
||||
decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}),
|
||||
@ -61,6 +62,7 @@ func main() {
|
||||
```
|
||||
|
||||
#### [Rendering multiple bars](_examples/multiBars/main.go)
|
||||
|
||||
```go
|
||||
var wg sync.WaitGroup
|
||||
// pass &wg (optional), so p will wait for it eventually
|
46
vendor/github.com/vbauerster/mpb/v5/bar.go → vendor/github.com/vbauerster/mpb/v6/bar.go
generated
vendored
46
vendor/github.com/vbauerster/mpb/v5/bar.go → vendor/github.com/vbauerster/mpb/v6/bar.go
generated
vendored
@ -12,10 +12,10 @@ import (
|
||||
|
||||
"github.com/acarl005/stripansi"
|
||||
"github.com/mattn/go-runewidth"
|
||||
"github.com/vbauerster/mpb/v5/decor"
|
||||
"github.com/vbauerster/mpb/v6/decor"
|
||||
)
|
||||
|
||||
// Bar represents a progress Bar.
|
||||
// Bar represents a progress bar.
|
||||
type Bar struct {
|
||||
priority int // used by heap
|
||||
index int // used by heap
|
||||
@ -42,8 +42,10 @@ type Bar struct {
|
||||
recoveredPanic interface{}
|
||||
}
|
||||
|
||||
type extFunc func(in io.Reader, reqWidth int, st decor.Statistics) (out io.Reader, lines int)
|
||||
type extenderFunc func(in io.Reader, reqWidth int, st decor.Statistics) (out io.Reader, lines int)
|
||||
|
||||
// bState is actual bar state. It gets passed to *Bar.serve(...) monitor
|
||||
// goroutine.
|
||||
type bState struct {
|
||||
id int
|
||||
priority int
|
||||
@ -54,9 +56,9 @@ type bState struct {
|
||||
lastN int64
|
||||
iterated bool
|
||||
trimSpace bool
|
||||
toComplete bool
|
||||
completed bool
|
||||
completeFlushed bool
|
||||
ignoreComplete bool
|
||||
triggerComplete bool
|
||||
dropOnComplete bool
|
||||
noPop bool
|
||||
aDecorators []decor.Decorator
|
||||
@ -67,7 +69,7 @@ type bState struct {
|
||||
bufP, bufB, bufA *bytes.Buffer
|
||||
filler BarFiller
|
||||
middleware func(BarFiller) BarFiller
|
||||
extender extFunc
|
||||
extender extenderFunc
|
||||
|
||||
// runningBar is a key for *pState.parkedBars
|
||||
runningBar *Bar
|
||||
@ -128,9 +130,10 @@ func (b *Bar) Current() int64 {
|
||||
}
|
||||
}
|
||||
|
||||
// SetRefill fills bar with refill rune up to amount argument.
|
||||
// Given default bar style is "[=>-]<+", refill rune is '+'.
|
||||
// To set bar style use mpb.BarStyle(string) BarOption.
|
||||
// SetRefill sets refill flag with specified amount.
|
||||
// The underlying BarFiller will change its visual representation, to
|
||||
// indicate refill event. Refill event may be referred to some retry
|
||||
// operation for example.
|
||||
func (b *Bar) SetRefill(amount int64) {
|
||||
select {
|
||||
case b.operateState <- func(s *bState) {
|
||||
@ -159,19 +162,18 @@ func (b *Bar) TraverseDecorators(cb func(decor.Decorator)) {
|
||||
|
||||
// SetTotal sets total dynamically.
|
||||
// If total is less than or equal to zero it takes progress' current value.
|
||||
// A complete flag enables or disables complete event on `current >= total`.
|
||||
func (b *Bar) SetTotal(total int64, complete bool) {
|
||||
func (b *Bar) SetTotal(total int64, triggerComplete bool) {
|
||||
select {
|
||||
case b.operateState <- func(s *bState) {
|
||||
s.ignoreComplete = !complete
|
||||
s.triggerComplete = triggerComplete
|
||||
if total <= 0 {
|
||||
s.total = s.current
|
||||
} else {
|
||||
s.total = total
|
||||
}
|
||||
if !s.ignoreComplete && !s.toComplete {
|
||||
if s.triggerComplete && !s.completed {
|
||||
s.current = s.total
|
||||
s.toComplete = true
|
||||
s.completed = true
|
||||
go b.refreshTillShutdown()
|
||||
}
|
||||
}:
|
||||
@ -187,9 +189,9 @@ func (b *Bar) SetCurrent(current int64) {
|
||||
s.iterated = true
|
||||
s.lastN = current - s.current
|
||||
s.current = current
|
||||
if !s.ignoreComplete && s.current >= s.total {
|
||||
if s.triggerComplete && s.current >= s.total {
|
||||
s.current = s.total
|
||||
s.toComplete = true
|
||||
s.completed = true
|
||||
go b.refreshTillShutdown()
|
||||
}
|
||||
}:
|
||||
@ -214,9 +216,9 @@ func (b *Bar) IncrInt64(n int64) {
|
||||
s.iterated = true
|
||||
s.lastN = n
|
||||
s.current += n
|
||||
if !s.ignoreComplete && s.current >= s.total {
|
||||
if s.triggerComplete && s.current >= s.total {
|
||||
s.current = s.total
|
||||
s.toComplete = true
|
||||
s.completed = true
|
||||
go b.refreshTillShutdown()
|
||||
}
|
||||
}:
|
||||
@ -280,7 +282,7 @@ func (b *Bar) Abort(drop bool) {
|
||||
// Completed reports whether the bar is in completed state.
|
||||
func (b *Bar) Completed() bool {
|
||||
select {
|
||||
case b.operateState <- func(s *bState) { b.completed <- s.toComplete }:
|
||||
case b.operateState <- func(s *bState) { b.completed <- s.completed }:
|
||||
return <-b.completed
|
||||
case <-b.done:
|
||||
return true
|
||||
@ -322,11 +324,11 @@ func (b *Bar) render(tw int) {
|
||||
b.frameCh <- frame
|
||||
b.dlogger.Println(p)
|
||||
}
|
||||
s.completeFlushed = s.toComplete
|
||||
s.completeFlushed = s.completed
|
||||
}()
|
||||
frame, lines := s.extender(s.draw(stat), s.reqWidth, stat)
|
||||
b.extendedLines = lines
|
||||
b.toShutdown = s.toComplete && !s.completeFlushed
|
||||
b.toShutdown = s.completed && !s.completeFlushed
|
||||
b.frameCh <- frame
|
||||
}:
|
||||
case <-b.done:
|
||||
@ -475,7 +477,7 @@ func ewmaIterationUpdate(done bool, s *bState, dur time.Duration) {
|
||||
}
|
||||
}
|
||||
|
||||
func makePanicExtender(p interface{}) extFunc {
|
||||
func makePanicExtender(p interface{}) extenderFunc {
|
||||
pstr := fmt.Sprint(p)
|
||||
stack := debug.Stack()
|
||||
stackLines := bytes.Count(stack, []byte("\n"))
|
@ -3,19 +3,20 @@ package mpb
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/vbauerster/mpb/v5/decor"
|
||||
"github.com/vbauerster/mpb/v6/decor"
|
||||
)
|
||||
|
||||
// BarFiller interface.
|
||||
// Bar (without decorators) renders itself by calling BarFiller's Fill method.
|
||||
//
|
||||
// `reqWidth` is requested width, which is set via:
|
||||
// func WithWidth(width int) ContainerOption
|
||||
// func BarWidth(width int) BarOption
|
||||
// reqWidth is requested width, set by `func WithWidth(int) ContainerOption`.
|
||||
// If not set, it defaults to terminal width.
|
||||
//
|
||||
// Default implementations can be obtained via:
|
||||
//
|
||||
// func NewBarFiller(style string, reverse bool) BarFiller
|
||||
// func NewBarFiller(style string) BarFiller
|
||||
// func NewBarFillerRev(style string) BarFiller
|
||||
// func NewBarFillerPick(style string, rev bool) BarFiller
|
||||
// func NewSpinnerFiller(style []string, alignment SpinnerAlignment) BarFiller
|
||||
//
|
||||
type BarFiller interface {
|
@ -6,8 +6,9 @@ import (
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/mattn/go-runewidth"
|
||||
"github.com/vbauerster/mpb/v5/decor"
|
||||
"github.com/vbauerster/mpb/v5/internal"
|
||||
"github.com/rivo/uniseg"
|
||||
"github.com/vbauerster/mpb/v6/decor"
|
||||
"github.com/vbauerster/mpb/v6/internal"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -20,8 +21,8 @@ const (
|
||||
rRefill
|
||||
)
|
||||
|
||||
// DefaultBarStyle is a string containing 7 runes.
|
||||
// Each rune is a building block of a progress bar.
|
||||
// BarDefaultStyle is a style for rendering a progress bar.
|
||||
// It consist of 7 ordered runes:
|
||||
//
|
||||
// '1st rune' stands for left boundary rune
|
||||
//
|
||||
@ -37,7 +38,7 @@ const (
|
||||
//
|
||||
// '7th rune' stands for refill rune
|
||||
//
|
||||
const DefaultBarStyle string = "[=>-]<+"
|
||||
const BarDefaultStyle string = "[=>-]<+"
|
||||
|
||||
type barFiller struct {
|
||||
format [][]byte
|
||||
@ -54,55 +55,72 @@ type space struct {
|
||||
count int
|
||||
}
|
||||
|
||||
// NewBarFiller constucts mpb.BarFiller, to be used with *Progress.Add(...) *Bar method.
|
||||
func NewBarFiller(style string, reverse bool) BarFiller {
|
||||
// NewBarFiller returns a BarFiller implementation which renders a
|
||||
// progress bar in regular direction. If style is empty string,
|
||||
// BarDefaultStyle is applied. To be used with `*Progress.Add(...)
|
||||
// *Bar` method.
|
||||
func NewBarFiller(style string) BarFiller {
|
||||
return newBarFiller(style, false)
|
||||
}
|
||||
|
||||
// NewBarFillerRev returns a BarFiller implementation which renders a
|
||||
// progress bar in reverse direction. If style is empty string,
|
||||
// BarDefaultStyle is applied. To be used with `*Progress.Add(...)
|
||||
// *Bar` method.
|
||||
func NewBarFillerRev(style string) BarFiller {
|
||||
return newBarFiller(style, true)
|
||||
}
|
||||
|
||||
// NewBarFillerPick pick between regular and reverse BarFiller implementation
|
||||
// based on rev param. To be used with `*Progress.Add(...) *Bar` method.
|
||||
func NewBarFillerPick(style string, rev bool) BarFiller {
|
||||
return newBarFiller(style, rev)
|
||||
}
|
||||
|
||||
func newBarFiller(style string, rev bool) BarFiller {
|
||||
bf := &barFiller{
|
||||
format: make([][]byte, len(DefaultBarStyle)),
|
||||
rwidth: make([]int, len(DefaultBarStyle)),
|
||||
reverse: reverse,
|
||||
format: make([][]byte, len(BarDefaultStyle)),
|
||||
rwidth: make([]int, len(BarDefaultStyle)),
|
||||
reverse: rev,
|
||||
}
|
||||
bf.parse(BarDefaultStyle)
|
||||
if style != "" && style != BarDefaultStyle {
|
||||
bf.parse(style)
|
||||
}
|
||||
bf.SetStyle(style)
|
||||
return bf
|
||||
}
|
||||
|
||||
func (s *barFiller) SetStyle(style string) {
|
||||
func (s *barFiller) parse(style string) {
|
||||
if !utf8.ValidString(style) {
|
||||
panic("invalid bar style")
|
||||
}
|
||||
if style == "" {
|
||||
style = DefaultBarStyle
|
||||
srcFormat := make([][]byte, 0, len(BarDefaultStyle))
|
||||
srcRwidth := make([]int, 0, len(BarDefaultStyle))
|
||||
gr := uniseg.NewGraphemes(style)
|
||||
for gr.Next() {
|
||||
srcFormat = append(srcFormat, gr.Bytes())
|
||||
srcRwidth = append(srcRwidth, runewidth.StringWidth(gr.Str()))
|
||||
}
|
||||
src := make([][]byte, utf8.RuneCountInString(style))
|
||||
i := 0
|
||||
for _, r := range style {
|
||||
s.rwidth[i] = runewidth.RuneWidth(r)
|
||||
src[i] = []byte(string(r))
|
||||
i++
|
||||
}
|
||||
copy(s.format, src)
|
||||
s.SetReverse(s.reverse)
|
||||
}
|
||||
|
||||
func (s *barFiller) SetReverse(reverse bool) {
|
||||
if reverse {
|
||||
copy(s.format, srcFormat)
|
||||
copy(s.rwidth, srcRwidth)
|
||||
if s.reverse {
|
||||
s.tip = s.format[rRevTip]
|
||||
s.flush = reverseFlush
|
||||
} else {
|
||||
s.tip = s.format[rTip]
|
||||
s.flush = regularFlush
|
||||
}
|
||||
s.reverse = reverse
|
||||
}
|
||||
|
||||
func (s *barFiller) Fill(w io.Writer, reqWidth int, stat decor.Statistics) {
|
||||
width := internal.WidthForBarFiller(reqWidth, stat.AvailableWidth)
|
||||
|
||||
if brackets := s.rwidth[rLeft] + s.rwidth[rRight]; width < brackets {
|
||||
width := internal.CheckRequestedWidth(reqWidth, stat.AvailableWidth)
|
||||
brackets := s.rwidth[rLeft] + s.rwidth[rRight]
|
||||
if width < brackets {
|
||||
return
|
||||
} else {
|
||||
// don't count brackets as progress
|
||||
width -= brackets
|
||||
}
|
||||
// don't count brackets as progress
|
||||
width -= brackets
|
||||
|
||||
w.Write(s.format[rLeft])
|
||||
defer w.Write(s.format[rRight])
|
||||
|
@ -3,10 +3,10 @@ package mpb
|
||||
import (
|
||||
"io"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/vbauerster/mpb/v5/decor"
|
||||
"github.com/vbauerster/mpb/v5/internal"
|
||||
"github.com/mattn/go-runewidth"
|
||||
"github.com/vbauerster/mpb/v6/decor"
|
||||
"github.com/vbauerster/mpb/v6/internal"
|
||||
)
|
||||
|
||||
// SpinnerAlignment enum.
|
||||
@ -19,8 +19,8 @@ const (
|
||||
SpinnerOnRight
|
||||
)
|
||||
|
||||
// DefaultSpinnerStyle is a slice of strings, which makes a spinner.
|
||||
var DefaultSpinnerStyle = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
|
||||
// SpinnerDefaultStyle is a style for rendering a spinner.
|
||||
var SpinnerDefaultStyle = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
|
||||
|
||||
type spinnerFiller struct {
|
||||
frames []string
|
||||
@ -28,10 +28,12 @@ type spinnerFiller struct {
|
||||
alignment SpinnerAlignment
|
||||
}
|
||||
|
||||
// NewSpinnerFiller constucts mpb.BarFiller, to be used with *Progress.Add(...) *Bar method.
|
||||
// NewSpinnerFiller returns a BarFiller implementation which renders
|
||||
// a spinner. If style is nil or zero length, SpinnerDefaultStyle is
|
||||
// applied. To be used with `*Progress.Add(...) *Bar` method.
|
||||
func NewSpinnerFiller(style []string, alignment SpinnerAlignment) BarFiller {
|
||||
if len(style) == 0 {
|
||||
style = DefaultSpinnerStyle
|
||||
style = SpinnerDefaultStyle
|
||||
}
|
||||
filler := &spinnerFiller{
|
||||
frames: style,
|
||||
@ -41,10 +43,10 @@ func NewSpinnerFiller(style []string, alignment SpinnerAlignment) BarFiller {
|
||||
}
|
||||
|
||||
func (s *spinnerFiller) Fill(w io.Writer, reqWidth int, stat decor.Statistics) {
|
||||
width := internal.WidthForBarFiller(reqWidth, stat.AvailableWidth)
|
||||
width := internal.CheckRequestedWidth(reqWidth, stat.AvailableWidth)
|
||||
|
||||
frame := s.frames[s.count%uint(len(s.frames))]
|
||||
frameWidth := utf8.RuneCountInString(frame)
|
||||
frameWidth := runewidth.StringWidth(frame)
|
||||
|
||||
if width < frameWidth {
|
||||
return
|
@ -4,10 +4,11 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
|
||||
"github.com/vbauerster/mpb/v5/decor"
|
||||
"github.com/vbauerster/mpb/v6/decor"
|
||||
"github.com/vbauerster/mpb/v6/internal"
|
||||
)
|
||||
|
||||
// BarOption is a function option which changes the default behavior of a bar.
|
||||
// BarOption is a func option to alter default behavior of a bar.
|
||||
type BarOption func(*bState)
|
||||
|
||||
func (s *bState) addDecorators(dest *[]decor.Decorator, decorators ...decor.Decorator) {
|
||||
@ -88,7 +89,7 @@ func BarFillerOnComplete(message string) BarOption {
|
||||
})
|
||||
}
|
||||
|
||||
// BarFillerMiddleware provides a way to augment default BarFiller.
|
||||
// BarFillerMiddleware provides a way to augment the underlying BarFiller.
|
||||
func BarFillerMiddleware(middle func(BarFiller) BarFiller) BarOption {
|
||||
return func(s *bState) {
|
||||
s.middleware = middle
|
||||
@ -104,18 +105,17 @@ func BarPriority(priority int) BarOption {
|
||||
}
|
||||
}
|
||||
|
||||
// BarExtender is an option to extend bar to the next new line, with
|
||||
// arbitrary output.
|
||||
// BarExtender provides a way to extend bar to the next new line.
|
||||
func BarExtender(filler BarFiller) BarOption {
|
||||
if filler == nil {
|
||||
return nil
|
||||
}
|
||||
return func(s *bState) {
|
||||
s.extender = makeExtFunc(filler)
|
||||
s.extender = makeExtenderFunc(filler)
|
||||
}
|
||||
}
|
||||
|
||||
func makeExtFunc(filler BarFiller) extFunc {
|
||||
func makeExtenderFunc(filler BarFiller) extenderFunc {
|
||||
buf := new(bytes.Buffer)
|
||||
return func(r io.Reader, reqWidth int, st decor.Statistics) (io.Reader, int) {
|
||||
filler.Fill(buf, reqWidth, st)
|
||||
@ -123,37 +123,13 @@ func makeExtFunc(filler BarFiller) extFunc {
|
||||
}
|
||||
}
|
||||
|
||||
// BarFillerTrim bar filler is rendered with leading and trailing space
|
||||
// like ' [===] ' by default. With this option leading and trailing
|
||||
// space will be removed.
|
||||
// BarFillerTrim removes leading and trailing space around the underlying BarFiller.
|
||||
func BarFillerTrim() BarOption {
|
||||
return func(s *bState) {
|
||||
s.trimSpace = true
|
||||
}
|
||||
}
|
||||
|
||||
// TrimSpace is an alias to BarFillerTrim.
|
||||
func TrimSpace() BarOption {
|
||||
return BarFillerTrim()
|
||||
}
|
||||
|
||||
// BarStyle overrides mpb.DefaultBarStyle which is "[=>-]<+".
|
||||
// It's ok to pass string containing just 5 runes, for example "╢▌▌░╟",
|
||||
// if you don't need to override '<' (reverse tip) and '+' (refill rune).
|
||||
func BarStyle(style string) BarOption {
|
||||
if style == "" {
|
||||
return nil
|
||||
}
|
||||
type styleSetter interface {
|
||||
SetStyle(string)
|
||||
}
|
||||
return func(s *bState) {
|
||||
if t, ok := s.filler.(styleSetter); ok {
|
||||
t.SetStyle(style)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// BarNoPop disables bar pop out of container. Effective when
|
||||
// PopCompletedMode of container is enabled.
|
||||
func BarNoPop() BarOption {
|
||||
@ -162,51 +138,15 @@ func BarNoPop() BarOption {
|
||||
}
|
||||
}
|
||||
|
||||
// BarReverse reverse mode, bar will progress from right to left.
|
||||
func BarReverse() BarOption {
|
||||
type revSetter interface {
|
||||
SetReverse(bool)
|
||||
}
|
||||
return func(s *bState) {
|
||||
if t, ok := s.filler.(revSetter); ok {
|
||||
t.SetReverse(true)
|
||||
}
|
||||
}
|
||||
// BarOptional will invoke provided option only when pick is true.
|
||||
func BarOptional(option BarOption, pick bool) BarOption {
|
||||
return BarOptOn(option, internal.Predicate(pick))
|
||||
}
|
||||
|
||||
// SpinnerStyle sets custom spinner style.
|
||||
// Effective when Filler type is spinner.
|
||||
func SpinnerStyle(frames []string) BarOption {
|
||||
if len(frames) == 0 {
|
||||
return nil
|
||||
}
|
||||
chk := func(filler BarFiller) (interface{}, bool) {
|
||||
t, ok := filler.(*spinnerFiller)
|
||||
return t, ok
|
||||
}
|
||||
cb := func(t interface{}) {
|
||||
t.(*spinnerFiller).frames = frames
|
||||
}
|
||||
return MakeFillerTypeSpecificBarOption(chk, cb)
|
||||
}
|
||||
|
||||
// MakeFillerTypeSpecificBarOption makes BarOption specific to Filler's
|
||||
// actual type. If you implement your own Filler, so most probably
|
||||
// you'll need this. See BarStyle or SpinnerStyle for example.
|
||||
func MakeFillerTypeSpecificBarOption(
|
||||
typeChecker func(BarFiller) (interface{}, bool),
|
||||
cb func(interface{}),
|
||||
) BarOption {
|
||||
return func(s *bState) {
|
||||
if t, ok := typeChecker(s.filler); ok {
|
||||
cb(t)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// BarOptOn returns option when condition evaluates to true.
|
||||
func BarOptOn(option BarOption, condition func() bool) BarOption {
|
||||
if condition() {
|
||||
// BarOptOn will invoke provided option only when higher order predicate
|
||||
// evaluates to true.
|
||||
func BarOptOn(option BarOption, predicate func() bool) BarOption {
|
||||
if predicate() {
|
||||
return option
|
||||
}
|
||||
return nil
|
@ -5,10 +5,13 @@ import (
|
||||
"io/ioutil"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/vbauerster/mpb/v6/internal"
|
||||
)
|
||||
|
||||
// ContainerOption is a function option which changes the default
|
||||
// behavior of progress container, if passed to mpb.New(...ContainerOption).
|
||||
// ContainerOption is a func option to alter default behavior of a bar
|
||||
// container. Container term refers to a Progress struct which can
|
||||
// hold one or more Bars.
|
||||
type ContainerOption func(*pState)
|
||||
|
||||
// WithWaitGroup provides means to have a single joint point. If
|
||||
@ -21,8 +24,9 @@ func WithWaitGroup(wg *sync.WaitGroup) ContainerOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithWidth sets container width. If not set underlying bars will
|
||||
// occupy whole term width.
|
||||
// WithWidth sets container width. If not set it defaults to terminal
|
||||
// width. A bar added to the container will inherit its width, unless
|
||||
// overridden by `func BarWidth(int) BarOption`.
|
||||
func WithWidth(width int) ContainerOption {
|
||||
return func(s *pState) {
|
||||
s.reqWidth = width
|
||||
@ -38,9 +42,9 @@ func WithRefreshRate(d time.Duration) ContainerOption {
|
||||
|
||||
// WithManualRefresh disables internal auto refresh time.Ticker.
|
||||
// Refresh will occur upon receive value from provided ch.
|
||||
func WithManualRefresh(ch <-chan time.Time) ContainerOption {
|
||||
func WithManualRefresh(ch <-chan interface{}) ContainerOption {
|
||||
return func(s *pState) {
|
||||
s.refreshSrc = ch
|
||||
s.externalRefresh = ch
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,8 +72,8 @@ func WithShutdownNotifier(ch chan struct{}) ContainerOption {
|
||||
func WithOutput(w io.Writer) ContainerOption {
|
||||
return func(s *pState) {
|
||||
if w == nil {
|
||||
s.refreshSrc = make(chan time.Time)
|
||||
s.output = ioutil.Discard
|
||||
s.outputDiscarded = true
|
||||
return
|
||||
}
|
||||
s.output = w
|
||||
@ -93,9 +97,15 @@ func PopCompletedMode() ContainerOption {
|
||||
}
|
||||
}
|
||||
|
||||
// ContainerOptOn returns option when condition evaluates to true.
|
||||
func ContainerOptOn(option ContainerOption, condition func() bool) ContainerOption {
|
||||
if condition() {
|
||||
// ContainerOptional will invoke provided option only when pick is true.
|
||||
func ContainerOptional(option ContainerOption, pick bool) ContainerOption {
|
||||
return ContainerOptOn(option, internal.Predicate(pick))
|
||||
}
|
||||
|
||||
// ContainerOptOn will invoke provided option only when higher order
|
||||
// predicate evaluates to true.
|
||||
func ContainerOptOn(option ContainerOption, predicate func() bool) ContainerOption {
|
||||
if predicate() {
|
||||
return option
|
||||
}
|
||||
return nil
|
2
vendor/github.com/vbauerster/mpb/v6/cwriter/doc.go
generated
vendored
Normal file
2
vendor/github.com/vbauerster/mpb/v6/cwriter/doc.go
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
// Package cwriter is a console writer abstraction for the underlying OS.
|
||||
package cwriter
|
@ -8,8 +8,8 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// NotATTY not a TeleTYpewriter error.
|
||||
var NotATTY = errors.New("not a terminal")
|
||||
// ErrNotTTY not a TeleTYpewriter error.
|
||||
var ErrNotTTY = errors.New("not a terminal")
|
||||
|
||||
// http://ascii-table.com/ansi-escape-sequences.php
|
||||
const (
|
||||
@ -39,7 +39,7 @@ func New(out io.Writer) *Writer {
|
||||
|
||||
// Flush flushes the underlying buffer.
|
||||
func (w *Writer) Flush(lineCount int) (err error) {
|
||||
// some terminals interpret clear 0 lines as clear 1
|
||||
// some terminals interpret 'cursor up 0' as 'cursor up 1'
|
||||
if w.lineCount > 0 {
|
||||
err = w.clearLines()
|
||||
if err != nil {
|
||||
@ -70,7 +70,7 @@ func (w *Writer) ReadFrom(r io.Reader) (n int64, err error) {
|
||||
// GetWidth returns width of underlying terminal.
|
||||
func (w *Writer) GetWidth() (int, error) {
|
||||
if !w.isTerminal {
|
||||
return -1, NotATTY
|
||||
return -1, ErrNotTTY
|
||||
}
|
||||
tw, _, err := GetSize(w.fd)
|
||||
return tw, err
|
@ -1,6 +1,5 @@
|
||||
// Package decor provides common decorators for "github.com/vbauerster/mpb/v6" module.
|
||||
/*
|
||||
Package decor provides common decorators for "github.com/vbauerster/mpb/v5" module.
|
||||
|
||||
Some decorators returned by this package might have a closure state. It is ok to use
|
||||
decorators concurrently, unless you share the same decorator among multiple
|
||||
*mpb.Bar instances. To avoid data races, create new decorator per *mpb.Bar instance.
|
@ -5,7 +5,7 @@ import (
|
||||
"io"
|
||||
"strconv"
|
||||
|
||||
"github.com/vbauerster/mpb/v5/internal"
|
||||
"github.com/vbauerster/mpb/v6/internal"
|
||||
)
|
||||
|
||||
type percentageType float64
|
11
vendor/github.com/vbauerster/mpb/v6/go.mod
generated
vendored
Normal file
11
vendor/github.com/vbauerster/mpb/v6/go.mod
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
module github.com/vbauerster/mpb/v6
|
||||
|
||||
require (
|
||||
github.com/VividCortex/ewma v1.1.1
|
||||
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
|
||||
github.com/mattn/go-runewidth v0.0.10
|
||||
github.com/rivo/uniseg v0.2.0
|
||||
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78
|
||||
)
|
||||
|
||||
go 1.14
|
11
vendor/github.com/vbauerster/mpb/v6/go.sum
generated
vendored
Normal file
11
vendor/github.com/vbauerster/mpb/v6/go.sum
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM=
|
||||
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
|
||||
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=
|
||||
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo=
|
||||
github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg=
|
||||
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
||||
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 h1:nVuTkr9L6Bq62qpUqKo/RnZCFfzDBL0bYo6w9OJUqZY=
|
||||
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
@ -13,6 +13,7 @@ func Percentage(total, current int64, width int) float64 {
|
||||
return float64(int64(width)*current) / float64(total)
|
||||
}
|
||||
|
||||
// PercentageRound same as Percentage but with math.Round.
|
||||
func PercentageRound(total, current int64, width int) float64 {
|
||||
return math.Round(Percentage(total, current, width))
|
||||
}
|
6
vendor/github.com/vbauerster/mpb/v6/internal/predicate.go
generated
vendored
Normal file
6
vendor/github.com/vbauerster/mpb/v6/internal/predicate.go
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
package internal
|
||||
|
||||
// Predicate helper for internal use.
|
||||
func Predicate(pick bool) func() bool {
|
||||
return func() bool { return pick }
|
||||
}
|
10
vendor/github.com/vbauerster/mpb/v6/internal/width.go
generated
vendored
Normal file
10
vendor/github.com/vbauerster/mpb/v6/internal/width.go
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
package internal
|
||||
|
||||
// CheckRequestedWidth checks that requested width doesn't overflow
|
||||
// available width
|
||||
func CheckRequestedWidth(requested, available int) int {
|
||||
if requested <= 0 || requested >= available {
|
||||
return available
|
||||
}
|
||||
return requested
|
||||
}
|
@ -13,8 +13,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/vbauerster/mpb/v5/cwriter"
|
||||
"github.com/vbauerster/mpb/v5/decor"
|
||||
"github.com/vbauerster/mpb/v6/cwriter"
|
||||
"github.com/vbauerster/mpb/v6/decor"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -22,7 +22,8 @@ const (
|
||||
prr = 120 * time.Millisecond
|
||||
)
|
||||
|
||||
// Progress represents the container that renders Progress bars
|
||||
// Progress represents a container that renders one or more progress
|
||||
// bars.
|
||||
type Progress struct {
|
||||
ctx context.Context
|
||||
uwg *sync.WaitGroup
|
||||
@ -35,6 +36,8 @@ type Progress struct {
|
||||
dlogger *log.Logger
|
||||
}
|
||||
|
||||
// pState holds bars in its priorityQueue. It gets passed to
|
||||
// *Progress.serve(...) monitor goroutine.
|
||||
type pState struct {
|
||||
bHeap priorityQueue
|
||||
heapUpdated bool
|
||||
@ -46,9 +49,10 @@ type pState struct {
|
||||
idCount int
|
||||
reqWidth int
|
||||
popCompleted bool
|
||||
outputDiscarded bool
|
||||
rr time.Duration
|
||||
uwg *sync.WaitGroup
|
||||
refreshSrc <-chan time.Time
|
||||
externalRefresh <-chan interface{}
|
||||
renderDelay <-chan struct{}
|
||||
shutdownNotifier chan struct{}
|
||||
parkedBars map[*Bar]*Bar
|
||||
@ -95,18 +99,21 @@ func NewWithContext(ctx context.Context, options ...ContainerOption) *Progress {
|
||||
return p
|
||||
}
|
||||
|
||||
// AddBar creates a new progress bar and adds it to the rendering queue.
|
||||
// AddBar creates a bar with default bar filler. Different filler can
|
||||
// be choosen and applied via `*Progress.Add(...) *Bar` method.
|
||||
func (p *Progress) AddBar(total int64, options ...BarOption) *Bar {
|
||||
return p.Add(total, NewBarFiller(DefaultBarStyle, false), options...)
|
||||
return p.Add(total, NewBarFiller(BarDefaultStyle), options...)
|
||||
}
|
||||
|
||||
// AddSpinner creates a new spinner bar and adds it to the rendering queue.
|
||||
// AddSpinner creates a bar with default spinner filler. Different
|
||||
// filler can be choosen and applied via `*Progress.Add(...) *Bar`
|
||||
// method.
|
||||
func (p *Progress) AddSpinner(total int64, alignment SpinnerAlignment, options ...BarOption) *Bar {
|
||||
return p.Add(total, NewSpinnerFiller(DefaultSpinnerStyle, alignment), options...)
|
||||
return p.Add(total, NewSpinnerFiller(SpinnerDefaultStyle, alignment), options...)
|
||||
}
|
||||
|
||||
// Add creates a bar which renders itself by provided filler.
|
||||
// Set total to 0, if you plan to update it later.
|
||||
// If `total <= 0` trigger complete event is disabled until reset with *bar.SetTotal(int64, bool).
|
||||
// Panics if *Progress instance is done, i.e. called after *Progress.Wait().
|
||||
func (p *Progress) Add(total int64, filler BarFiller, options ...BarOption) *Bar {
|
||||
if filler == nil {
|
||||
@ -168,7 +175,7 @@ func (p *Progress) UpdateBarPriority(b *Bar, priority int) {
|
||||
p.setBarPriority(b, priority)
|
||||
}
|
||||
|
||||
// BarCount returns bars count
|
||||
// BarCount returns bars count.
|
||||
func (p *Progress) BarCount() int {
|
||||
result := make(chan int, 1)
|
||||
select {
|
||||
@ -234,15 +241,26 @@ func (s *pState) newTicker(done <-chan struct{}) chan time.Time {
|
||||
if s.renderDelay != nil {
|
||||
<-s.renderDelay
|
||||
}
|
||||
if s.refreshSrc == nil {
|
||||
ticker := time.NewTicker(s.rr)
|
||||
defer ticker.Stop()
|
||||
s.refreshSrc = ticker.C
|
||||
var internalRefresh <-chan time.Time
|
||||
if !s.outputDiscarded {
|
||||
if s.externalRefresh == nil {
|
||||
ticker := time.NewTicker(s.rr)
|
||||
defer ticker.Stop()
|
||||
internalRefresh = ticker.C
|
||||
}
|
||||
} else {
|
||||
s.externalRefresh = nil
|
||||
}
|
||||
for {
|
||||
select {
|
||||
case tick := <-s.refreshSrc:
|
||||
ch <- tick
|
||||
case t := <-internalRefresh:
|
||||
ch <- t
|
||||
case x := <-s.externalRefresh:
|
||||
if t, ok := x.(time.Time); ok {
|
||||
ch <- t
|
||||
} else {
|
||||
ch <- time.Now()
|
||||
}
|
||||
case <-done:
|
||||
close(s.shutdownNotifier)
|
||||
return
|
||||
@ -349,6 +367,10 @@ func (s *pState) makeBarState(total int64, filler BarFiller, options ...BarOptio
|
||||
debugOut: s.debugOut,
|
||||
}
|
||||
|
||||
if total > 0 {
|
||||
bs.triggerComplete = true
|
||||
}
|
||||
|
||||
for _, opt := range options {
|
||||
if opt != nil {
|
||||
opt(bs)
|
2
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
2
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
@ -204,6 +204,7 @@ struct ltchars {
|
||||
#include <linux/devlink.h>
|
||||
#include <linux/dm-ioctl.h>
|
||||
#include <linux/errqueue.h>
|
||||
#include <linux/ethtool_netlink.h>
|
||||
#include <linux/falloc.h>
|
||||
#include <linux/fanotify.h>
|
||||
#include <linux/filter.h>
|
||||
@ -563,6 +564,7 @@ ccflags="$@"
|
||||
$2 ~ /^TIPC_/ ||
|
||||
$2 !~ "DEVLINK_RELOAD_LIMITS_VALID_MASK" &&
|
||||
$2 ~ /^DEVLINK_/ ||
|
||||
$2 ~ /^ETHTOOL_/ ||
|
||||
$2 ~ /^LWTUNNEL_IP/ ||
|
||||
$2 !~ "WMESGLEN" &&
|
||||
$2 ~ /^W[A-Z0-9]+$/ ||
|
||||
|
11
vendor/golang.org/x/sys/unix/ptrace_darwin.go
generated
vendored
Normal file
11
vendor/golang.org/x/sys/unix/ptrace_darwin.go
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build darwin,!ios
|
||||
|
||||
package unix
|
||||
|
||||
func ptrace(request int, pid int, addr uintptr, data uintptr) error {
|
||||
return ptrace1(request, pid, addr, data)
|
||||
}
|
11
vendor/golang.org/x/sys/unix/ptrace_ios.go
generated
vendored
Normal file
11
vendor/golang.org/x/sys/unix/ptrace_ios.go
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ios
|
||||
|
||||
package unix
|
||||
|
||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||
return ENOTSUP
|
||||
}
|
7
vendor/golang.org/x/sys/unix/syscall_darwin.go
generated
vendored
7
vendor/golang.org/x/sys/unix/syscall_darwin.go
generated
vendored
@ -119,13 +119,16 @@ type attrList struct {
|
||||
Forkattr uint32
|
||||
}
|
||||
|
||||
//sysnb pipe() (r int, w int, err error)
|
||||
//sysnb pipe(p *[2]int32) (err error)
|
||||
|
||||
func Pipe(p []int) (err error) {
|
||||
if len(p) != 2 {
|
||||
return EINVAL
|
||||
}
|
||||
p[0], p[1], err = pipe()
|
||||
var x [2]int32
|
||||
err = pipe(&x)
|
||||
p[0] = int(x[0])
|
||||
p[1] = int(x[1])
|
||||
return
|
||||
}
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/syscall_darwin_386.go
generated
vendored
2
vendor/golang.org/x/sys/unix/syscall_darwin_386.go
generated
vendored
@ -45,6 +45,6 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
|
||||
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
|
||||
//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
|
||||
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
||||
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
|
||||
//sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
|
||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
|
||||
|
2
vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
generated
vendored
@ -45,6 +45,6 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
|
||||
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
|
||||
//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
|
||||
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
||||
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
|
||||
//sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
|
||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
|
||||
|
2
vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
generated
vendored
2
vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
generated
vendored
@ -6,7 +6,7 @@ package unix
|
||||
|
||||
import "syscall"
|
||||
|
||||
func ptrace(request int, pid int, addr uintptr, data uintptr) error {
|
||||
func ptrace1(request int, pid int, addr uintptr, data uintptr) error {
|
||||
return ENOTSUP
|
||||
}
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
generated
vendored
@ -45,6 +45,6 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
|
||||
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
||||
//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT
|
||||
//sys Lstat(path string, stat *Stat_t) (err error)
|
||||
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
|
||||
//sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
|
||||
//sys Stat(path string, stat *Stat_t) (err error)
|
||||
//sys Statfs(path string, stat *Statfs_t) (err error)
|
||||
|
13
vendor/golang.org/x/sys/unix/syscall_illumos.go
generated
vendored
13
vendor/golang.org/x/sys/unix/syscall_illumos.go
generated
vendored
@ -75,16 +75,3 @@ func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
|
||||
|
||||
func Pipe2(p []int, flags int) error {
|
||||
if len(p) != 2 {
|
||||
return EINVAL
|
||||
}
|
||||
var pp [2]_C_int
|
||||
err := pipe2(&pp, flags)
|
||||
p[0] = int(pp[0])
|
||||
p[1] = int(pp[1])
|
||||
return err
|
||||
}
|
||||
|
13
vendor/golang.org/x/sys/unix/syscall_solaris.go
generated
vendored
13
vendor/golang.org/x/sys/unix/syscall_solaris.go
generated
vendored
@ -68,6 +68,19 @@ func Pipe(p []int) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
|
||||
|
||||
func Pipe2(p []int, flags int) error {
|
||||
if len(p) != 2 {
|
||||
return EINVAL
|
||||
}
|
||||
var pp [2]_C_int
|
||||
err := pipe2(&pp, flags)
|
||||
p[0] = int(pp[0])
|
||||
p[1] = int(pp[1])
|
||||
return err
|
||||
}
|
||||
|
||||
func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||
if sa.Port < 0 || sa.Port > 0xFFFF {
|
||||
return nil, 0, EINVAL
|
||||
|
119
vendor/golang.org/x/sys/unix/zerrors_linux.go
generated
vendored
119
vendor/golang.org/x/sys/unix/zerrors_linux.go
generated
vendored
@ -527,6 +527,119 @@ const (
|
||||
EPOLL_CTL_DEL = 0x2
|
||||
EPOLL_CTL_MOD = 0x3
|
||||
EROFS_SUPER_MAGIC_V1 = 0xe0f5e1e2
|
||||
ESP_V4_FLOW = 0xa
|
||||
ESP_V6_FLOW = 0xc
|
||||
ETHER_FLOW = 0x12
|
||||
ETHTOOL_BUSINFO_LEN = 0x20
|
||||
ETHTOOL_EROMVERS_LEN = 0x20
|
||||
ETHTOOL_FEC_AUTO = 0x2
|
||||
ETHTOOL_FEC_BASER = 0x10
|
||||
ETHTOOL_FEC_LLRS = 0x20
|
||||
ETHTOOL_FEC_NONE = 0x1
|
||||
ETHTOOL_FEC_OFF = 0x4
|
||||
ETHTOOL_FEC_RS = 0x8
|
||||
ETHTOOL_FLAG_ALL = 0x7
|
||||
ETHTOOL_FLAG_COMPACT_BITSETS = 0x1
|
||||
ETHTOOL_FLAG_OMIT_REPLY = 0x2
|
||||
ETHTOOL_FLAG_STATS = 0x4
|
||||
ETHTOOL_FLASHDEV = 0x33
|
||||
ETHTOOL_FLASH_MAX_FILENAME = 0x80
|
||||
ETHTOOL_FWVERS_LEN = 0x20
|
||||
ETHTOOL_F_COMPAT = 0x4
|
||||
ETHTOOL_F_UNSUPPORTED = 0x1
|
||||
ETHTOOL_F_WISH = 0x2
|
||||
ETHTOOL_GCHANNELS = 0x3c
|
||||
ETHTOOL_GCOALESCE = 0xe
|
||||
ETHTOOL_GDRVINFO = 0x3
|
||||
ETHTOOL_GEEE = 0x44
|
||||
ETHTOOL_GEEPROM = 0xb
|
||||
ETHTOOL_GENL_NAME = "ethtool"
|
||||
ETHTOOL_GENL_VERSION = 0x1
|
||||
ETHTOOL_GET_DUMP_DATA = 0x40
|
||||
ETHTOOL_GET_DUMP_FLAG = 0x3f
|
||||
ETHTOOL_GET_TS_INFO = 0x41
|
||||
ETHTOOL_GFEATURES = 0x3a
|
||||
ETHTOOL_GFECPARAM = 0x50
|
||||
ETHTOOL_GFLAGS = 0x25
|
||||
ETHTOOL_GGRO = 0x2b
|
||||
ETHTOOL_GGSO = 0x23
|
||||
ETHTOOL_GLINK = 0xa
|
||||
ETHTOOL_GLINKSETTINGS = 0x4c
|
||||
ETHTOOL_GMODULEEEPROM = 0x43
|
||||
ETHTOOL_GMODULEINFO = 0x42
|
||||
ETHTOOL_GMSGLVL = 0x7
|
||||
ETHTOOL_GPAUSEPARAM = 0x12
|
||||
ETHTOOL_GPERMADDR = 0x20
|
||||
ETHTOOL_GPFLAGS = 0x27
|
||||
ETHTOOL_GPHYSTATS = 0x4a
|
||||
ETHTOOL_GREGS = 0x4
|
||||
ETHTOOL_GRINGPARAM = 0x10
|
||||
ETHTOOL_GRSSH = 0x46
|
||||
ETHTOOL_GRXCLSRLALL = 0x30
|
||||
ETHTOOL_GRXCLSRLCNT = 0x2e
|
||||
ETHTOOL_GRXCLSRULE = 0x2f
|
||||
ETHTOOL_GRXCSUM = 0x14
|
||||
ETHTOOL_GRXFH = 0x29
|
||||
ETHTOOL_GRXFHINDIR = 0x38
|
||||
ETHTOOL_GRXNTUPLE = 0x36
|
||||
ETHTOOL_GRXRINGS = 0x2d
|
||||
ETHTOOL_GSET = 0x1
|
||||
ETHTOOL_GSG = 0x18
|
||||
ETHTOOL_GSSET_INFO = 0x37
|
||||
ETHTOOL_GSTATS = 0x1d
|
||||
ETHTOOL_GSTRINGS = 0x1b
|
||||
ETHTOOL_GTSO = 0x1e
|
||||
ETHTOOL_GTUNABLE = 0x48
|
||||
ETHTOOL_GTXCSUM = 0x16
|
||||
ETHTOOL_GUFO = 0x21
|
||||
ETHTOOL_GWOL = 0x5
|
||||
ETHTOOL_MCGRP_MONITOR_NAME = "monitor"
|
||||
ETHTOOL_NWAY_RST = 0x9
|
||||
ETHTOOL_PERQUEUE = 0x4b
|
||||
ETHTOOL_PHYS_ID = 0x1c
|
||||
ETHTOOL_PHY_EDPD_DFLT_TX_MSECS = 0xffff
|
||||
ETHTOOL_PHY_EDPD_DISABLE = 0x0
|
||||
ETHTOOL_PHY_EDPD_NO_TX = 0xfffe
|
||||
ETHTOOL_PHY_FAST_LINK_DOWN_OFF = 0xff
|
||||
ETHTOOL_PHY_FAST_LINK_DOWN_ON = 0x0
|
||||
ETHTOOL_PHY_GTUNABLE = 0x4e
|
||||
ETHTOOL_PHY_STUNABLE = 0x4f
|
||||
ETHTOOL_RESET = 0x34
|
||||
ETHTOOL_RXNTUPLE_ACTION_CLEAR = -0x2
|
||||
ETHTOOL_RXNTUPLE_ACTION_DROP = -0x1
|
||||
ETHTOOL_RX_FLOW_SPEC_RING = 0xffffffff
|
||||
ETHTOOL_RX_FLOW_SPEC_RING_VF = 0xff00000000
|
||||
ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF = 0x20
|
||||
ETHTOOL_SCHANNELS = 0x3d
|
||||
ETHTOOL_SCOALESCE = 0xf
|
||||
ETHTOOL_SEEE = 0x45
|
||||
ETHTOOL_SEEPROM = 0xc
|
||||
ETHTOOL_SET_DUMP = 0x3e
|
||||
ETHTOOL_SFEATURES = 0x3b
|
||||
ETHTOOL_SFECPARAM = 0x51
|
||||
ETHTOOL_SFLAGS = 0x26
|
||||
ETHTOOL_SGRO = 0x2c
|
||||
ETHTOOL_SGSO = 0x24
|
||||
ETHTOOL_SLINKSETTINGS = 0x4d
|
||||
ETHTOOL_SMSGLVL = 0x8
|
||||
ETHTOOL_SPAUSEPARAM = 0x13
|
||||
ETHTOOL_SPFLAGS = 0x28
|
||||
ETHTOOL_SRINGPARAM = 0x11
|
||||
ETHTOOL_SRSSH = 0x47
|
||||
ETHTOOL_SRXCLSRLDEL = 0x31
|
||||
ETHTOOL_SRXCLSRLINS = 0x32
|
||||
ETHTOOL_SRXCSUM = 0x15
|
||||
ETHTOOL_SRXFH = 0x2a
|
||||
ETHTOOL_SRXFHINDIR = 0x39
|
||||
ETHTOOL_SRXNTUPLE = 0x35
|
||||
ETHTOOL_SSET = 0x2
|
||||
ETHTOOL_SSG = 0x19
|
||||
ETHTOOL_STSO = 0x1f
|
||||
ETHTOOL_STUNABLE = 0x49
|
||||
ETHTOOL_STXCSUM = 0x17
|
||||
ETHTOOL_SUFO = 0x22
|
||||
ETHTOOL_SWOL = 0x6
|
||||
ETHTOOL_TEST = 0x1a
|
||||
ETH_P_1588 = 0x88f7
|
||||
ETH_P_8021AD = 0x88a8
|
||||
ETH_P_8021AH = 0x88e7
|
||||
@ -996,6 +1109,7 @@ const (
|
||||
IPV6_DONTFRAG = 0x3e
|
||||
IPV6_DROP_MEMBERSHIP = 0x15
|
||||
IPV6_DSTOPTS = 0x3b
|
||||
IPV6_FLOW = 0x11
|
||||
IPV6_FREEBIND = 0x4e
|
||||
IPV6_HDRINCL = 0x24
|
||||
IPV6_HOPLIMIT = 0x34
|
||||
@ -1045,6 +1159,7 @@ const (
|
||||
IPV6_TRANSPARENT = 0x4b
|
||||
IPV6_UNICAST_HOPS = 0x10
|
||||
IPV6_UNICAST_IF = 0x4c
|
||||
IPV6_USER_FLOW = 0xe
|
||||
IPV6_V6ONLY = 0x1a
|
||||
IPV6_XFRM_POLICY = 0x23
|
||||
IP_ADD_MEMBERSHIP = 0x23
|
||||
@ -1101,6 +1216,7 @@ const (
|
||||
IP_TTL = 0x2
|
||||
IP_UNBLOCK_SOURCE = 0x25
|
||||
IP_UNICAST_IF = 0x32
|
||||
IP_USER_FLOW = 0xd
|
||||
IP_XFRM_POLICY = 0x11
|
||||
ISOFS_SUPER_MAGIC = 0x9660
|
||||
ISTRIP = 0x20
|
||||
@ -2340,6 +2456,8 @@ const (
|
||||
TCP_TX_DELAY = 0x25
|
||||
TCP_ULP = 0x1f
|
||||
TCP_USER_TIMEOUT = 0x12
|
||||
TCP_V4_FLOW = 0x1
|
||||
TCP_V6_FLOW = 0x5
|
||||
TCP_WINDOW_CLAMP = 0xa
|
||||
TCP_ZEROCOPY_RECEIVE = 0x23
|
||||
TFD_TIMER_ABSTIME = 0x1
|
||||
@ -2466,6 +2584,7 @@ const (
|
||||
VM_SOCKETS_INVALID_VERSION = 0xffffffff
|
||||
VQUIT = 0x1
|
||||
VT0 = 0x0
|
||||
WAKE_MAGIC = 0x20
|
||||
WALL = 0x40000000
|
||||
WCLONE = 0x80000000
|
||||
WCONTINUED = 0x8
|
||||
|
2
vendor/golang.org/x/sys/unix/zerrors_linux_386.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zerrors_linux_386.go
generated
vendored
@ -4,7 +4,7 @@
|
||||
// +build 386,linux
|
||||
|
||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 _const.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 /build/_const.go
|
||||
|
||||
package unix
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
generated
vendored
@ -4,7 +4,7 @@
|
||||
// +build amd64,linux
|
||||
|
||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 _const.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 /build/_const.go
|
||||
|
||||
package unix
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
generated
vendored
@ -4,7 +4,7 @@
|
||||
// +build arm,linux
|
||||
|
||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go
|
||||
|
||||
package unix
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
generated
vendored
@ -4,7 +4,7 @@
|
||||
// +build arm64,linux
|
||||
|
||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char _const.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/_const.go
|
||||
|
||||
package unix
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
generated
vendored
@ -4,7 +4,7 @@
|
||||
// +build mips,linux
|
||||
|
||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go
|
||||
|
||||
package unix
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
generated
vendored
@ -4,7 +4,7 @@
|
||||
// +build mips64,linux
|
||||
|
||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go
|
||||
|
||||
package unix
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
generated
vendored
@ -4,7 +4,7 @@
|
||||
// +build mips64le,linux
|
||||
|
||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go
|
||||
|
||||
package unix
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
generated
vendored
@ -4,7 +4,7 @@
|
||||
// +build mipsle,linux
|
||||
|
||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go
|
||||
|
||||
package unix
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
generated
vendored
@ -4,7 +4,7 @@
|
||||
// +build ppc64,linux
|
||||
|
||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go
|
||||
|
||||
package unix
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
generated
vendored
@ -4,7 +4,7 @@
|
||||
// +build ppc64le,linux
|
||||
|
||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go
|
||||
|
||||
package unix
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
generated
vendored
@ -4,7 +4,7 @@
|
||||
// +build riscv64,linux
|
||||
|
||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go
|
||||
|
||||
package unix
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
generated
vendored
@ -4,7 +4,7 @@
|
||||
// +build s390x,linux
|
||||
|
||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char _const.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/_const.go
|
||||
|
||||
package unix
|
||||
|
||||
|
2
vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
generated
vendored
@ -4,7 +4,7 @@
|
||||
// +build sparc64,linux
|
||||
|
||||
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/_const.go
|
||||
|
||||
package unix
|
||||
|
||||
|
8
vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go
generated
vendored
8
vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go
generated
vendored
@ -462,10 +462,8 @@ func libc_munlockall_trampoline()
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func pipe() (r int, w int, err error) {
|
||||
r0, r1, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), 0, 0, 0)
|
||||
r = int(r0)
|
||||
w = int(r1)
|
||||
func pipe(p *[2]int32) (err error) {
|
||||
_, _, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), uintptr(unsafe.Pointer(p)), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
@ -2381,7 +2379,7 @@ func libc_lstat64_trampoline()
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||
func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||
_, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
|
8
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
generated
vendored
8
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
generated
vendored
@ -462,10 +462,8 @@ func libc_munlockall_trampoline()
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func pipe() (r int, w int, err error) {
|
||||
r0, r1, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), 0, 0, 0)
|
||||
r = int(r0)
|
||||
w = int(r1)
|
||||
func pipe(p *[2]int32) (err error) {
|
||||
_, _, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), uintptr(unsafe.Pointer(p)), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
@ -2381,7 +2379,7 @@ func libc_lstat64_trampoline()
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||
func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||
_, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
|
6
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go
generated
vendored
6
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go
generated
vendored
@ -462,10 +462,8 @@ func libc_munlockall_trampoline()
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func pipe() (r int, w int, err error) {
|
||||
r0, r1, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), 0, 0, 0)
|
||||
r = int(r0)
|
||||
w = int(r1)
|
||||
func pipe(p *[2]int32) (err error) {
|
||||
_, _, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), uintptr(unsafe.Pointer(p)), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
|
8
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go
generated
vendored
8
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go
generated
vendored
@ -462,10 +462,8 @@ func libc_munlockall_trampoline()
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func pipe() (r int, w int, err error) {
|
||||
r0, r1, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), 0, 0, 0)
|
||||
r = int(r0)
|
||||
w = int(r1)
|
||||
func pipe(p *[2]int32) (err error) {
|
||||
_, _, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), uintptr(unsafe.Pointer(p)), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
@ -2381,7 +2379,7 @@ func libc_lstat_trampoline()
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||
func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||
_, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
|
15
vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go
generated
vendored
15
vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go
generated
vendored
@ -14,22 +14,19 @@ import (
|
||||
//go:cgo_import_dynamic libc_writev writev "libc.so"
|
||||
//go:cgo_import_dynamic libc_pwritev pwritev "libc.so"
|
||||
//go:cgo_import_dynamic libc_accept4 accept4 "libsocket.so"
|
||||
//go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so"
|
||||
|
||||
//go:linkname procreadv libc_readv
|
||||
//go:linkname procpreadv libc_preadv
|
||||
//go:linkname procwritev libc_writev
|
||||
//go:linkname procpwritev libc_pwritev
|
||||
//go:linkname procaccept4 libc_accept4
|
||||
//go:linkname procpipe2 libc_pipe2
|
||||
|
||||
var (
|
||||
procreadv,
|
||||
procpreadv,
|
||||
procwritev,
|
||||
procpwritev,
|
||||
procaccept4,
|
||||
procpipe2 syscallFunc
|
||||
procaccept4 syscallFunc
|
||||
)
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
@ -102,13 +99,3 @@ func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int,
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func pipe2(p *[2]_C_int, flags int) (err error) {
|
||||
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procpipe2)), 2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0, 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
||||
|
13
vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
generated
vendored
13
vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
generated
vendored
@ -11,6 +11,7 @@ import (
|
||||
)
|
||||
|
||||
//go:cgo_import_dynamic libc_pipe pipe "libc.so"
|
||||
//go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so"
|
||||
//go:cgo_import_dynamic libc_getsockname getsockname "libsocket.so"
|
||||
//go:cgo_import_dynamic libc_getcwd getcwd "libc.so"
|
||||
//go:cgo_import_dynamic libc_getgroups getgroups "libc.so"
|
||||
@ -140,6 +141,7 @@ import (
|
||||
//go:cgo_import_dynamic libc_recvfrom recvfrom "libsocket.so"
|
||||
|
||||
//go:linkname procpipe libc_pipe
|
||||
//go:linkname procpipe2 libc_pipe2
|
||||
//go:linkname procgetsockname libc_getsockname
|
||||
//go:linkname procGetcwd libc_getcwd
|
||||
//go:linkname procgetgroups libc_getgroups
|
||||
@ -270,6 +272,7 @@ import (
|
||||
|
||||
var (
|
||||
procpipe,
|
||||
procpipe2,
|
||||
procgetsockname,
|
||||
procGetcwd,
|
||||
procgetgroups,
|
||||
@ -412,6 +415,16 @@ func pipe(p *[2]_C_int) (n int, err error) {
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func pipe2(p *[2]_C_int, flags int) (err error) {
|
||||
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procpipe2)), 2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0, 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
err = e1
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
|
||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockname)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
|
458
vendor/golang.org/x/sys/unix/ztypes_linux.go
generated
vendored
458
vendor/golang.org/x/sys/unix/ztypes_linux.go
generated
vendored
@ -3222,3 +3222,461 @@ const (
|
||||
MPLS_IPTUNNEL_TTL = 0x2
|
||||
MPLS_IPTUNNEL_MAX = 0x2
|
||||
)
|
||||
|
||||
const (
|
||||
ETHTOOL_ID_UNSPEC = 0x0
|
||||
ETHTOOL_RX_COPYBREAK = 0x1
|
||||
ETHTOOL_TX_COPYBREAK = 0x2
|
||||
ETHTOOL_PFC_PREVENTION_TOUT = 0x3
|
||||
ETHTOOL_TUNABLE_UNSPEC = 0x0
|
||||
ETHTOOL_TUNABLE_U8 = 0x1
|
||||
ETHTOOL_TUNABLE_U16 = 0x2
|
||||
ETHTOOL_TUNABLE_U32 = 0x3
|
||||
ETHTOOL_TUNABLE_U64 = 0x4
|
||||
ETHTOOL_TUNABLE_STRING = 0x5
|
||||
ETHTOOL_TUNABLE_S8 = 0x6
|
||||
ETHTOOL_TUNABLE_S16 = 0x7
|
||||
ETHTOOL_TUNABLE_S32 = 0x8
|
||||
ETHTOOL_TUNABLE_S64 = 0x9
|
||||
ETHTOOL_PHY_ID_UNSPEC = 0x0
|
||||
ETHTOOL_PHY_DOWNSHIFT = 0x1
|
||||
ETHTOOL_PHY_FAST_LINK_DOWN = 0x2
|
||||
ETHTOOL_PHY_EDPD = 0x3
|
||||
ETHTOOL_LINK_EXT_STATE_AUTONEG = 0x0
|
||||
ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE = 0x1
|
||||
ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH = 0x2
|
||||
ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY = 0x3
|
||||
ETHTOOL_LINK_EXT_STATE_NO_CABLE = 0x4
|
||||
ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE = 0x5
|
||||
ETHTOOL_LINK_EXT_STATE_EEPROM_ISSUE = 0x6
|
||||
ETHTOOL_LINK_EXT_STATE_CALIBRATION_FAILURE = 0x7
|
||||
ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED = 0x8
|
||||
ETHTOOL_LINK_EXT_STATE_OVERHEAT = 0x9
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED = 0x1
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_AN_ACK_NOT_RECEIVED = 0x2
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_AN_NEXT_PAGE_EXCHANGE_FAILED = 0x3
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED_FORCE_MODE = 0x4
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_AN_FEC_MISMATCH_DURING_OVERRIDE = 0x5
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_HCD = 0x6
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED = 0x1
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_INHIBIT_TIMEOUT = 0x2
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_LINK_PARTNER_DID_NOT_SET_RECEIVER_READY = 0x3
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_LT_REMOTE_FAULT = 0x4
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK = 0x1
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_AM_LOCK = 0x2
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_GET_ALIGN_STATUS = 0x3
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_LLM_FC_FEC_IS_NOT_LOCKED = 0x4
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_LLM_RS_FEC_IS_NOT_LOCKED = 0x5
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS = 0x1
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_BSI_UNSUPPORTED_RATE = 0x2
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE = 0x1
|
||||
ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE = 0x2
|
||||
ETHTOOL_FLASH_ALL_REGIONS = 0x0
|
||||
ETHTOOL_F_UNSUPPORTED__BIT = 0x0
|
||||
ETHTOOL_F_WISH__BIT = 0x1
|
||||
ETHTOOL_F_COMPAT__BIT = 0x2
|
||||
ETHTOOL_FEC_NONE_BIT = 0x0
|
||||
ETHTOOL_FEC_AUTO_BIT = 0x1
|
||||
ETHTOOL_FEC_OFF_BIT = 0x2
|
||||
ETHTOOL_FEC_RS_BIT = 0x3
|
||||
ETHTOOL_FEC_BASER_BIT = 0x4
|
||||
ETHTOOL_FEC_LLRS_BIT = 0x5
|
||||
ETHTOOL_LINK_MODE_10baseT_Half_BIT = 0x0
|
||||
ETHTOOL_LINK_MODE_10baseT_Full_BIT = 0x1
|
||||
ETHTOOL_LINK_MODE_100baseT_Half_BIT = 0x2
|
||||
ETHTOOL_LINK_MODE_100baseT_Full_BIT = 0x3
|
||||
ETHTOOL_LINK_MODE_1000baseT_Half_BIT = 0x4
|
||||
ETHTOOL_LINK_MODE_1000baseT_Full_BIT = 0x5
|
||||
ETHTOOL_LINK_MODE_Autoneg_BIT = 0x6
|
||||
ETHTOOL_LINK_MODE_TP_BIT = 0x7
|
||||
ETHTOOL_LINK_MODE_AUI_BIT = 0x8
|
||||
ETHTOOL_LINK_MODE_MII_BIT = 0x9
|
||||
ETHTOOL_LINK_MODE_FIBRE_BIT = 0xa
|
||||
ETHTOOL_LINK_MODE_BNC_BIT = 0xb
|
||||
ETHTOOL_LINK_MODE_10000baseT_Full_BIT = 0xc
|
||||
ETHTOOL_LINK_MODE_Pause_BIT = 0xd
|
||||
ETHTOOL_LINK_MODE_Asym_Pause_BIT = 0xe
|
||||
ETHTOOL_LINK_MODE_2500baseX_Full_BIT = 0xf
|
||||
ETHTOOL_LINK_MODE_Backplane_BIT = 0x10
|
||||
ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 0x11
|
||||
ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT = 0x12
|
||||
ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 0x13
|
||||
ETHTOOL_LINK_MODE_10000baseR_FEC_BIT = 0x14
|
||||
ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 0x15
|
||||
ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT = 0x16
|
||||
ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 0x17
|
||||
ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 0x18
|
||||
ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT = 0x19
|
||||
ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT = 0x1a
|
||||
ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT = 0x1b
|
||||
ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT = 0x1c
|
||||
ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 0x1d
|
||||
ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 0x1e
|
||||
ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 0x1f
|
||||
ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 0x20
|
||||
ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 0x21
|
||||
ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 0x22
|
||||
ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT = 0x23
|
||||
ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT = 0x24
|
||||
ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT = 0x25
|
||||
ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT = 0x26
|
||||
ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT = 0x27
|
||||
ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT = 0x28
|
||||
ETHTOOL_LINK_MODE_1000baseX_Full_BIT = 0x29
|
||||
ETHTOOL_LINK_MODE_10000baseCR_Full_BIT = 0x2a
|
||||
ETHTOOL_LINK_MODE_10000baseSR_Full_BIT = 0x2b
|
||||
ETHTOOL_LINK_MODE_10000baseLR_Full_BIT = 0x2c
|
||||
ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 0x2d
|
||||
ETHTOOL_LINK_MODE_10000baseER_Full_BIT = 0x2e
|
||||
ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 0x2f
|
||||
ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 0x30
|
||||
ETHTOOL_LINK_MODE_FEC_NONE_BIT = 0x31
|
||||
ETHTOOL_LINK_MODE_FEC_RS_BIT = 0x32
|
||||
ETHTOOL_LINK_MODE_FEC_BASER_BIT = 0x33
|
||||
ETHTOOL_LINK_MODE_50000baseKR_Full_BIT = 0x34
|
||||
ETHTOOL_LINK_MODE_50000baseSR_Full_BIT = 0x35
|
||||
ETHTOOL_LINK_MODE_50000baseCR_Full_BIT = 0x36
|
||||
ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT = 0x37
|
||||
ETHTOOL_LINK_MODE_50000baseDR_Full_BIT = 0x38
|
||||
ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT = 0x39
|
||||
ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT = 0x3a
|
||||
ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT = 0x3b
|
||||
ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT = 0x3c
|
||||
ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT = 0x3d
|
||||
ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT = 0x3e
|
||||
ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT = 0x3f
|
||||
ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 0x40
|
||||
ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT = 0x41
|
||||
ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT = 0x42
|
||||
ETHTOOL_LINK_MODE_100baseT1_Full_BIT = 0x43
|
||||
ETHTOOL_LINK_MODE_1000baseT1_Full_BIT = 0x44
|
||||
ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT = 0x45
|
||||
ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT = 0x46
|
||||
ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 0x47
|
||||
ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT = 0x48
|
||||
ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT = 0x49
|
||||
ETHTOOL_LINK_MODE_FEC_LLRS_BIT = 0x4a
|
||||
ETHTOOL_LINK_MODE_100000baseKR_Full_BIT = 0x4b
|
||||
ETHTOOL_LINK_MODE_100000baseSR_Full_BIT = 0x4c
|
||||
ETHTOOL_LINK_MODE_100000baseLR_ER_FR_Full_BIT = 0x4d
|
||||
ETHTOOL_LINK_MODE_100000baseCR_Full_BIT = 0x4e
|
||||
ETHTOOL_LINK_MODE_100000baseDR_Full_BIT = 0x4f
|
||||
ETHTOOL_LINK_MODE_200000baseKR2_Full_BIT = 0x50
|
||||
ETHTOOL_LINK_MODE_200000baseSR2_Full_BIT = 0x51
|
||||
ETHTOOL_LINK_MODE_200000baseLR2_ER2_FR2_Full_BIT = 0x52
|
||||
ETHTOOL_LINK_MODE_200000baseDR2_Full_BIT = 0x53
|
||||
ETHTOOL_LINK_MODE_200000baseCR2_Full_BIT = 0x54
|
||||
ETHTOOL_LINK_MODE_400000baseKR4_Full_BIT = 0x55
|
||||
ETHTOOL_LINK_MODE_400000baseSR4_Full_BIT = 0x56
|
||||
ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT = 0x57
|
||||
ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT = 0x58
|
||||
ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT = 0x59
|
||||
ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 0x5a
|
||||
ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 0x5b
|
||||
|
||||
ETHTOOL_MSG_USER_NONE = 0x0
|
||||
ETHTOOL_MSG_STRSET_GET = 0x1
|
||||
ETHTOOL_MSG_LINKINFO_GET = 0x2
|
||||
ETHTOOL_MSG_LINKINFO_SET = 0x3
|
||||
ETHTOOL_MSG_LINKMODES_GET = 0x4
|
||||
ETHTOOL_MSG_LINKMODES_SET = 0x5
|
||||
ETHTOOL_MSG_LINKSTATE_GET = 0x6
|
||||
ETHTOOL_MSG_DEBUG_GET = 0x7
|
||||
ETHTOOL_MSG_DEBUG_SET = 0x8
|
||||
ETHTOOL_MSG_WOL_GET = 0x9
|
||||
ETHTOOL_MSG_WOL_SET = 0xa
|
||||
ETHTOOL_MSG_FEATURES_GET = 0xb
|
||||
ETHTOOL_MSG_FEATURES_SET = 0xc
|
||||
ETHTOOL_MSG_PRIVFLAGS_GET = 0xd
|
||||
ETHTOOL_MSG_PRIVFLAGS_SET = 0xe
|
||||
ETHTOOL_MSG_RINGS_GET = 0xf
|
||||
ETHTOOL_MSG_RINGS_SET = 0x10
|
||||
ETHTOOL_MSG_CHANNELS_GET = 0x11
|
||||
ETHTOOL_MSG_CHANNELS_SET = 0x12
|
||||
ETHTOOL_MSG_COALESCE_GET = 0x13
|
||||
ETHTOOL_MSG_COALESCE_SET = 0x14
|
||||
ETHTOOL_MSG_PAUSE_GET = 0x15
|
||||
ETHTOOL_MSG_PAUSE_SET = 0x16
|
||||
ETHTOOL_MSG_EEE_GET = 0x17
|
||||
ETHTOOL_MSG_EEE_SET = 0x18
|
||||
ETHTOOL_MSG_TSINFO_GET = 0x19
|
||||
ETHTOOL_MSG_CABLE_TEST_ACT = 0x1a
|
||||
ETHTOOL_MSG_CABLE_TEST_TDR_ACT = 0x1b
|
||||
ETHTOOL_MSG_TUNNEL_INFO_GET = 0x1c
|
||||
ETHTOOL_MSG_USER_MAX = 0x1c
|
||||
ETHTOOL_MSG_KERNEL_NONE = 0x0
|
||||
ETHTOOL_MSG_STRSET_GET_REPLY = 0x1
|
||||
ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2
|
||||
ETHTOOL_MSG_LINKINFO_NTF = 0x3
|
||||
ETHTOOL_MSG_LINKMODES_GET_REPLY = 0x4
|
||||
ETHTOOL_MSG_LINKMODES_NTF = 0x5
|
||||
ETHTOOL_MSG_LINKSTATE_GET_REPLY = 0x6
|
||||
ETHTOOL_MSG_DEBUG_GET_REPLY = 0x7
|
||||
ETHTOOL_MSG_DEBUG_NTF = 0x8
|
||||
ETHTOOL_MSG_WOL_GET_REPLY = 0x9
|
||||
ETHTOOL_MSG_WOL_NTF = 0xa
|
||||
ETHTOOL_MSG_FEATURES_GET_REPLY = 0xb
|
||||
ETHTOOL_MSG_FEATURES_SET_REPLY = 0xc
|
||||
ETHTOOL_MSG_FEATURES_NTF = 0xd
|
||||
ETHTOOL_MSG_PRIVFLAGS_GET_REPLY = 0xe
|
||||
ETHTOOL_MSG_PRIVFLAGS_NTF = 0xf
|
||||
ETHTOOL_MSG_RINGS_GET_REPLY = 0x10
|
||||
ETHTOOL_MSG_RINGS_NTF = 0x11
|
||||
ETHTOOL_MSG_CHANNELS_GET_REPLY = 0x12
|
||||
ETHTOOL_MSG_CHANNELS_NTF = 0x13
|
||||
ETHTOOL_MSG_COALESCE_GET_REPLY = 0x14
|
||||
ETHTOOL_MSG_COALESCE_NTF = 0x15
|
||||
ETHTOOL_MSG_PAUSE_GET_REPLY = 0x16
|
||||
ETHTOOL_MSG_PAUSE_NTF = 0x17
|
||||
ETHTOOL_MSG_EEE_GET_REPLY = 0x18
|
||||
ETHTOOL_MSG_EEE_NTF = 0x19
|
||||
ETHTOOL_MSG_TSINFO_GET_REPLY = 0x1a
|
||||
ETHTOOL_MSG_CABLE_TEST_NTF = 0x1b
|
||||
ETHTOOL_MSG_CABLE_TEST_TDR_NTF = 0x1c
|
||||
ETHTOOL_MSG_TUNNEL_INFO_GET_REPLY = 0x1d
|
||||
ETHTOOL_MSG_KERNEL_MAX = 0x1d
|
||||
ETHTOOL_A_HEADER_UNSPEC = 0x0
|
||||
ETHTOOL_A_HEADER_DEV_INDEX = 0x1
|
||||
ETHTOOL_A_HEADER_DEV_NAME = 0x2
|
||||
ETHTOOL_A_HEADER_FLAGS = 0x3
|
||||
ETHTOOL_A_HEADER_MAX = 0x3
|
||||
ETHTOOL_A_BITSET_BIT_UNSPEC = 0x0
|
||||
ETHTOOL_A_BITSET_BIT_INDEX = 0x1
|
||||
ETHTOOL_A_BITSET_BIT_NAME = 0x2
|
||||
ETHTOOL_A_BITSET_BIT_VALUE = 0x3
|
||||
ETHTOOL_A_BITSET_BIT_MAX = 0x3
|
||||
ETHTOOL_A_BITSET_BITS_UNSPEC = 0x0
|
||||
ETHTOOL_A_BITSET_BITS_BIT = 0x1
|
||||
ETHTOOL_A_BITSET_BITS_MAX = 0x1
|
||||
ETHTOOL_A_BITSET_UNSPEC = 0x0
|
||||
ETHTOOL_A_BITSET_NOMASK = 0x1
|
||||
ETHTOOL_A_BITSET_SIZE = 0x2
|
||||
ETHTOOL_A_BITSET_BITS = 0x3
|
||||
ETHTOOL_A_BITSET_VALUE = 0x4
|
||||
ETHTOOL_A_BITSET_MASK = 0x5
|
||||
ETHTOOL_A_BITSET_MAX = 0x5
|
||||
ETHTOOL_A_STRING_UNSPEC = 0x0
|
||||
ETHTOOL_A_STRING_INDEX = 0x1
|
||||
ETHTOOL_A_STRING_VALUE = 0x2
|
||||
ETHTOOL_A_STRING_MAX = 0x2
|
||||
ETHTOOL_A_STRINGS_UNSPEC = 0x0
|
||||
ETHTOOL_A_STRINGS_STRING = 0x1
|
||||
ETHTOOL_A_STRINGS_MAX = 0x1
|
||||
ETHTOOL_A_STRINGSET_UNSPEC = 0x0
|
||||
ETHTOOL_A_STRINGSET_ID = 0x1
|
||||
ETHTOOL_A_STRINGSET_COUNT = 0x2
|
||||
ETHTOOL_A_STRINGSET_STRINGS = 0x3
|
||||
ETHTOOL_A_STRINGSET_MAX = 0x3
|
||||
ETHTOOL_A_STRINGSETS_UNSPEC = 0x0
|
||||
ETHTOOL_A_STRINGSETS_STRINGSET = 0x1
|
||||
ETHTOOL_A_STRINGSETS_MAX = 0x1
|
||||
ETHTOOL_A_STRSET_UNSPEC = 0x0
|
||||
ETHTOOL_A_STRSET_HEADER = 0x1
|
||||
ETHTOOL_A_STRSET_STRINGSETS = 0x2
|
||||
ETHTOOL_A_STRSET_COUNTS_ONLY = 0x3
|
||||
ETHTOOL_A_STRSET_MAX = 0x3
|
||||
ETHTOOL_A_LINKINFO_UNSPEC = 0x0
|
||||
ETHTOOL_A_LINKINFO_HEADER = 0x1
|
||||
ETHTOOL_A_LINKINFO_PORT = 0x2
|
||||
ETHTOOL_A_LINKINFO_PHYADDR = 0x3
|
||||
ETHTOOL_A_LINKINFO_TP_MDIX = 0x4
|
||||
ETHTOOL_A_LINKINFO_TP_MDIX_CTRL = 0x5
|
||||
ETHTOOL_A_LINKINFO_TRANSCEIVER = 0x6
|
||||
ETHTOOL_A_LINKINFO_MAX = 0x6
|
||||
ETHTOOL_A_LINKMODES_UNSPEC = 0x0
|
||||
ETHTOOL_A_LINKMODES_HEADER = 0x1
|
||||
ETHTOOL_A_LINKMODES_AUTONEG = 0x2
|
||||
ETHTOOL_A_LINKMODES_OURS = 0x3
|
||||
ETHTOOL_A_LINKMODES_PEER = 0x4
|
||||
ETHTOOL_A_LINKMODES_SPEED = 0x5
|
||||
ETHTOOL_A_LINKMODES_DUPLEX = 0x6
|
||||
ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG = 0x7
|
||||
ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE = 0x8
|
||||
ETHTOOL_A_LINKMODES_MAX = 0x8
|
||||
ETHTOOL_A_LINKSTATE_UNSPEC = 0x0
|
||||
ETHTOOL_A_LINKSTATE_HEADER = 0x1
|
||||
ETHTOOL_A_LINKSTATE_LINK = 0x2
|
||||
ETHTOOL_A_LINKSTATE_SQI = 0x3
|
||||
ETHTOOL_A_LINKSTATE_SQI_MAX = 0x4
|
||||
ETHTOOL_A_LINKSTATE_EXT_STATE = 0x5
|
||||
ETHTOOL_A_LINKSTATE_EXT_SUBSTATE = 0x6
|
||||
ETHTOOL_A_LINKSTATE_MAX = 0x6
|
||||
ETHTOOL_A_DEBUG_UNSPEC = 0x0
|
||||
ETHTOOL_A_DEBUG_HEADER = 0x1
|
||||
ETHTOOL_A_DEBUG_MSGMASK = 0x2
|
||||
ETHTOOL_A_DEBUG_MAX = 0x2
|
||||
ETHTOOL_A_WOL_UNSPEC = 0x0
|
||||
ETHTOOL_A_WOL_HEADER = 0x1
|
||||
ETHTOOL_A_WOL_MODES = 0x2
|
||||
ETHTOOL_A_WOL_SOPASS = 0x3
|
||||
ETHTOOL_A_WOL_MAX = 0x3
|
||||
ETHTOOL_A_FEATURES_UNSPEC = 0x0
|
||||
ETHTOOL_A_FEATURES_HEADER = 0x1
|
||||
ETHTOOL_A_FEATURES_HW = 0x2
|
||||
ETHTOOL_A_FEATURES_WANTED = 0x3
|
||||
ETHTOOL_A_FEATURES_ACTIVE = 0x4
|
||||
ETHTOOL_A_FEATURES_NOCHANGE = 0x5
|
||||
ETHTOOL_A_FEATURES_MAX = 0x5
|
||||
ETHTOOL_A_PRIVFLAGS_UNSPEC = 0x0
|
||||
ETHTOOL_A_PRIVFLAGS_HEADER = 0x1
|
||||
ETHTOOL_A_PRIVFLAGS_FLAGS = 0x2
|
||||
ETHTOOL_A_PRIVFLAGS_MAX = 0x2
|
||||
ETHTOOL_A_RINGS_UNSPEC = 0x0
|
||||
ETHTOOL_A_RINGS_HEADER = 0x1
|
||||
ETHTOOL_A_RINGS_RX_MAX = 0x2
|
||||
ETHTOOL_A_RINGS_RX_MINI_MAX = 0x3
|
||||
ETHTOOL_A_RINGS_RX_JUMBO_MAX = 0x4
|
||||
ETHTOOL_A_RINGS_TX_MAX = 0x5
|
||||
ETHTOOL_A_RINGS_RX = 0x6
|
||||
ETHTOOL_A_RINGS_RX_MINI = 0x7
|
||||
ETHTOOL_A_RINGS_RX_JUMBO = 0x8
|
||||
ETHTOOL_A_RINGS_TX = 0x9
|
||||
ETHTOOL_A_RINGS_MAX = 0x9
|
||||
ETHTOOL_A_CHANNELS_UNSPEC = 0x0
|
||||
ETHTOOL_A_CHANNELS_HEADER = 0x1
|
||||
ETHTOOL_A_CHANNELS_RX_MAX = 0x2
|
||||
ETHTOOL_A_CHANNELS_TX_MAX = 0x3
|
||||
ETHTOOL_A_CHANNELS_OTHER_MAX = 0x4
|
||||
ETHTOOL_A_CHANNELS_COMBINED_MAX = 0x5
|
||||
ETHTOOL_A_CHANNELS_RX_COUNT = 0x6
|
||||
ETHTOOL_A_CHANNELS_TX_COUNT = 0x7
|
||||
ETHTOOL_A_CHANNELS_OTHER_COUNT = 0x8
|
||||
ETHTOOL_A_CHANNELS_COMBINED_COUNT = 0x9
|
||||
ETHTOOL_A_CHANNELS_MAX = 0x9
|
||||
ETHTOOL_A_COALESCE_UNSPEC = 0x0
|
||||
ETHTOOL_A_COALESCE_HEADER = 0x1
|
||||
ETHTOOL_A_COALESCE_RX_USECS = 0x2
|
||||
ETHTOOL_A_COALESCE_RX_MAX_FRAMES = 0x3
|
||||
ETHTOOL_A_COALESCE_RX_USECS_IRQ = 0x4
|
||||
ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ = 0x5
|
||||
ETHTOOL_A_COALESCE_TX_USECS = 0x6
|
||||
ETHTOOL_A_COALESCE_TX_MAX_FRAMES = 0x7
|
||||
ETHTOOL_A_COALESCE_TX_USECS_IRQ = 0x8
|
||||
ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ = 0x9
|
||||
ETHTOOL_A_COALESCE_STATS_BLOCK_USECS = 0xa
|
||||
ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX = 0xb
|
||||
ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX = 0xc
|
||||
ETHTOOL_A_COALESCE_PKT_RATE_LOW = 0xd
|
||||
ETHTOOL_A_COALESCE_RX_USECS_LOW = 0xe
|
||||
ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW = 0xf
|
||||
ETHTOOL_A_COALESCE_TX_USECS_LOW = 0x10
|
||||
ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW = 0x11
|
||||
ETHTOOL_A_COALESCE_PKT_RATE_HIGH = 0x12
|
||||
ETHTOOL_A_COALESCE_RX_USECS_HIGH = 0x13
|
||||
ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH = 0x14
|
||||
ETHTOOL_A_COALESCE_TX_USECS_HIGH = 0x15
|
||||
ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH = 0x16
|
||||
ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL = 0x17
|
||||
ETHTOOL_A_COALESCE_MAX = 0x17
|
||||
ETHTOOL_A_PAUSE_UNSPEC = 0x0
|
||||
ETHTOOL_A_PAUSE_HEADER = 0x1
|
||||
ETHTOOL_A_PAUSE_AUTONEG = 0x2
|
||||
ETHTOOL_A_PAUSE_RX = 0x3
|
||||
ETHTOOL_A_PAUSE_TX = 0x4
|
||||
ETHTOOL_A_PAUSE_STATS = 0x5
|
||||
ETHTOOL_A_PAUSE_MAX = 0x5
|
||||
ETHTOOL_A_PAUSE_STAT_UNSPEC = 0x0
|
||||
ETHTOOL_A_PAUSE_STAT_PAD = 0x1
|
||||
ETHTOOL_A_PAUSE_STAT_TX_FRAMES = 0x2
|
||||
ETHTOOL_A_PAUSE_STAT_RX_FRAMES = 0x3
|
||||
ETHTOOL_A_PAUSE_STAT_MAX = 0x3
|
||||
ETHTOOL_A_EEE_UNSPEC = 0x0
|
||||
ETHTOOL_A_EEE_HEADER = 0x1
|
||||
ETHTOOL_A_EEE_MODES_OURS = 0x2
|
||||
ETHTOOL_A_EEE_MODES_PEER = 0x3
|
||||
ETHTOOL_A_EEE_ACTIVE = 0x4
|
||||
ETHTOOL_A_EEE_ENABLED = 0x5
|
||||
ETHTOOL_A_EEE_TX_LPI_ENABLED = 0x6
|
||||
ETHTOOL_A_EEE_TX_LPI_TIMER = 0x7
|
||||
ETHTOOL_A_EEE_MAX = 0x7
|
||||
ETHTOOL_A_TSINFO_UNSPEC = 0x0
|
||||
ETHTOOL_A_TSINFO_HEADER = 0x1
|
||||
ETHTOOL_A_TSINFO_TIMESTAMPING = 0x2
|
||||
ETHTOOL_A_TSINFO_TX_TYPES = 0x3
|
||||
ETHTOOL_A_TSINFO_RX_FILTERS = 0x4
|
||||
ETHTOOL_A_TSINFO_PHC_INDEX = 0x5
|
||||
ETHTOOL_A_TSINFO_MAX = 0x5
|
||||
ETHTOOL_A_CABLE_TEST_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_TEST_HEADER = 0x1
|
||||
ETHTOOL_A_CABLE_TEST_MAX = 0x1
|
||||
ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_RESULT_CODE_OK = 0x1
|
||||
ETHTOOL_A_CABLE_RESULT_CODE_OPEN = 0x2
|
||||
ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT = 0x3
|
||||
ETHTOOL_A_CABLE_RESULT_CODE_CROSS_SHORT = 0x4
|
||||
ETHTOOL_A_CABLE_PAIR_A = 0x0
|
||||
ETHTOOL_A_CABLE_PAIR_B = 0x1
|
||||
ETHTOOL_A_CABLE_PAIR_C = 0x2
|
||||
ETHTOOL_A_CABLE_PAIR_D = 0x3
|
||||
ETHTOOL_A_CABLE_RESULT_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_RESULT_PAIR = 0x1
|
||||
ETHTOOL_A_CABLE_RESULT_CODE = 0x2
|
||||
ETHTOOL_A_CABLE_RESULT_MAX = 0x2
|
||||
ETHTOOL_A_CABLE_FAULT_LENGTH_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_FAULT_LENGTH_PAIR = 0x1
|
||||
ETHTOOL_A_CABLE_FAULT_LENGTH_CM = 0x2
|
||||
ETHTOOL_A_CABLE_FAULT_LENGTH_MAX = 0x2
|
||||
ETHTOOL_A_CABLE_TEST_NTF_STATUS_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_TEST_NTF_STATUS_STARTED = 0x1
|
||||
ETHTOOL_A_CABLE_TEST_NTF_STATUS_COMPLETED = 0x2
|
||||
ETHTOOL_A_CABLE_NEST_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_NEST_RESULT = 0x1
|
||||
ETHTOOL_A_CABLE_NEST_FAULT_LENGTH = 0x2
|
||||
ETHTOOL_A_CABLE_NEST_MAX = 0x2
|
||||
ETHTOOL_A_CABLE_TEST_NTF_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_TEST_NTF_HEADER = 0x1
|
||||
ETHTOOL_A_CABLE_TEST_NTF_STATUS = 0x2
|
||||
ETHTOOL_A_CABLE_TEST_NTF_NEST = 0x3
|
||||
ETHTOOL_A_CABLE_TEST_NTF_MAX = 0x3
|
||||
ETHTOOL_A_CABLE_TEST_TDR_CFG_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_TEST_TDR_CFG_FIRST = 0x1
|
||||
ETHTOOL_A_CABLE_TEST_TDR_CFG_LAST = 0x2
|
||||
ETHTOOL_A_CABLE_TEST_TDR_CFG_STEP = 0x3
|
||||
ETHTOOL_A_CABLE_TEST_TDR_CFG_PAIR = 0x4
|
||||
ETHTOOL_A_CABLE_TEST_TDR_CFG_MAX = 0x4
|
||||
ETHTOOL_A_CABLE_TEST_TDR_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_TEST_TDR_HEADER = 0x1
|
||||
ETHTOOL_A_CABLE_TEST_TDR_CFG = 0x2
|
||||
ETHTOOL_A_CABLE_TEST_TDR_MAX = 0x2
|
||||
ETHTOOL_A_CABLE_AMPLITUDE_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_AMPLITUDE_PAIR = 0x1
|
||||
ETHTOOL_A_CABLE_AMPLITUDE_mV = 0x2
|
||||
ETHTOOL_A_CABLE_AMPLITUDE_MAX = 0x2
|
||||
ETHTOOL_A_CABLE_PULSE_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_PULSE_mV = 0x1
|
||||
ETHTOOL_A_CABLE_PULSE_MAX = 0x1
|
||||
ETHTOOL_A_CABLE_STEP_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_STEP_FIRST_DISTANCE = 0x1
|
||||
ETHTOOL_A_CABLE_STEP_LAST_DISTANCE = 0x2
|
||||
ETHTOOL_A_CABLE_STEP_STEP_DISTANCE = 0x3
|
||||
ETHTOOL_A_CABLE_STEP_MAX = 0x3
|
||||
ETHTOOL_A_CABLE_TDR_NEST_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_TDR_NEST_STEP = 0x1
|
||||
ETHTOOL_A_CABLE_TDR_NEST_AMPLITUDE = 0x2
|
||||
ETHTOOL_A_CABLE_TDR_NEST_PULSE = 0x3
|
||||
ETHTOOL_A_CABLE_TDR_NEST_MAX = 0x3
|
||||
ETHTOOL_A_CABLE_TEST_TDR_NTF_UNSPEC = 0x0
|
||||
ETHTOOL_A_CABLE_TEST_TDR_NTF_HEADER = 0x1
|
||||
ETHTOOL_A_CABLE_TEST_TDR_NTF_STATUS = 0x2
|
||||
ETHTOOL_A_CABLE_TEST_TDR_NTF_NEST = 0x3
|
||||
ETHTOOL_A_CABLE_TEST_TDR_NTF_MAX = 0x3
|
||||
ETHTOOL_UDP_TUNNEL_TYPE_VXLAN = 0x0
|
||||
ETHTOOL_UDP_TUNNEL_TYPE_GENEVE = 0x1
|
||||
ETHTOOL_UDP_TUNNEL_TYPE_VXLAN_GPE = 0x2
|
||||
ETHTOOL_A_TUNNEL_UDP_ENTRY_UNSPEC = 0x0
|
||||
ETHTOOL_A_TUNNEL_UDP_ENTRY_PORT = 0x1
|
||||
ETHTOOL_A_TUNNEL_UDP_ENTRY_TYPE = 0x2
|
||||
ETHTOOL_A_TUNNEL_UDP_ENTRY_MAX = 0x2
|
||||
ETHTOOL_A_TUNNEL_UDP_TABLE_UNSPEC = 0x0
|
||||
ETHTOOL_A_TUNNEL_UDP_TABLE_SIZE = 0x1
|
||||
ETHTOOL_A_TUNNEL_UDP_TABLE_TYPES = 0x2
|
||||
ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY = 0x3
|
||||
ETHTOOL_A_TUNNEL_UDP_TABLE_MAX = 0x3
|
||||
ETHTOOL_A_TUNNEL_UDP_UNSPEC = 0x0
|
||||
ETHTOOL_A_TUNNEL_UDP_TABLE = 0x1
|
||||
ETHTOOL_A_TUNNEL_UDP_MAX = 0x1
|
||||
ETHTOOL_A_TUNNEL_INFO_UNSPEC = 0x0
|
||||
ETHTOOL_A_TUNNEL_INFO_HEADER = 0x1
|
||||
ETHTOOL_A_TUNNEL_INFO_UDP_PORTS = 0x2
|
||||
ETHTOOL_A_TUNNEL_INFO_MAX = 0x2
|
||||
)
|
||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_386.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_386.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 linux/types.go | go run mkpost.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 /build/linux/types.go | go run mkpost.go
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build 386,linux
|
||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 linux/types.go | go run mkpost.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 /build/linux/types.go | go run mkpost.go
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build amd64,linux
|
||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build arm,linux
|
||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char linux/types.go | go run mkpost.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/linux/types.go | go run mkpost.go
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build arm64,linux
|
||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build mips,linux
|
||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build mips64,linux
|
||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build mips64le,linux
|
||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build mipsle,linux
|
||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build ppc64,linux
|
||||
|
2
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
|
||||
// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/linux/types.go | go run mkpost.go
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build ppc64le,linux
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user