From d71a0dbdd83cb564a525f2b1198c20f44f7c8bbd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 16:06:16 +0000 Subject: [PATCH] Bump github.com/netobserv/flowlogs-pipeline Bumps [github.com/netobserv/flowlogs-pipeline](https://github.com/netobserv/flowlogs-pipeline) from 1.11.0-community to 1.11.2-community. - [Release notes](https://github.com/netobserv/flowlogs-pipeline/releases) - [Commits](https://github.com/netobserv/flowlogs-pipeline/compare/v1.11.0-community...v1.11.2-community) --- updated-dependencies: - dependency-name: github.com/netobserv/flowlogs-pipeline dependency-version: 1.11.2-community dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 25 +- go.sum | 62 +- .../flowlogs-pipeline/pkg/api/ingest_ipfix.go | 23 +- .../flowlogs-pipeline/pkg/utils/kubernetes.go | 41 - vendor/github.com/netsampler/goflow2/LICENSE | 29 - .../goflow2/decoders/netflow/ipfix.go | 989 -------- .../goflow2/decoders/netflow/netflow.go | 537 ----- .../goflow2/decoders/netflow/nfv9.go | 317 --- .../goflow2/decoders/netflow/packet.go | 158 -- .../decoders/netflow/templates/templates.go | 139 -- .../goflow2/decoders/netflowlegacy/netflow.go | 90 - .../goflow2/decoders/netflowlegacy/packet.go | 96 - .../goflow2/decoders/sflow/datastructure.go | 103 - .../goflow2/decoders/sflow/packet.go | 73 - .../goflow2/decoders/sflow/sflow.go | 482 ---- .../goflow2/decoders/utils/utils.go | 128 -- .../netsampler/goflow2/pb/flow.pb.go | 924 -------- .../netsampler/goflow2/pb/flow.proto | 131 -- .../goflow2/producer/producer_nf.go | 683 ------ .../goflow2/producer/producer_nflegacy.go | 81 - .../goflow2/producer/producer_sf.go | 349 --- .../netsampler/goflow2/producer/reflect.go | 233 -- .../otel/attribute/internal/attribute.go | 12 +- .../go.opentelemetry.io/otel/attribute/set.go | 2 +- .../otel/attribute/value.go | 3 +- .../otel/semconv/v1.37.0/MIGRATION.md | 41 - .../otel/semconv/v1.37.0/README.md | 3 - .../otel/semconv/v1.39.0/MIGRATION.md | 78 + .../otel/semconv/v1.39.0/README.md | 3 + .../{v1.37.0 => v1.39.0}/attribute_group.go | 2002 +++++++++++++---- .../otel/semconv/{v1.37.0 => v1.39.0}/doc.go | 4 +- .../{v1.37.0 => v1.39.0}/error_type.go | 2 +- .../semconv/{v1.37.0 => v1.39.0}/exception.go | 2 +- .../semconv/{v1.37.0 => v1.39.0}/schema.go | 4 +- vendor/go.opentelemetry.io/otel/trace/auto.go | 2 +- .../net/http2/writesched_priority_rfc9218.go | 15 + vendor/golang.org/x/net/websocket/hybi.go | 1 + vendor/golang.org/x/sys/unix/ioctl_signed.go | 11 +- .../golang.org/x/sys/unix/ioctl_unsigned.go | 11 +- .../golang.org/x/sys/unix/syscall_solaris.go | 8 - vendor/golang.org/x/sys/unix/syscall_unix.go | 10 +- .../x/sys/windows/syscall_windows.go | 1 + .../golang.org/x/sys/windows/types_windows.go | 85 + .../x/sys/windows/zsyscall_windows.go | 7 + vendor/golang.org/x/term/terminal.go | 28 +- .../x/tools/go/packages/packages.go | 41 +- .../x/tools/go/types/typeutil/callee.go | 1 + .../x/tools/internal/event/core/export.go | 15 +- .../x/tools/internal/event/label/label.go | 12 +- .../x/tools/internal/stdlib/deps.go | 626 +++--- .../x/tools/internal/stdlib/manifest.go | 549 ++++- .../x/tools/internal/stdlib/stdlib.go | 2 +- .../internal/typesinternal/classify_call.go | 2 +- .../x/tools/internal/typesinternal/types.go | 4 +- .../x/tools/internal/versions/features.go | 1 + .../grpc/balancer/balancer.go | 2 - .../balancer/pickfirst/internal/internal.go | 2 + .../grpc/balancer/pickfirst/pickfirst.go | 57 +- .../grpc/balancer/subconn.go | 14 - .../grpc/balancer_wrapper.go | 6 +- vendor/google.golang.org/grpc/clientconn.go | 20 +- .../google.golang.org/grpc/credentials/tls.go | 6 +- .../grpc/encoding/encoding.go | 4 - .../grpc/experimental/stats/metrics.go | 69 +- vendor/google.golang.org/grpc/interceptor.go | 12 +- .../grpc/internal/balancer/weight/weight.go | 66 + .../grpc/internal/envconfig/envconfig.go | 6 + .../grpc/internal/experimental.go | 3 + .../grpc/internal/internal.go | 25 +- .../internal/resolver/dns/dns_resolver.go | 15 +- .../internal/stats/metrics_recorder_list.go | 60 + .../grpc/internal/transport/controlbuf.go | 24 +- .../grpc/internal/transport/http2_server.go | 94 +- .../grpc/internal/transport/transport.go | 27 +- .../google.golang.org/grpc/mem/buffer_pool.go | 2 +- vendor/google.golang.org/grpc/mem/buffers.go | 65 +- .../grpc/resolver/resolver.go | 1 + vendor/google.golang.org/grpc/server.go | 4 +- vendor/google.golang.org/grpc/stream.go | 14 +- vendor/google.golang.org/grpc/version.go | 2 +- vendor/modules.txt | 38 +- 81 files changed, 3176 insertions(+), 6743 deletions(-) delete mode 100644 vendor/github.com/netobserv/flowlogs-pipeline/pkg/utils/kubernetes.go delete mode 100644 vendor/github.com/netsampler/goflow2/LICENSE delete mode 100644 vendor/github.com/netsampler/goflow2/decoders/netflow/ipfix.go delete mode 100644 vendor/github.com/netsampler/goflow2/decoders/netflow/netflow.go delete mode 100644 vendor/github.com/netsampler/goflow2/decoders/netflow/nfv9.go delete mode 100644 vendor/github.com/netsampler/goflow2/decoders/netflow/packet.go delete mode 100644 vendor/github.com/netsampler/goflow2/decoders/netflow/templates/templates.go delete mode 100644 vendor/github.com/netsampler/goflow2/decoders/netflowlegacy/netflow.go delete mode 100644 vendor/github.com/netsampler/goflow2/decoders/netflowlegacy/packet.go delete mode 100644 vendor/github.com/netsampler/goflow2/decoders/sflow/datastructure.go delete mode 100644 vendor/github.com/netsampler/goflow2/decoders/sflow/packet.go delete mode 100644 vendor/github.com/netsampler/goflow2/decoders/sflow/sflow.go delete mode 100644 vendor/github.com/netsampler/goflow2/decoders/utils/utils.go delete mode 100644 vendor/github.com/netsampler/goflow2/pb/flow.pb.go delete mode 100644 vendor/github.com/netsampler/goflow2/pb/flow.proto delete mode 100644 vendor/github.com/netsampler/goflow2/producer/producer_nf.go delete mode 100644 vendor/github.com/netsampler/goflow2/producer/producer_nflegacy.go delete mode 100644 vendor/github.com/netsampler/goflow2/producer/producer_sf.go delete mode 100644 vendor/github.com/netsampler/goflow2/producer/reflect.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.37.0/MIGRATION.md delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.37.0/README.md create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.39.0/MIGRATION.md create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.39.0/README.md rename vendor/go.opentelemetry.io/otel/semconv/{v1.37.0 => v1.39.0}/attribute_group.go (90%) rename vendor/go.opentelemetry.io/otel/semconv/{v1.37.0 => v1.39.0}/doc.go (96%) rename vendor/go.opentelemetry.io/otel/semconv/{v1.37.0 => v1.39.0}/error_type.go (99%) rename vendor/go.opentelemetry.io/otel/semconv/{v1.37.0 => v1.39.0}/exception.go (98%) rename vendor/go.opentelemetry.io/otel/semconv/{v1.37.0 => v1.39.0}/schema.go (85%) create mode 100644 vendor/google.golang.org/grpc/internal/balancer/weight/weight.go diff --git a/go.mod b/go.mod index 5d28d86f..487efd68 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require ( github.com/jpillora/sizestr v1.0.0 github.com/mattn/go-sqlite3 v1.14.33 github.com/navidys/tvxwidgets v0.11.1 - github.com/netobserv/flowlogs-pipeline v1.11.0-community - github.com/netobserv/netobserv-ebpf-agent v1.10.1-community + github.com/netobserv/flowlogs-pipeline v1.11.2-community + github.com/netobserv/netobserv-ebpf-agent v1.11.1-community github.com/onsi/ginkgo/v2 v2.27.3 github.com/onsi/gomega v1.38.2 github.com/sirupsen/logrus v1.9.4 @@ -54,7 +54,6 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect - github.com/netsampler/goflow2 v1.3.7 // indirect github.com/ovn-org/ovn-kubernetes/go-controller v0.0.0-20250227173154-57a2590a1d16 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.23.2 @@ -70,21 +69,21 @@ require ( github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect - go.opentelemetry.io/otel v1.39.0 // indirect - go.opentelemetry.io/otel/trace v1.39.0 // indirect + go.opentelemetry.io/otel v1.40.0 // indirect + go.opentelemetry.io/otel/trace v1.40.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/mod v0.30.0 // indirect - golang.org/x/net v0.48.0 // indirect + golang.org/x/mod v0.31.0 // indirect + golang.org/x/net v0.49.0 // indirect golang.org/x/oauth2 v0.34.0 // indirect golang.org/x/sync v0.19.0 // indirect - golang.org/x/sys v0.40.0 // indirect - golang.org/x/term v0.38.0 // indirect - golang.org/x/text v0.32.0 // indirect + golang.org/x/sys v0.41.0 // indirect + golang.org/x/term v0.39.0 // indirect + golang.org/x/text v0.33.0 // indirect golang.org/x/time v0.11.0 // indirect - golang.org/x/tools v0.39.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect - google.golang.org/grpc v1.78.0 // indirect + golang.org/x/tools v0.40.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 // indirect + google.golang.org/grpc v1.79.1 // indirect google.golang.org/protobuf v1.36.11 gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index 61d9dbde..37b94ee1 100644 --- a/go.sum +++ b/go.sum @@ -134,12 +134,10 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/navidys/tvxwidgets v0.11.1 h1:H/H3IdD1bxRoDt6yPl8/I2ZG+dGARMao7nK7kYnprxc= github.com/navidys/tvxwidgets v0.11.1/go.mod h1:3Pdk7b/8myzGTediDaeaG5i4Nv+ozVoPtorU3Ihcx9M= -github.com/netobserv/flowlogs-pipeline v1.11.0-community h1:SMdhbEM/OowhHO8lefnzztu83RkXOky+h0Q+kQV8PYg= -github.com/netobserv/flowlogs-pipeline v1.11.0-community/go.mod h1:GUltBJPGXTglxawEZhtGNp4kdOP5PqMU2oB5JQp6xv0= -github.com/netobserv/netobserv-ebpf-agent v1.10.1-community h1:9elSOcMkEQeztWH6w8eB3cRZUApaBvexZNQ/xExXXnA= -github.com/netobserv/netobserv-ebpf-agent v1.10.1-community/go.mod h1:l9igyOCKLjPGD49AOuMWPbwdUTPHqid1fvC8dSYzOR4= -github.com/netsampler/goflow2 v1.3.7 h1:XZaTy8kkMnGXpJ9hS3KbO1McyrFTpVNhVFEx9rNhMmc= -github.com/netsampler/goflow2 v1.3.7/go.mod h1:4UZsVGVAs//iMCptUHn3WNScztJeUhZH7kDW2+/vDdQ= +github.com/netobserv/flowlogs-pipeline v1.11.2-community h1:OdcKKyvfTWtoFIQk2tQEWlnfEuLdJTmskffM/RKmlMk= +github.com/netobserv/flowlogs-pipeline v1.11.2-community/go.mod h1:j6eOnbQBcUkWqmP20BNSUuQE/UQMEL146yYVHHtmECQ= +github.com/netobserv/netobserv-ebpf-agent v1.11.1-community h1:4PKt6ur4uLGsL5Fq7p/O2khEYdz+mteEr+KN2ZsgI80= +github.com/netobserv/netobserv-ebpf-agent v1.11.1-community/go.mod h1:J/GPFE2k/MKnL6yGqPoQpzfxXMM10MtfIS2uko3hA/Y= github.com/onsi/ginkgo/v2 v2.27.3 h1:ICsZJ8JoYafeXFFlFAG75a7CxMsJHwgKwtO+82SE9L8= github.com/onsi/ginkgo/v2 v2.27.3/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo= github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= @@ -229,16 +227,16 @@ github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBi github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= -go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= -go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= -go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= -go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= -go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= -go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= -go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= -go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= +go.opentelemetry.io/otel v1.40.0 h1:oA5YeOcpRTXq6NN7frwmwFR0Cn3RhTVZvXsP4duvCms= +go.opentelemetry.io/otel v1.40.0/go.mod h1:IMb+uXZUKkMXdPddhwAHm6UfOwJyh4ct1ybIlV14J0g= +go.opentelemetry.io/otel/metric v1.40.0 h1:rcZe317KPftE2rstWIBitCdVp89A2HqjkxR3c11+p9g= +go.opentelemetry.io/otel/metric v1.40.0/go.mod h1:ib/crwQH7N3r5kfiBZQbwrTge743UDc7DTFVZrrXnqc= +go.opentelemetry.io/otel/sdk v1.40.0 h1:KHW/jUzgo6wsPh9At46+h4upjtccTmuZCFAc9OJ71f8= +go.opentelemetry.io/otel/sdk v1.40.0/go.mod h1:Ph7EFdYvxq72Y8Li9q8KebuYUr2KoeyHx0DRMKrYBUE= +go.opentelemetry.io/otel/sdk/metric v1.40.0 h1:mtmdVqgQkeRxHgRv4qhyJduP3fYJRMX4AtAlbuWdCYw= +go.opentelemetry.io/otel/sdk/metric v1.40.0/go.mod h1:4Z2bGMf0KSK3uRjlczMOeMhKU2rhUqdWNoKcYrtcBPg= +go.opentelemetry.io/otel/trace v1.40.0 h1:WA4etStDttCSYuhwvEa8OP8I5EWu24lkOzp+ZYblVjw= +go.opentelemetry.io/otel/trace v1.40.0/go.mod h1:zeAhriXecNGP/s2SEG3+Y8X9ujcJOTqQ5RgdEJcawiA= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -253,14 +251,14 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk= -golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc= +golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI= +golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= -golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -274,36 +272,36 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q= -golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg= +golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY= +golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= -golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= +golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= +golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ= -golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ= +golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= +golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= -google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= -google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 h1:H86B94AW+VfJWDqFeEbBPhEtHzJwJfTbgE2lZa54ZAQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/grpc v1.79.1 h1:zGhSi45ODB9/p3VAawt9a+O/MULLl9dpizzNNpq7flY= +google.golang.org/grpc v1.79.1/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/netobserv/flowlogs-pipeline/pkg/api/ingest_ipfix.go b/vendor/github.com/netobserv/flowlogs-pipeline/pkg/api/ingest_ipfix.go index 6453c36d..a6ca2d08 100644 --- a/vendor/github.com/netobserv/flowlogs-pipeline/pkg/api/ingest_ipfix.go +++ b/vendor/github.com/netobserv/flowlogs-pipeline/pkg/api/ingest_ipfix.go @@ -19,17 +19,24 @@ package api import ( "fmt" - - "github.com/netsampler/goflow2/producer" ) type IngestIpfix struct { - HostName string `yaml:"hostName,omitempty" json:"hostName,omitempty" doc:"the hostname to listen on; defaults to 0.0.0.0"` - Port uint `yaml:"port,omitempty" json:"port,omitempty" doc:"the port number to listen on, for IPFIX/NetFlow v9. Omit or set to 0 to disable IPFIX/NetFlow v9 ingestion. If both port and portLegacy are omitted, defaults to 2055"` - PortLegacy uint `yaml:"portLegacy,omitempty" json:"portLegacy,omitempty" doc:"the port number to listen on, for legacy NetFlow v5. Omit or set to 0 to disable NetFlow v5 ingestion"` - Workers uint `yaml:"workers,omitempty" json:"workers,omitempty" doc:"the number of netflow/ipfix decoding workers"` - Sockets uint `yaml:"sockets,omitempty" json:"sockets,omitempty" doc:"the number of listening sockets"` - Mapping []producer.NetFlowMapField `yaml:"mapping,omitempty" json:"mapping,omitempty" doc:"custom field mapping"` + HostName string `yaml:"hostName,omitempty" json:"hostName,omitempty" doc:"the hostname to listen on; defaults to 0.0.0.0"` + Port uint `yaml:"port,omitempty" json:"port,omitempty" doc:"the port number to listen on, for IPFIX/NetFlow v9. Omit or set to 0 to disable IPFIX/NetFlow v9 ingestion. If both port and portLegacy are omitted, defaults to 2055"` + PortLegacy uint `yaml:"portLegacy,omitempty" json:"portLegacy,omitempty" doc:"the port number to listen on, for legacy NetFlow v5. Omit or set to 0 to disable NetFlow v5 ingestion"` + Workers uint `yaml:"workers,omitempty" json:"workers,omitempty" doc:"the number of netflow/ipfix decoding workers"` + Sockets uint `yaml:"sockets,omitempty" json:"sockets,omitempty" doc:"the number of listening sockets"` + Mapping []NetFlowMapField `yaml:"mapping,omitempty" json:"mapping,omitempty" doc:"custom field mapping"` +} + +// NetFlowMapField copied from github.com/netsampler/goflow2/producer (we don't want this hard dependency in api) +type NetFlowMapField struct { + PenProvided bool `json:"penprovided" yaml:"penprovided"` + Type uint16 `json:"field" yaml:"field"` + Pen uint32 `json:"pen" yaml:"pen"` + Destination string `json:"destination" yaml:"destination"` + Endian string `json:"endianness" yaml:"endianness"` } func (i *IngestIpfix) SetDefaults() { diff --git a/vendor/github.com/netobserv/flowlogs-pipeline/pkg/utils/kubernetes.go b/vendor/github.com/netobserv/flowlogs-pipeline/pkg/utils/kubernetes.go deleted file mode 100644 index 3503492e..00000000 --- a/vendor/github.com/netobserv/flowlogs-pipeline/pkg/utils/kubernetes.go +++ /dev/null @@ -1,41 +0,0 @@ -package utils - -import ( - "fmt" - "os" - "path" - - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" -) - -const ( - kubeConfigEnvVariable = "KUBECONFIG" -) - -func LoadK8sConfig(kubeConfigPath string) (*rest.Config, error) { - // if no config path is provided, load it from the env variable - if kubeConfigPath == "" { - kubeConfigPath = os.Getenv(kubeConfigEnvVariable) - } - // otherwise, load it from the $HOME/.kube/config file - if kubeConfigPath == "" { - homeDir, err := os.UserHomeDir() - if err != nil { - return nil, fmt.Errorf("can't get user home dir: %w", err) - } - kubeConfigPath = path.Join(homeDir, ".kube", "config") - } - config, err := clientcmd.BuildConfigFromFlags("", kubeConfigPath) - if err == nil { - return config, nil - } - // fallback: use in-cluster config - config, err = rest.InClusterConfig() - if err != nil { - return nil, fmt.Errorf("can't access kubenetes. Tried using config from: "+ - "config parameter, %s env, homedir and InClusterConfig. Got: %w", - kubeConfigEnvVariable, err) - } - return config, nil -} diff --git a/vendor/github.com/netsampler/goflow2/LICENSE b/vendor/github.com/netsampler/goflow2/LICENSE deleted file mode 100644 index a2fee077..00000000 --- a/vendor/github.com/netsampler/goflow2/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2021, NetSampler -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/netsampler/goflow2/decoders/netflow/ipfix.go b/vendor/github.com/netsampler/goflow2/decoders/netflow/ipfix.go deleted file mode 100644 index 954b7d38..00000000 --- a/vendor/github.com/netsampler/goflow2/decoders/netflow/ipfix.go +++ /dev/null @@ -1,989 +0,0 @@ -package netflow - -import ( - "fmt" - "time" -) - -const ( - IPFIX_FIELD_Reserved = 0 - IPFIX_FIELD_octetDeltaCount = 1 - IPFIX_FIELD_packetDeltaCount = 2 - IPFIX_FIELD_deltaFlowCount = 3 - IPFIX_FIELD_protocolIdentifier = 4 - IPFIX_FIELD_ipClassOfService = 5 - IPFIX_FIELD_tcpControlBits = 6 - IPFIX_FIELD_sourceTransportPort = 7 - IPFIX_FIELD_sourceIPv4Address = 8 - IPFIX_FIELD_sourceIPv4PrefixLength = 9 - IPFIX_FIELD_ingressInterface = 10 - IPFIX_FIELD_destinationTransportPort = 11 - IPFIX_FIELD_destinationIPv4Address = 12 - IPFIX_FIELD_destinationIPv4PrefixLength = 13 - IPFIX_FIELD_egressInterface = 14 - IPFIX_FIELD_ipNextHopIPv4Address = 15 - IPFIX_FIELD_bgpSourceAsNumber = 16 - IPFIX_FIELD_bgpDestinationAsNumber = 17 - IPFIX_FIELD_bgpNextHopIPv4Address = 18 - IPFIX_FIELD_postMCastPacketDeltaCount = 19 - IPFIX_FIELD_postMCastOctetDeltaCount = 20 - IPFIX_FIELD_flowEndSysUpTime = 21 - IPFIX_FIELD_flowStartSysUpTime = 22 - IPFIX_FIELD_postOctetDeltaCount = 23 - IPFIX_FIELD_postPacketDeltaCount = 24 - IPFIX_FIELD_minimumIpTotalLength = 25 - IPFIX_FIELD_maximumIpTotalLength = 26 - IPFIX_FIELD_sourceIPv6Address = 27 - IPFIX_FIELD_destinationIPv6Address = 28 - IPFIX_FIELD_sourceIPv6PrefixLength = 29 - IPFIX_FIELD_destinationIPv6PrefixLength = 30 - IPFIX_FIELD_flowLabelIPv6 = 31 - IPFIX_FIELD_icmpTypeCodeIPv4 = 32 - IPFIX_FIELD_igmpType = 33 - IPFIX_FIELD_samplingInterval = 34 - IPFIX_FIELD_samplingAlgorithm = 35 - IPFIX_FIELD_flowActiveTimeout = 36 - IPFIX_FIELD_flowIdleTimeout = 37 - IPFIX_FIELD_engineType = 38 - IPFIX_FIELD_engineId = 39 - IPFIX_FIELD_exportedOctetTotalCount = 40 - IPFIX_FIELD_exportedMessageTotalCount = 41 - IPFIX_FIELD_exportedFlowRecordTotalCount = 42 - IPFIX_FIELD_ipv4RouterSc = 43 - IPFIX_FIELD_sourceIPv4Prefix = 44 - IPFIX_FIELD_destinationIPv4Prefix = 45 - IPFIX_FIELD_mplsTopLabelType = 46 - IPFIX_FIELD_mplsTopLabelIPv4Address = 47 - IPFIX_FIELD_samplerId = 48 - IPFIX_FIELD_samplerMode = 49 - IPFIX_FIELD_samplerRandomInterval = 50 - IPFIX_FIELD_classId = 51 - IPFIX_FIELD_minimumTTL = 52 - IPFIX_FIELD_maximumTTL = 53 - IPFIX_FIELD_fragmentIdentification = 54 - IPFIX_FIELD_postIpClassOfService = 55 - IPFIX_FIELD_sourceMacAddress = 56 - IPFIX_FIELD_postDestinationMacAddress = 57 - IPFIX_FIELD_vlanId = 58 - IPFIX_FIELD_postVlanId = 59 - IPFIX_FIELD_ipVersion = 60 - IPFIX_FIELD_flowDirection = 61 - IPFIX_FIELD_ipNextHopIPv6Address = 62 - IPFIX_FIELD_bgpNextHopIPv6Address = 63 - IPFIX_FIELD_ipv6ExtensionHeaders = 64 - IPFIX_FIELD_mplsTopLabelStackSection = 70 - IPFIX_FIELD_mplsLabelStackSection2 = 71 - IPFIX_FIELD_mplsLabelStackSection3 = 72 - IPFIX_FIELD_mplsLabelStackSection4 = 73 - IPFIX_FIELD_mplsLabelStackSection5 = 74 - IPFIX_FIELD_mplsLabelStackSection6 = 75 - IPFIX_FIELD_mplsLabelStackSection7 = 76 - IPFIX_FIELD_mplsLabelStackSection8 = 77 - IPFIX_FIELD_mplsLabelStackSection9 = 78 - IPFIX_FIELD_mplsLabelStackSection10 = 79 - IPFIX_FIELD_destinationMacAddress = 80 - IPFIX_FIELD_postSourceMacAddress = 81 - IPFIX_FIELD_interfaceName = 82 - IPFIX_FIELD_interfaceDescription = 83 - IPFIX_FIELD_samplerName = 84 - IPFIX_FIELD_octetTotalCount = 85 - IPFIX_FIELD_packetTotalCount = 86 - IPFIX_FIELD_flagsAndSamplerId = 87 - IPFIX_FIELD_fragmentOffset = 88 - IPFIX_FIELD_forwardingStatus = 89 - IPFIX_FIELD_mplsVpnRouteDistinguisher = 90 - IPFIX_FIELD_mplsTopLabelPrefixLength = 91 - IPFIX_FIELD_srcTrafficIndex = 92 - IPFIX_FIELD_dstTrafficIndex = 93 - IPFIX_FIELD_applicationDescription = 94 - IPFIX_FIELD_applicationId = 95 - IPFIX_FIELD_applicationName = 96 - IPFIX_FIELD_postIpDiffServCodePoint = 98 - IPFIX_FIELD_multicastReplicationFactor = 99 - IPFIX_FIELD_className = 100 - IPFIX_FIELD_classificationEngineId = 101 - IPFIX_FIELD_layer2packetSectionOffset = 102 - IPFIX_FIELD_layer2packetSectionSize = 103 - IPFIX_FIELD_layer2packetSectionData = 104 - IPFIX_FIELD_bgpNextAdjacentAsNumber = 128 - IPFIX_FIELD_bgpPrevAdjacentAsNumber = 129 - IPFIX_FIELD_exporterIPv4Address = 130 - IPFIX_FIELD_exporterIPv6Address = 131 - IPFIX_FIELD_droppedOctetDeltaCount = 132 - IPFIX_FIELD_droppedPacketDeltaCount = 133 - IPFIX_FIELD_droppedOctetTotalCount = 134 - IPFIX_FIELD_droppedPacketTotalCount = 135 - IPFIX_FIELD_flowEndReason = 136 - IPFIX_FIELD_commonPropertiesId = 137 - IPFIX_FIELD_observationPointId = 138 - IPFIX_FIELD_icmpTypeCodeIPv6 = 139 - IPFIX_FIELD_mplsTopLabelIPv6Address = 140 - IPFIX_FIELD_lineCardId = 141 - IPFIX_FIELD_portId = 142 - IPFIX_FIELD_meteringProcessId = 143 - IPFIX_FIELD_exportingProcessId = 144 - IPFIX_FIELD_templateId = 145 - IPFIX_FIELD_wlanChannelId = 146 - IPFIX_FIELD_wlanSSID = 147 - IPFIX_FIELD_flowId = 148 - IPFIX_FIELD_observationDomainId = 149 - IPFIX_FIELD_flowStartSeconds = 150 - IPFIX_FIELD_flowEndSeconds = 151 - IPFIX_FIELD_flowStartMilliseconds = 152 - IPFIX_FIELD_flowEndMilliseconds = 153 - IPFIX_FIELD_flowStartMicroseconds = 154 - IPFIX_FIELD_flowEndMicroseconds = 155 - IPFIX_FIELD_flowStartNanoseconds = 156 - IPFIX_FIELD_flowEndNanoseconds = 157 - IPFIX_FIELD_flowStartDeltaMicroseconds = 158 - IPFIX_FIELD_flowEndDeltaMicroseconds = 159 - IPFIX_FIELD_systemInitTimeMilliseconds = 160 - IPFIX_FIELD_flowDurationMilliseconds = 161 - IPFIX_FIELD_flowDurationMicroseconds = 162 - IPFIX_FIELD_observedFlowTotalCount = 163 - IPFIX_FIELD_ignoredPacketTotalCount = 164 - IPFIX_FIELD_ignoredOctetTotalCount = 165 - IPFIX_FIELD_notSentFlowTotalCount = 166 - IPFIX_FIELD_notSentPacketTotalCount = 167 - IPFIX_FIELD_notSentOctetTotalCount = 168 - IPFIX_FIELD_destinationIPv6Prefix = 169 - IPFIX_FIELD_sourceIPv6Prefix = 170 - IPFIX_FIELD_postOctetTotalCount = 171 - IPFIX_FIELD_postPacketTotalCount = 172 - IPFIX_FIELD_flowKeyIndicator = 173 - IPFIX_FIELD_postMCastPacketTotalCount = 174 - IPFIX_FIELD_postMCastOctetTotalCount = 175 - IPFIX_FIELD_icmpTypeIPv4 = 176 - IPFIX_FIELD_icmpCodeIPv4 = 177 - IPFIX_FIELD_icmpTypeIPv6 = 178 - IPFIX_FIELD_icmpCodeIPv6 = 179 - IPFIX_FIELD_udpSourcePort = 180 - IPFIX_FIELD_udpDestinationPort = 181 - IPFIX_FIELD_tcpSourcePort = 182 - IPFIX_FIELD_tcpDestinationPort = 183 - IPFIX_FIELD_tcpSequenceNumber = 184 - IPFIX_FIELD_tcpAcknowledgementNumber = 185 - IPFIX_FIELD_tcpWindowSize = 186 - IPFIX_FIELD_tcpUrgentPointer = 187 - IPFIX_FIELD_tcpHeaderLength = 188 - IPFIX_FIELD_ipHeaderLength = 189 - IPFIX_FIELD_totalLengthIPv4 = 190 - IPFIX_FIELD_payloadLengthIPv6 = 191 - IPFIX_FIELD_ipTTL = 192 - IPFIX_FIELD_nextHeaderIPv6 = 193 - IPFIX_FIELD_mplsPayloadLength = 194 - IPFIX_FIELD_ipDiffServCodePoint = 195 - IPFIX_FIELD_ipPrecedence = 196 - IPFIX_FIELD_fragmentFlags = 197 - IPFIX_FIELD_octetDeltaSumOfSquares = 198 - IPFIX_FIELD_octetTotalSumOfSquares = 199 - IPFIX_FIELD_mplsTopLabelTTL = 200 - IPFIX_FIELD_mplsLabelStackLength = 201 - IPFIX_FIELD_mplsLabelStackDepth = 202 - IPFIX_FIELD_mplsTopLabelExp = 203 - IPFIX_FIELD_ipPayloadLength = 204 - IPFIX_FIELD_udpMessageLength = 205 - IPFIX_FIELD_isMulticast = 206 - IPFIX_FIELD_ipv4IHL = 207 - IPFIX_FIELD_ipv4Options = 208 - IPFIX_FIELD_tcpOptions = 209 - IPFIX_FIELD_paddingOctets = 210 - IPFIX_FIELD_collectorIPv4Address = 211 - IPFIX_FIELD_collectorIPv6Address = 212 - IPFIX_FIELD_exportInterface = 213 - IPFIX_FIELD_exportProtocolVersion = 214 - IPFIX_FIELD_exportTransportProtocol = 215 - IPFIX_FIELD_collectorTransportPort = 216 - IPFIX_FIELD_exporterTransportPort = 217 - IPFIX_FIELD_tcpSynTotalCount = 218 - IPFIX_FIELD_tcpFinTotalCount = 219 - IPFIX_FIELD_tcpRstTotalCount = 220 - IPFIX_FIELD_tcpPshTotalCount = 221 - IPFIX_FIELD_tcpAckTotalCount = 222 - IPFIX_FIELD_tcpUrgTotalCount = 223 - IPFIX_FIELD_ipTotalLength = 224 - IPFIX_FIELD_postNATSourceIPv4Address = 225 - IPFIX_FIELD_postNATDestinationIPv4Address = 226 - IPFIX_FIELD_postNAPTSourceTransportPort = 227 - IPFIX_FIELD_postNAPTDestinationTransportPort = 228 - IPFIX_FIELD_natOriginatingAddressRealm = 229 - IPFIX_FIELD_natEvent = 230 - IPFIX_FIELD_initiatorOctets = 231 - IPFIX_FIELD_responderOctets = 232 - IPFIX_FIELD_firewallEvent = 233 - IPFIX_FIELD_ingressVRFID = 234 - IPFIX_FIELD_egressVRFID = 235 - IPFIX_FIELD_VRFname = 236 - IPFIX_FIELD_postMplsTopLabelExp = 237 - IPFIX_FIELD_tcpWindowScale = 238 - IPFIX_FIELD_biflowDirection = 239 - IPFIX_FIELD_ethernetHeaderLength = 240 - IPFIX_FIELD_ethernetPayloadLength = 241 - IPFIX_FIELD_ethernetTotalLength = 242 - IPFIX_FIELD_dot1qVlanId = 243 - IPFIX_FIELD_dot1qPriority = 244 - IPFIX_FIELD_dot1qCustomerVlanId = 245 - IPFIX_FIELD_dot1qCustomerPriority = 246 - IPFIX_FIELD_metroEvcId = 247 - IPFIX_FIELD_metroEvcType = 248 - IPFIX_FIELD_pseudoWireId = 249 - IPFIX_FIELD_pseudoWireType = 250 - IPFIX_FIELD_pseudoWireControlWord = 251 - IPFIX_FIELD_ingressPhysicalInterface = 252 - IPFIX_FIELD_egressPhysicalInterface = 253 - IPFIX_FIELD_postDot1qVlanId = 254 - IPFIX_FIELD_postDot1qCustomerVlanId = 255 - IPFIX_FIELD_ethernetType = 256 - IPFIX_FIELD_postIpPrecedence = 257 - IPFIX_FIELD_collectionTimeMilliseconds = 258 - IPFIX_FIELD_exportSctpStreamId = 259 - IPFIX_FIELD_maxExportSeconds = 260 - IPFIX_FIELD_maxFlowEndSeconds = 261 - IPFIX_FIELD_messageMD5Checksum = 262 - IPFIX_FIELD_messageScope = 263 - IPFIX_FIELD_minExportSeconds = 264 - IPFIX_FIELD_minFlowStartSeconds = 265 - IPFIX_FIELD_opaqueOctets = 266 - IPFIX_FIELD_sessionScope = 267 - IPFIX_FIELD_maxFlowEndMicroseconds = 268 - IPFIX_FIELD_maxFlowEndMilliseconds = 269 - IPFIX_FIELD_maxFlowEndNanoseconds = 270 - IPFIX_FIELD_minFlowStartMicroseconds = 271 - IPFIX_FIELD_minFlowStartMilliseconds = 272 - IPFIX_FIELD_minFlowStartNanoseconds = 273 - IPFIX_FIELD_collectorCertificate = 274 - IPFIX_FIELD_exporterCertificate = 275 - IPFIX_FIELD_dataRecordsReliability = 276 - IPFIX_FIELD_observationPointType = 277 - IPFIX_FIELD_newConnectionDeltaCount = 278 - IPFIX_FIELD_connectionSumDurationSeconds = 279 - IPFIX_FIELD_connectionTransactionId = 280 - IPFIX_FIELD_postNATSourceIPv6Address = 281 - IPFIX_FIELD_postNATDestinationIPv6Address = 282 - IPFIX_FIELD_natPoolId = 283 - IPFIX_FIELD_natPoolName = 284 - IPFIX_FIELD_anonymizationFlags = 285 - IPFIX_FIELD_anonymizationTechnique = 286 - IPFIX_FIELD_informationElementIndex = 287 - IPFIX_FIELD_p2pTechnology = 288 - IPFIX_FIELD_tunnelTechnology = 289 - IPFIX_FIELD_encryptedTechnology = 290 - IPFIX_FIELD_basicList = 291 - IPFIX_FIELD_subTemplateList = 292 - IPFIX_FIELD_subTemplateMultiList = 293 - IPFIX_FIELD_bgpValidityState = 294 - IPFIX_FIELD_IPSecSPI = 295 - IPFIX_FIELD_greKey = 296 - IPFIX_FIELD_natType = 297 - IPFIX_FIELD_initiatorPackets = 298 - IPFIX_FIELD_responderPackets = 299 - IPFIX_FIELD_observationDomainName = 300 - IPFIX_FIELD_selectionSequenceId = 301 - IPFIX_FIELD_selectorId = 302 - IPFIX_FIELD_informationElementId = 303 - IPFIX_FIELD_selectorAlgorithm = 304 - IPFIX_FIELD_samplingPacketInterval = 305 - IPFIX_FIELD_samplingPacketSpace = 306 - IPFIX_FIELD_samplingTimeInterval = 307 - IPFIX_FIELD_samplingTimeSpace = 308 - IPFIX_FIELD_samplingSize = 309 - IPFIX_FIELD_samplingPopulation = 310 - IPFIX_FIELD_samplingProbability = 311 - IPFIX_FIELD_dataLinkFrameSize = 312 - IPFIX_FIELD_ipHeaderPacketSection = 313 - IPFIX_FIELD_ipPayloadPacketSection = 314 - IPFIX_FIELD_dataLinkFrameSection = 315 - IPFIX_FIELD_mplsLabelStackSection = 316 - IPFIX_FIELD_mplsPayloadPacketSection = 317 - IPFIX_FIELD_selectorIdTotalPktsObserved = 318 - IPFIX_FIELD_selectorIdTotalPktsSelected = 319 - IPFIX_FIELD_absoluteError = 320 - IPFIX_FIELD_relativeError = 321 - IPFIX_FIELD_observationTimeSeconds = 322 - IPFIX_FIELD_observationTimeMilliseconds = 323 - IPFIX_FIELD_observationTimeMicroseconds = 324 - IPFIX_FIELD_observationTimeNanoseconds = 325 - IPFIX_FIELD_digestHashValue = 326 - IPFIX_FIELD_hashIPPayloadOffset = 327 - IPFIX_FIELD_hashIPPayloadSize = 328 - IPFIX_FIELD_hashOutputRangeMin = 329 - IPFIX_FIELD_hashOutputRangeMax = 330 - IPFIX_FIELD_hashSelectedRangeMin = 331 - IPFIX_FIELD_hashSelectedRangeMax = 332 - IPFIX_FIELD_hashDigestOutput = 333 - IPFIX_FIELD_hashInitialiserValue = 334 - IPFIX_FIELD_selectorName = 335 - IPFIX_FIELD_upperCILimit = 336 - IPFIX_FIELD_lowerCILimit = 337 - IPFIX_FIELD_confidenceLevel = 338 - IPFIX_FIELD_informationElementDataType = 339 - IPFIX_FIELD_informationElementDescription = 340 - IPFIX_FIELD_informationElementName = 341 - IPFIX_FIELD_informationElementRangeBegin = 342 - IPFIX_FIELD_informationElementRangeEnd = 343 - IPFIX_FIELD_informationElementSemantics = 344 - IPFIX_FIELD_informationElementUnits = 345 - IPFIX_FIELD_privateEnterpriseNumber = 346 - IPFIX_FIELD_virtualStationInterfaceId = 347 - IPFIX_FIELD_virtualStationInterfaceName = 348 - IPFIX_FIELD_virtualStationUUID = 349 - IPFIX_FIELD_virtualStationName = 350 - IPFIX_FIELD_layer2SegmentId = 351 - IPFIX_FIELD_layer2OctetDeltaCount = 352 - IPFIX_FIELD_layer2OctetTotalCount = 353 - IPFIX_FIELD_ingressUnicastPacketTotalCount = 354 - IPFIX_FIELD_ingressMulticastPacketTotalCount = 355 - IPFIX_FIELD_ingressBroadcastPacketTotalCount = 356 - IPFIX_FIELD_egressUnicastPacketTotalCount = 357 - IPFIX_FIELD_egressBroadcastPacketTotalCount = 358 - IPFIX_FIELD_monitoringIntervalStartMilliSeconds = 359 - IPFIX_FIELD_monitoringIntervalEndMilliSeconds = 360 - IPFIX_FIELD_portRangeStart = 361 - IPFIX_FIELD_portRangeEnd = 362 - IPFIX_FIELD_portRangeStepSize = 363 - IPFIX_FIELD_portRangeNumPorts = 364 - IPFIX_FIELD_staMacAddress = 365 - IPFIX_FIELD_staIPv4Address = 366 - IPFIX_FIELD_wtpMacAddress = 367 - IPFIX_FIELD_ingressInterfaceType = 368 - IPFIX_FIELD_egressInterfaceType = 369 - IPFIX_FIELD_rtpSequenceNumber = 370 - IPFIX_FIELD_userName = 371 - IPFIX_FIELD_applicationCategoryName = 372 - IPFIX_FIELD_applicationSubCategoryName = 373 - IPFIX_FIELD_applicationGroupName = 374 - IPFIX_FIELD_originalFlowsPresent = 375 - IPFIX_FIELD_originalFlowsInitiated = 376 - IPFIX_FIELD_originalFlowsCompleted = 377 - IPFIX_FIELD_distinctCountOfSourceIPAddress = 378 - IPFIX_FIELD_distinctCountOfDestinationIPAddress = 379 - IPFIX_FIELD_distinctCountOfSourceIPv4Address = 380 - IPFIX_FIELD_distinctCountOfDestinationIPv4Address = 381 - IPFIX_FIELD_distinctCountOfSourceIPv6Address = 382 - IPFIX_FIELD_distinctCountOfDestinationIPv6Address = 383 - IPFIX_FIELD_valueDistributionMethod = 384 - IPFIX_FIELD_rfc3550JitterMilliseconds = 385 - IPFIX_FIELD_rfc3550JitterMicroseconds = 386 - IPFIX_FIELD_rfc3550JitterNanoseconds = 387 - IPFIX_FIELD_dot1qDEI = 388 - IPFIX_FIELD_dot1qCustomerDEI = 389 - IPFIX_FIELD_flowSelectorAlgorithm = 390 - IPFIX_FIELD_flowSelectedOctetDeltaCount = 391 - IPFIX_FIELD_flowSelectedPacketDeltaCount = 392 - IPFIX_FIELD_flowSelectedFlowDeltaCount = 393 - IPFIX_FIELD_selectorIDTotalFlowsObserved = 394 - IPFIX_FIELD_selectorIDTotalFlowsSelected = 395 - IPFIX_FIELD_samplingFlowInterval = 396 - IPFIX_FIELD_samplingFlowSpacing = 397 - IPFIX_FIELD_flowSamplingTimeInterval = 398 - IPFIX_FIELD_flowSamplingTimeSpacing = 399 - IPFIX_FIELD_hashFlowDomain = 400 - IPFIX_FIELD_transportOctetDeltaCount = 401 - IPFIX_FIELD_transportPacketDeltaCount = 402 - IPFIX_FIELD_originalExporterIPv4Address = 403 - IPFIX_FIELD_originalExporterIPv6Address = 404 - IPFIX_FIELD_originalObservationDomainId = 405 - IPFIX_FIELD_intermediateProcessId = 406 - IPFIX_FIELD_ignoredDataRecordTotalCount = 407 - IPFIX_FIELD_dataLinkFrameType = 408 - IPFIX_FIELD_sectionOffset = 409 - IPFIX_FIELD_sectionExportedOctets = 410 - IPFIX_FIELD_dot1qServiceInstanceTag = 411 - IPFIX_FIELD_dot1qServiceInstanceId = 412 - IPFIX_FIELD_dot1qServiceInstancePriority = 413 - IPFIX_FIELD_dot1qCustomerSourceMacAddress = 414 - IPFIX_FIELD_dot1qCustomerDestinationMacAddress = 415 - IPFIX_FIELD_postLayer2OctetDeltaCount = 417 - IPFIX_FIELD_postMCastLayer2OctetDeltaCount = 418 - IPFIX_FIELD_postLayer2OctetTotalCount = 420 - IPFIX_FIELD_postMCastLayer2OctetTotalCount = 421 - IPFIX_FIELD_minimumLayer2TotalLength = 422 - IPFIX_FIELD_maximumLayer2TotalLength = 423 - IPFIX_FIELD_droppedLayer2OctetDeltaCount = 424 - IPFIX_FIELD_droppedLayer2OctetTotalCount = 425 - IPFIX_FIELD_ignoredLayer2OctetTotalCount = 426 - IPFIX_FIELD_notSentLayer2OctetTotalCount = 427 - IPFIX_FIELD_layer2OctetDeltaSumOfSquares = 428 - IPFIX_FIELD_layer2OctetTotalSumOfSquares = 429 - IPFIX_FIELD_layer2FrameDeltaCount = 430 - IPFIX_FIELD_layer2FrameTotalCount = 431 - IPFIX_FIELD_pseudoWireDestinationIPv4Address = 432 - IPFIX_FIELD_ignoredLayer2FrameTotalCount = 433 - IPFIX_FIELD_mibObjectValueInteger = 434 - IPFIX_FIELD_mibObjectValueOctetString = 435 - IPFIX_FIELD_mibObjectValueOID = 436 - IPFIX_FIELD_mibObjectValueBits = 437 - IPFIX_FIELD_mibObjectValueIPAddress = 438 - IPFIX_FIELD_mibObjectValueCounter = 439 - IPFIX_FIELD_mibObjectValueGauge = 440 - IPFIX_FIELD_mibObjectValueTimeTicks = 441 - IPFIX_FIELD_mibObjectValueUnsigned = 442 - IPFIX_FIELD_mibObjectValueTable = 443 - IPFIX_FIELD_mibObjectValueRow = 444 - IPFIX_FIELD_mibObjectIdentifier = 445 - IPFIX_FIELD_mibSubIdentifier = 446 - IPFIX_FIELD_mibIndexIndicator = 447 - IPFIX_FIELD_mibCaptureTimeSemantics = 448 - IPFIX_FIELD_mibContextEngineID = 449 - IPFIX_FIELD_mibContextName = 450 - IPFIX_FIELD_mibObjectName = 451 - IPFIX_FIELD_mibObjectDescription = 452 - IPFIX_FIELD_mibObjectSyntax = 453 - IPFIX_FIELD_mibModuleName = 454 - IPFIX_FIELD_mobileIMSI = 455 - IPFIX_FIELD_mobileMSISDN = 456 - IPFIX_FIELD_httpStatusCode = 457 - IPFIX_FIELD_sourceTransportPortsLimit = 458 - IPFIX_FIELD_httpRequestMethod = 459 - IPFIX_FIELD_httpRequestHost = 460 - IPFIX_FIELD_httpRequestTarget = 461 - IPFIX_FIELD_httpMessageVersion = 462 - IPFIX_FIELD_natInstanceID = 463 - IPFIX_FIELD_internalAddressRealm = 464 - IPFIX_FIELD_externalAddressRealm = 465 - IPFIX_FIELD_natQuotaExceededEvent = 466 - IPFIX_FIELD_natThresholdEvent = 467 -) - -type IPFIXPacket struct { - Version uint16 - Length uint16 - ExportTime uint32 - SequenceNumber uint32 - ObservationDomainId uint32 - FlowSets []interface{} -} - -type IPFIXOptionsTemplateFlowSet struct { - FlowSetHeader - Records []IPFIXOptionsTemplateRecord -} - -type IPFIXOptionsTemplateRecord struct { - TemplateId uint16 - FieldCount uint16 - ScopeFieldCount uint16 - Options []Field - Scopes []Field -} - -func IPFIXTypeToString(typeId uint16) string { - - nameList := map[uint16]string{ - 0: "Reserved", - 1: "octetDeltaCount", - 2: "packetDeltaCount", - 3: "deltaFlowCount", - 4: "protocolIdentifier", - 5: "ipClassOfService", - 6: "tcpControlBits", - 7: "sourceTransportPort", - 8: "sourceIPv4Address", - 9: "sourceIPv4PrefixLength", - 10: "ingressInterface", - 11: "destinationTransportPort", - 12: "destinationIPv4Address", - 13: "destinationIPv4PrefixLength", - 14: "egressInterface", - 15: "ipNextHopIPv4Address", - 16: "bgpSourceAsNumber", - 17: "bgpDestinationAsNumber", - 18: "bgpNextHopIPv4Address", - 19: "postMCastPacketDeltaCount", - 20: "postMCastOctetDeltaCount", - 21: "flowEndSysUpTime", - 22: "flowStartSysUpTime", - 23: "postOctetDeltaCount", - 24: "postPacketDeltaCount", - 25: "minimumIpTotalLength", - 26: "maximumIpTotalLength", - 27: "sourceIPv6Address", - 28: "destinationIPv6Address", - 29: "sourceIPv6PrefixLength", - 30: "destinationIPv6PrefixLength", - 31: "flowLabelIPv6", - 32: "icmpTypeCodeIPv4", - 33: "igmpType", - 34: "samplingInterval", - 35: "samplingAlgorithm", - 36: "flowActiveTimeout", - 37: "flowIdleTimeout", - 38: "engineType", - 39: "engineId", - 40: "exportedOctetTotalCount", - 41: "exportedMessageTotalCount", - 42: "exportedFlowRecordTotalCount", - 43: "ipv4RouterSc", - 44: "sourceIPv4Prefix", - 45: "destinationIPv4Prefix", - 46: "mplsTopLabelType", - 47: "mplsTopLabelIPv4Address", - 48: "samplerId", - 49: "samplerMode", - 50: "samplerRandomInterval", - 51: "classId", - 52: "minimumTTL", - 53: "maximumTTL", - 54: "fragmentIdentification", - 55: "postIpClassOfService", - 56: "sourceMacAddress", - 57: "postDestinationMacAddress", - 58: "vlanId", - 59: "postVlanId", - 60: "ipVersion", - 61: "flowDirection", - 62: "ipNextHopIPv6Address", - 63: "bgpNextHopIPv6Address", - 64: "ipv6ExtensionHeaders", - 65: "Assigned for NetFlow v9 compatibility", - 66: "Assigned for NetFlow v9 compatibility", - 67: "Assigned for NetFlow v9 compatibility", - 68: "Assigned for NetFlow v9 compatibility", - 69: "Assigned for NetFlow v9 compatibility", - 70: "mplsTopLabelStackSection", - 71: "mplsLabelStackSection2", - 72: "mplsLabelStackSection3", - 73: "mplsLabelStackSection4", - 74: "mplsLabelStackSection5", - 75: "mplsLabelStackSection6", - 76: "mplsLabelStackSection7", - 77: "mplsLabelStackSection8", - 78: "mplsLabelStackSection9", - 79: "mplsLabelStackSection10", - 80: "destinationMacAddress", - 81: "postSourceMacAddress", - 82: "interfaceName", - 83: "interfaceDescription", - 84: "samplerName", - 85: "octetTotalCount", - 86: "packetTotalCount", - 87: "flagsAndSamplerId", - 88: "fragmentOffset", - 89: "forwardingStatus", - 90: "mplsVpnRouteDistinguisher", - 91: "mplsTopLabelPrefixLength", - 92: "srcTrafficIndex", - 93: "dstTrafficIndex", - 94: "applicationDescription", - 95: "applicationId", - 96: "applicationName", - 97: "Assigned for NetFlow v9 compatibility", - 98: "postIpDiffServCodePoint", - 99: "multicastReplicationFactor", - 100: "className", - 101: "classificationEngineId", - 102: "layer2packetSectionOffset", - 103: "layer2packetSectionSize", - 104: "layer2packetSectionData", - 128: "bgpNextAdjacentAsNumber", - 129: "bgpPrevAdjacentAsNumber", - 130: "exporterIPv4Address", - 131: "exporterIPv6Address", - 132: "droppedOctetDeltaCount", - 133: "droppedPacketDeltaCount", - 134: "droppedOctetTotalCount", - 135: "droppedPacketTotalCount", - 136: "flowEndReason", - 137: "commonPropertiesId", - 138: "observationPointId", - 139: "icmpTypeCodeIPv6", - 140: "mplsTopLabelIPv6Address", - 141: "lineCardId", - 142: "portId", - 143: "meteringProcessId", - 144: "exportingProcessId", - 145: "templateId", - 146: "wlanChannelId", - 147: "wlanSSID", - 148: "flowId", - 149: "observationDomainId", - 150: "flowStartSeconds", - 151: "flowEndSeconds", - 152: "flowStartMilliseconds", - 153: "flowEndMilliseconds", - 154: "flowStartMicroseconds", - 155: "flowEndMicroseconds", - 156: "flowStartNanoseconds", - 157: "flowEndNanoseconds", - 158: "flowStartDeltaMicroseconds", - 159: "flowEndDeltaMicroseconds", - 160: "systemInitTimeMilliseconds", - 161: "flowDurationMilliseconds", - 162: "flowDurationMicroseconds", - 163: "observedFlowTotalCount", - 164: "ignoredPacketTotalCount", - 165: "ignoredOctetTotalCount", - 166: "notSentFlowTotalCount", - 167: "notSentPacketTotalCount", - 168: "notSentOctetTotalCount", - 169: "destinationIPv6Prefix", - 170: "sourceIPv6Prefix", - 171: "postOctetTotalCount", - 172: "postPacketTotalCount", - 173: "flowKeyIndicator", - 174: "postMCastPacketTotalCount", - 175: "postMCastOctetTotalCount", - 176: "icmpTypeIPv4", - 177: "icmpCodeIPv4", - 178: "icmpTypeIPv6", - 179: "icmpCodeIPv6", - 180: "udpSourcePort", - 181: "udpDestinationPort", - 182: "tcpSourcePort", - 183: "tcpDestinationPort", - 184: "tcpSequenceNumber", - 185: "tcpAcknowledgementNumber", - 186: "tcpWindowSize", - 187: "tcpUrgentPointer", - 188: "tcpHeaderLength", - 189: "ipHeaderLength", - 190: "totalLengthIPv4", - 191: "payloadLengthIPv6", - 192: "ipTTL", - 193: "nextHeaderIPv6", - 194: "mplsPayloadLength", - 195: "ipDiffServCodePoint", - 196: "ipPrecedence", - 197: "fragmentFlags", - 198: "octetDeltaSumOfSquares", - 199: "octetTotalSumOfSquares", - 200: "mplsTopLabelTTL", - 201: "mplsLabelStackLength", - 202: "mplsLabelStackDepth", - 203: "mplsTopLabelExp", - 204: "ipPayloadLength", - 205: "udpMessageLength", - 206: "isMulticast", - 207: "ipv4IHL", - 208: "ipv4Options", - 209: "tcpOptions", - 210: "paddingOctets", - 211: "collectorIPv4Address", - 212: "collectorIPv6Address", - 213: "exportInterface", - 214: "exportProtocolVersion", - 215: "exportTransportProtocol", - 216: "collectorTransportPort", - 217: "exporterTransportPort", - 218: "tcpSynTotalCount", - 219: "tcpFinTotalCount", - 220: "tcpRstTotalCount", - 221: "tcpPshTotalCount", - 222: "tcpAckTotalCount", - 223: "tcpUrgTotalCount", - 224: "ipTotalLength", - 225: "postNATSourceIPv4Address", - 226: "postNATDestinationIPv4Address", - 227: "postNAPTSourceTransportPort", - 228: "postNAPTDestinationTransportPort", - 229: "natOriginatingAddressRealm", - 230: "natEvent", - 231: "initiatorOctets", - 232: "responderOctets", - 233: "firewallEvent", - 234: "ingressVRFID", - 235: "egressVRFID", - 236: "VRFname", - 237: "postMplsTopLabelExp", - 238: "tcpWindowScale", - 239: "biflowDirection", - 240: "ethernetHeaderLength", - 241: "ethernetPayloadLength", - 242: "ethernetTotalLength", - 243: "dot1qVlanId", - 244: "dot1qPriority", - 245: "dot1qCustomerVlanId", - 246: "dot1qCustomerPriority", - 247: "metroEvcId", - 248: "metroEvcType", - 249: "pseudoWireId", - 250: "pseudoWireType", - 251: "pseudoWireControlWord", - 252: "ingressPhysicalInterface", - 253: "egressPhysicalInterface", - 254: "postDot1qVlanId", - 255: "postDot1qCustomerVlanId", - 256: "ethernetType", - 257: "postIpPrecedence", - 258: "collectionTimeMilliseconds", - 259: "exportSctpStreamId", - 260: "maxExportSeconds", - 261: "maxFlowEndSeconds", - 262: "messageMD5Checksum", - 263: "messageScope", - 264: "minExportSeconds", - 265: "minFlowStartSeconds", - 266: "opaqueOctets", - 267: "sessionScope", - 268: "maxFlowEndMicroseconds", - 269: "maxFlowEndMilliseconds", - 270: "maxFlowEndNanoseconds", - 271: "minFlowStartMicroseconds", - 272: "minFlowStartMilliseconds", - 273: "minFlowStartNanoseconds", - 274: "collectorCertificate", - 275: "exporterCertificate", - 276: "dataRecordsReliability", - 277: "observationPointType", - 278: "newConnectionDeltaCount", - 279: "connectionSumDurationSeconds", - 280: "connectionTransactionId", - 281: "postNATSourceIPv6Address", - 282: "postNATDestinationIPv6Address", - 283: "natPoolId", - 284: "natPoolName", - 285: "anonymizationFlags", - 286: "anonymizationTechnique", - 287: "informationElementIndex", - 288: "p2pTechnology", - 289: "tunnelTechnology", - 290: "encryptedTechnology", - 291: "basicList", - 292: "subTemplateList", - 293: "subTemplateMultiList", - 294: "bgpValidityState", - 295: "IPSecSPI", - 296: "greKey", - 297: "natType", - 298: "initiatorPackets", - 299: "responderPackets", - 300: "observationDomainName", - 301: "selectionSequenceId", - 302: "selectorId", - 303: "informationElementId", - 304: "selectorAlgorithm", - 305: "samplingPacketInterval", - 306: "samplingPacketSpace", - 307: "samplingTimeInterval", - 308: "samplingTimeSpace", - 309: "samplingSize", - 310: "samplingPopulation", - 311: "samplingProbability", - 312: "dataLinkFrameSize", - 313: "ipHeaderPacketSection", - 314: "ipPayloadPacketSection", - 315: "dataLinkFrameSection", - 316: "mplsLabelStackSection", - 317: "mplsPayloadPacketSection", - 318: "selectorIdTotalPktsObserved", - 319: "selectorIdTotalPktsSelected", - 320: "absoluteError", - 321: "relativeError", - 322: "observationTimeSeconds", - 323: "observationTimeMilliseconds", - 324: "observationTimeMicroseconds", - 325: "observationTimeNanoseconds", - 326: "digestHashValue", - 327: "hashIPPayloadOffset", - 328: "hashIPPayloadSize", - 329: "hashOutputRangeMin", - 330: "hashOutputRangeMax", - 331: "hashSelectedRangeMin", - 332: "hashSelectedRangeMax", - 333: "hashDigestOutput", - 334: "hashInitialiserValue", - 335: "selectorName", - 336: "upperCILimit", - 337: "lowerCILimit", - 338: "confidenceLevel", - 339: "informationElementDataType", - 340: "informationElementDescription", - 341: "informationElementName", - 342: "informationElementRangeBegin", - 343: "informationElementRangeEnd", - 344: "informationElementSemantics", - 345: "informationElementUnits", - 346: "privateEnterpriseNumber", - 347: "virtualStationInterfaceId", - 348: "virtualStationInterfaceName", - 349: "virtualStationUUID", - 350: "virtualStationName", - 351: "layer2SegmentId", - 352: "layer2OctetDeltaCount", - 353: "layer2OctetTotalCount", - 354: "ingressUnicastPacketTotalCount", - 355: "ingressMulticastPacketTotalCount", - 356: "ingressBroadcastPacketTotalCount", - 357: "egressUnicastPacketTotalCount", - 358: "egressBroadcastPacketTotalCount", - 359: "monitoringIntervalStartMilliSeconds", - 360: "monitoringIntervalEndMilliSeconds", - 361: "portRangeStart", - 362: "portRangeEnd", - 363: "portRangeStepSize", - 364: "portRangeNumPorts", - 365: "staMacAddress", - 366: "staIPv4Address", - 367: "wtpMacAddress", - 368: "ingressInterfaceType", - 369: "egressInterfaceType", - 370: "rtpSequenceNumber", - 371: "userName", - 372: "applicationCategoryName", - 373: "applicationSubCategoryName", - 374: "applicationGroupName", - 375: "originalFlowsPresent", - 376: "originalFlowsInitiated", - 377: "originalFlowsCompleted", - 378: "distinctCountOfSourceIPAddress", - 379: "distinctCountOfDestinationIPAddress", - 380: "distinctCountOfSourceIPv4Address", - 381: "distinctCountOfDestinationIPv4Address", - 382: "distinctCountOfSourceIPv6Address", - 383: "distinctCountOfDestinationIPv6Address", - 384: "valueDistributionMethod", - 385: "rfc3550JitterMilliseconds", - 386: "rfc3550JitterMicroseconds", - 387: "rfc3550JitterNanoseconds", - 388: "dot1qDEI", - 389: "dot1qCustomerDEI", - 390: "flowSelectorAlgorithm", - 391: "flowSelectedOctetDeltaCount", - 392: "flowSelectedPacketDeltaCount", - 393: "flowSelectedFlowDeltaCount", - 394: "selectorIDTotalFlowsObserved", - 395: "selectorIDTotalFlowsSelected", - 396: "samplingFlowInterval", - 397: "samplingFlowSpacing", - 398: "flowSamplingTimeInterval", - 399: "flowSamplingTimeSpacing", - 400: "hashFlowDomain", - 401: "transportOctetDeltaCount", - 402: "transportPacketDeltaCount", - 403: "originalExporterIPv4Address", - 404: "originalExporterIPv6Address", - 405: "originalObservationDomainId", - 406: "intermediateProcessId", - 407: "ignoredDataRecordTotalCount", - 408: "dataLinkFrameType", - 409: "sectionOffset", - 410: "sectionExportedOctets", - 411: "dot1qServiceInstanceTag", - 412: "dot1qServiceInstanceId", - 413: "dot1qServiceInstancePriority", - 414: "dot1qCustomerSourceMacAddress", - 415: "dot1qCustomerDestinationMacAddress", - 416: "", - 417: "postLayer2OctetDeltaCount", - 418: "postMCastLayer2OctetDeltaCount", - 419: "", - 420: "postLayer2OctetTotalCount", - 421: "postMCastLayer2OctetTotalCount", - 422: "minimumLayer2TotalLength", - 423: "maximumLayer2TotalLength", - 424: "droppedLayer2OctetDeltaCount", - 425: "droppedLayer2OctetTotalCount", - 426: "ignoredLayer2OctetTotalCount", - 427: "notSentLayer2OctetTotalCount", - 428: "layer2OctetDeltaSumOfSquares", - 429: "layer2OctetTotalSumOfSquares", - 430: "layer2FrameDeltaCount", - 431: "layer2FrameTotalCount", - 432: "pseudoWireDestinationIPv4Address", - 433: "ignoredLayer2FrameTotalCount", - 434: "mibObjectValueInteger", - 435: "mibObjectValueOctetString", - 436: "mibObjectValueOID", - 437: "mibObjectValueBits", - 438: "mibObjectValueIPAddress", - 439: "mibObjectValueCounter", - 440: "mibObjectValueGauge", - 441: "mibObjectValueTimeTicks", - 442: "mibObjectValueUnsigned", - 443: "mibObjectValueTable", - 444: "mibObjectValueRow", - 445: "mibObjectIdentifier", - 446: "mibSubIdentifier", - 447: "mibIndexIndicator", - 448: "mibCaptureTimeSemantics", - 449: "mibContextEngineID", - 450: "mibContextName", - 451: "mibObjectName", - 452: "mibObjectDescription", - 453: "mibObjectSyntax", - 454: "mibModuleName", - 455: "mobileIMSI", - 456: "mobileMSISDN", - 457: "httpStatusCode", - 458: "sourceTransportPortsLimit", - 459: "httpRequestMethod", - 460: "httpRequestHost", - 461: "httpRequestTarget", - 462: "httpMessageVersion", - 463: "natInstanceID", - 464: "internalAddressRealm", - 465: "externalAddressRealm", - 466: "natQuotaExceededEvent", - 467: "natThresholdEvent", - } - - if typeId >= 105 && typeId <= 127 { - return "Assigned for NetFlow v9 compatibility" - } else if typeId >= 468 && typeId <= 32767 { - return "Unassigned" - } else { - return nameList[typeId] - } -} - -func (flowSet IPFIXOptionsTemplateFlowSet) String(TypeToString func(uint16) string) string { - str := fmt.Sprintf(" Id %v\n", flowSet.Id) - str += fmt.Sprintf(" Length: %v\n", flowSet.Length) - str += fmt.Sprintf(" Records (%v records):\n", len(flowSet.Records)) - - for j, record := range flowSet.Records { - str += fmt.Sprintf(" - Record %v:\n", j) - str += fmt.Sprintf(" TemplateId: %v\n", record.TemplateId) - str += fmt.Sprintf(" FieldCount: %v\n", record.FieldCount) - str += fmt.Sprintf(" ScopeFieldCount: %v\n", record.ScopeFieldCount) - - str += fmt.Sprintf(" Scopes (%v):\n", len(record.Scopes)) - - for k, field := range record.Scopes { - str += fmt.Sprintf(" - %v. %v (%v): %v\n", k, TypeToString(field.Type), field.Type, field.Length) - } - - str += fmt.Sprintf(" Options (%v):\n", len(record.Options)) - - for k, field := range record.Options { - str += fmt.Sprintf(" - %v. %v (%v): %v\n", k, TypeToString(field.Type), field.Type, field.Length) - } - - } - - return str -} - -func (p IPFIXPacket) String() string { - str := "Flow Packet\n" - str += "------------\n" - str += fmt.Sprintf(" Version: %v\n", p.Version) - str += fmt.Sprintf(" Length: %v\n", p.Length) - - exportTime := time.Unix(int64(p.ExportTime), 0) - str += fmt.Sprintf(" ExportTime: %v\n", exportTime.String()) - str += fmt.Sprintf(" SequenceNumber: %v\n", p.SequenceNumber) - str += fmt.Sprintf(" ObservationDomainId: %v\n", p.ObservationDomainId) - str += fmt.Sprintf(" FlowSets (%v):\n", len(p.FlowSets)) - - for i, flowSet := range p.FlowSets { - switch flowSet := flowSet.(type) { - case TemplateFlowSet: - str += fmt.Sprintf(" - TemplateFlowSet %v:\n", i) - str += flowSet.String(IPFIXTypeToString) - case IPFIXOptionsTemplateFlowSet: - str += fmt.Sprintf(" - OptionsTemplateFlowSet %v:\n", i) - str += flowSet.String(IPFIXTypeToString) - case DataFlowSet: - str += fmt.Sprintf(" - DataFlowSet %v:\n", i) - str += flowSet.String(IPFIXTypeToString) - case OptionsDataFlowSet: - str += fmt.Sprintf(" - OptionsDataFlowSet %v:\n", i) - str += flowSet.String(IPFIXTypeToString, IPFIXTypeToString) - default: - str += fmt.Sprintf(" - (unknown type) %v: %v\n", i, flowSet) - } - } - - return str -} diff --git a/vendor/github.com/netsampler/goflow2/decoders/netflow/netflow.go b/vendor/github.com/netsampler/goflow2/decoders/netflow/netflow.go deleted file mode 100644 index 8191b632..00000000 --- a/vendor/github.com/netsampler/goflow2/decoders/netflow/netflow.go +++ /dev/null @@ -1,537 +0,0 @@ -package netflow - -import ( - "bytes" - "context" - "encoding/binary" - "fmt" - "sync" - - "github.com/netsampler/goflow2/decoders/netflow/templates" - "github.com/netsampler/goflow2/decoders/utils" -) - -type FlowBaseTemplateSet map[uint16]map[uint32]map[uint16]interface{} - -type NetFlowTemplateSystem interface { - GetTemplate(version uint16, obsDomainId uint32, templateId uint16) (interface{}, error) - AddTemplate(version uint16, obsDomainId uint32, template interface{}) -} - -// Transition structure to ease the conversion with the new template systems -type TemplateWrapper struct { - Ctx context.Context - Key string - Inner templates.TemplateInterface -} - -func (w *TemplateWrapper) getTemplateId(template interface{}) (templateId uint16) { - switch templateIdConv := template.(type) { - case IPFIXOptionsTemplateRecord: - templateId = templateIdConv.TemplateId - case NFv9OptionsTemplateRecord: - templateId = templateIdConv.TemplateId - case TemplateRecord: - templateId = templateIdConv.TemplateId - } - return templateId -} - -func (w TemplateWrapper) GetTemplate(version uint16, obsDomainId uint32, templateId uint16) (interface{}, error) { - return w.Inner.GetTemplate(w.Ctx, &templates.TemplateKey{w.Key, version, obsDomainId, templateId}) -} - -func (w TemplateWrapper) AddTemplate(version uint16, obsDomainId uint32, template interface{}) { - w.Inner.AddTemplate(w.Ctx, &templates.TemplateKey{w.Key, version, obsDomainId, w.getTemplateId(template)}, template) -} - -func DecodeNFv9OptionsTemplateSet(payload *bytes.Buffer) ([]NFv9OptionsTemplateRecord, error) { - var records []NFv9OptionsTemplateRecord - var err error - for payload.Len() >= 4 { - optsTemplateRecord := NFv9OptionsTemplateRecord{} - err = utils.BinaryDecoder(payload, &optsTemplateRecord.TemplateId, &optsTemplateRecord.ScopeLength, &optsTemplateRecord.OptionLength) - if err != nil { - return records, err - } - - sizeScope := int(optsTemplateRecord.ScopeLength) / 4 - sizeOptions := int(optsTemplateRecord.OptionLength) / 4 - if sizeScope < 0 || sizeOptions < 0 { - return records, fmt.Errorf("Error decoding OptionsTemplateSet: negative length.") - } - - fields := make([]Field, sizeScope) - for i := 0; i < sizeScope; i++ { - field := Field{} - if err := DecodeField(payload, &field, false); err != nil { - return records, err - } - fields[i] = field - } - optsTemplateRecord.Scopes = fields - - fields = make([]Field, sizeOptions) - for i := 0; i < sizeOptions; i++ { - field := Field{} - if err := DecodeField(payload, &field, false); err != nil { - return records, err - } - fields[i] = field - } - optsTemplateRecord.Options = fields - - records = append(records, optsTemplateRecord) - } - - return records, err -} - -func DecodeField(payload *bytes.Buffer, field *Field, pen bool) error { - err := utils.BinaryDecoder(payload, &field.Type, &field.Length) - if pen && err == nil && field.Type&0x8000 != 0 { - field.PenProvided = true - err = utils.BinaryDecoder(payload, &field.Pen) - } - return err -} - -func DecodeIPFIXOptionsTemplateSet(payload *bytes.Buffer) ([]IPFIXOptionsTemplateRecord, error) { - var records []IPFIXOptionsTemplateRecord - var err error - for payload.Len() >= 4 { - optsTemplateRecord := IPFIXOptionsTemplateRecord{} - err = utils.BinaryDecoder(payload, &optsTemplateRecord.TemplateId, &optsTemplateRecord.FieldCount, &optsTemplateRecord.ScopeFieldCount) - if err != nil { - return records, err - } - - fields := make([]Field, int(optsTemplateRecord.ScopeFieldCount)) - for i := 0; i < int(optsTemplateRecord.ScopeFieldCount); i++ { - field := Field{} - if err := DecodeField(payload, &field, true); err != nil { - return records, err - } - fields[i] = field - } - optsTemplateRecord.Scopes = fields - - optionsSize := int(optsTemplateRecord.FieldCount) - int(optsTemplateRecord.ScopeFieldCount) - if optionsSize < 0 { - return records, fmt.Errorf("Error decoding OptionsTemplateSet: negative length.") - } - fields = make([]Field, optionsSize) - for i := 0; i < optionsSize; i++ { - field := Field{} - if err := DecodeField(payload, &field, true); err != nil { - return records, err - } - fields[i] = field - } - optsTemplateRecord.Options = fields - - records = append(records, optsTemplateRecord) - } - - return records, nil -} - -func DecodeTemplateSet(version uint16, payload *bytes.Buffer) ([]TemplateRecord, error) { - var records []TemplateRecord - var err error - for payload.Len() >= 4 { - templateRecord := TemplateRecord{} - err = utils.BinaryDecoder(payload, &templateRecord.TemplateId, &templateRecord.FieldCount) - if err != nil { - return records, err - } - - if int(templateRecord.FieldCount) < 0 { - return records, fmt.Errorf("Error decoding TemplateSet: zero count.") - } - - fields := make([]Field, int(templateRecord.FieldCount)) - for i := 0; i < int(templateRecord.FieldCount); i++ { - field := Field{} - err := utils.BinaryDecoder(payload, &field.Type, &field.Length) - if err == nil && version == 10 && field.Type&0x8000 != 0 { - field.PenProvided = true - field.Type = field.Type ^ 0x8000 - err = utils.BinaryDecoder(payload, &field.Pen) - } - if err != nil { - return records, err - } - fields[i] = field - } - templateRecord.Fields = fields - records = append(records, templateRecord) - } - - return records, nil -} - -func GetTemplateSize(version uint16, template []Field) int { - sum := 0 - for _, templateField := range template { - if templateField.Length == 0xffff { - continue - } - - sum += int(templateField.Length) - } - return sum -} - -func DecodeDataSetUsingFields(version uint16, payload *bytes.Buffer, listFields []Field) []DataField { - for payload.Len() >= GetTemplateSize(version, listFields) { - - dataFields := make([]DataField, len(listFields)) - for i, templateField := range listFields { - - finalLength := int(templateField.Length) - if templateField.Length == 0xffff { - var variableLen8 byte - var variableLen16 uint16 - err := utils.BinaryDecoder(payload, &variableLen8) - if err != nil { - return []DataField{} - } - if variableLen8 == 0xff { - err := utils.BinaryDecoder(payload, &variableLen16) - if err != nil { - return []DataField{} - } - finalLength = int(variableLen16) - } else { - finalLength = int(variableLen8) - } - } - - value := payload.Next(finalLength) - nfvalue := DataField{ - Type: templateField.Type, - PenProvided: templateField.PenProvided, - Pen: templateField.Pen, - Value: value, - } - dataFields[i] = nfvalue - } - return dataFields - } - return []DataField{} -} - -type ErrorTemplateNotFound struct { - version uint16 - obsDomainId uint32 - templateId uint16 - typeTemplate string -} - -func NewErrorTemplateNotFound(version uint16, obsDomainId uint32, templateId uint16, typeTemplate string) *ErrorTemplateNotFound { - return &ErrorTemplateNotFound{ - version: version, - obsDomainId: obsDomainId, - templateId: templateId, - typeTemplate: typeTemplate, - } -} - -func (e *ErrorTemplateNotFound) Error() string { - return fmt.Sprintf("No %v template %v found for and domain id %v", e.typeTemplate, e.templateId, e.obsDomainId) -} - -func DecodeOptionsDataSet(version uint16, payload *bytes.Buffer, listFieldsScopes, listFieldsOption []Field) ([]OptionsDataRecord, error) { - var records []OptionsDataRecord - - listFieldsScopesSize := GetTemplateSize(version, listFieldsScopes) - listFieldsOptionSize := GetTemplateSize(version, listFieldsOption) - - for payload.Len() >= listFieldsScopesSize+listFieldsOptionSize { - scopeValues := DecodeDataSetUsingFields(version, payload, listFieldsScopes) - optionValues := DecodeDataSetUsingFields(version, payload, listFieldsOption) - - record := OptionsDataRecord{ - ScopesValues: scopeValues, - OptionsValues: optionValues, - } - - records = append(records, record) - } - return records, nil -} - -func DecodeDataSet(version uint16, payload *bytes.Buffer, listFields []Field) ([]DataRecord, error) { - var records []DataRecord - - listFieldsSize := GetTemplateSize(version, listFields) - for payload.Len() >= listFieldsSize { - values := DecodeDataSetUsingFields(version, payload, listFields) - - record := DataRecord{ - Values: values, - } - - records = append(records, record) - } - return records, nil -} - -func (ts *BasicTemplateSystem) GetTemplates() map[uint16]map[uint32]map[uint16]interface{} { - ts.templateslock.RLock() - tmp := ts.templates - ts.templateslock.RUnlock() - return tmp -} - -func (ts *BasicTemplateSystem) AddTemplate(version uint16, obsDomainId uint32, template interface{}) { - ts.templateslock.Lock() - defer ts.templateslock.Unlock() - _, exists := ts.templates[version] - if exists != true { - ts.templates[version] = make(map[uint32]map[uint16]interface{}) - } - _, exists = ts.templates[version][obsDomainId] - if exists != true { - ts.templates[version][obsDomainId] = make(map[uint16]interface{}) - } - var templateId uint16 - switch templateIdConv := template.(type) { - case IPFIXOptionsTemplateRecord: - templateId = templateIdConv.TemplateId - case NFv9OptionsTemplateRecord: - templateId = templateIdConv.TemplateId - case TemplateRecord: - templateId = templateIdConv.TemplateId - } - ts.templates[version][obsDomainId][templateId] = template -} - -func (ts *BasicTemplateSystem) GetTemplate(version uint16, obsDomainId uint32, templateId uint16) (interface{}, error) { - ts.templateslock.RLock() - defer ts.templateslock.RUnlock() - templatesVersion, okver := ts.templates[version] - if okver { - templatesObsDom, okobs := templatesVersion[obsDomainId] - if okobs { - template, okid := templatesObsDom[templateId] - if okid { - return template, nil - } - } - } - return nil, NewErrorTemplateNotFound(version, obsDomainId, templateId, "info") -} - -type BasicTemplateSystem struct { - templates FlowBaseTemplateSet - templateslock *sync.RWMutex -} - -func CreateTemplateSystem() *BasicTemplateSystem { - ts := &BasicTemplateSystem{ - templates: make(FlowBaseTemplateSet), - templateslock: &sync.RWMutex{}, - } - return ts -} - -func DecodeMessage(payload *bytes.Buffer, templates NetFlowTemplateSystem) (interface{}, error) { - return DecodeMessageContext(context.Background(), payload, "", templates) -} - -func DecodeMessageContext(ctx context.Context, payload *bytes.Buffer, templateKey string, tpli NetFlowTemplateSystem) (interface{}, error) { - var size uint16 - packetNFv9 := NFv9Packet{} - packetIPFIX := IPFIXPacket{} - var returnItem interface{} - - var version uint16 - var obsDomainId uint32 - if err := utils.BinaryRead(payload, binary.BigEndian, &version); err != nil { - return nil, fmt.Errorf("Error decoding version: %v", err) - } - - if version == 9 { - err := utils.BinaryDecoder(payload, &packetNFv9.Count, &packetNFv9.SystemUptime, &packetNFv9.UnixSeconds, &packetNFv9.SequenceNumber, &packetNFv9.SourceId) - if err != nil { - return nil, fmt.Errorf("Error decoding NetFlow v9 header: %v", err) - } - size = packetNFv9.Count - packetNFv9.Version = version - returnItem = *(&packetNFv9) - obsDomainId = packetNFv9.SourceId - } else if version == 10 { - err := utils.BinaryDecoder(payload, &packetIPFIX.Length, &packetIPFIX.ExportTime, &packetIPFIX.SequenceNumber, &packetIPFIX.ObservationDomainId) - if err != nil { - return nil, fmt.Errorf("Error decoding IPFIX header: %v", err) - } - size = packetIPFIX.Length - packetIPFIX.Version = version - returnItem = *(&packetIPFIX) - obsDomainId = packetIPFIX.ObservationDomainId - } else { - return nil, fmt.Errorf("NetFlow/IPFIX version error: %d", version) - } - read := 16 - startSize := payload.Len() - - for i := 0; ((i < int(size) && version == 9) || (uint16(read) < size && version == 10)) && payload.Len() > 0; i++ { - fsheader := FlowSetHeader{} - if err := utils.BinaryDecoder(payload, &fsheader.Id, &fsheader.Length); err != nil { - return returnItem, fmt.Errorf("Error decoding FlowSet header: %v", err) - } - - nextrelpos := int(fsheader.Length) - binary.Size(fsheader) - if nextrelpos < 0 { - return returnItem, fmt.Errorf("Error decoding packet: non-terminated stream") - } - - var flowSet interface{} - - if fsheader.Id == 0 && version == 9 { - templateReader := bytes.NewBuffer(payload.Next(nextrelpos)) - records, err := DecodeTemplateSet(version, templateReader) - if err != nil { - return returnItem, fmt.Errorf("Error decoding FlowSet header: %v", err) - } - templatefs := TemplateFlowSet{ - FlowSetHeader: fsheader, - Records: records, - } - - flowSet = templatefs - - if tpli != nil { - for _, record := range records { - tpli.AddTemplate(version, obsDomainId, record) - //tpli.AddTemplate(ctx, templates.NewTemplateKey(templateKey, version, obsDomainId, record.TemplateId), record) - } - } - - } else if fsheader.Id == 1 && version == 9 { - templateReader := bytes.NewBuffer(payload.Next(nextrelpos)) - records, err := DecodeNFv9OptionsTemplateSet(templateReader) - if err != nil { - return returnItem, fmt.Errorf("Error decoding NetFlow OptionsTemplateSet: %v", err) - } - optsTemplatefs := NFv9OptionsTemplateFlowSet{ - FlowSetHeader: fsheader, - Records: records, - } - flowSet = optsTemplatefs - - if tpli != nil { - for _, record := range records { - tpli.AddTemplate(version, obsDomainId, record) - //tpli.AddTemplate(ctx, templates.NewTemplateKey(templateKey, version, obsDomainId, record.TemplateId), record) - } - } - - } else if fsheader.Id == 2 && version == 10 { - templateReader := bytes.NewBuffer(payload.Next(nextrelpos)) - records, err := DecodeTemplateSet(version, templateReader) - if err != nil { - return returnItem, fmt.Errorf("Error decoding IPFIX TemplateSet: %v", err) - } - templatefs := TemplateFlowSet{ - FlowSetHeader: fsheader, - Records: records, - } - flowSet = templatefs - - if tpli != nil { - for _, record := range records { - tpli.AddTemplate(version, obsDomainId, record) - //tpli.AddTemplate(ctx, templates.NewTemplateKey(templateKey, version, obsDomainId, record.TemplateId), record) - } - } - - } else if fsheader.Id == 3 && version == 10 { - templateReader := bytes.NewBuffer(payload.Next(nextrelpos)) - records, err := DecodeIPFIXOptionsTemplateSet(templateReader) - if err != nil { - return returnItem, fmt.Errorf("Error decoding IPFIX OptionsTemplateSet: %v", err) - } - optsTemplatefs := IPFIXOptionsTemplateFlowSet{ - FlowSetHeader: fsheader, - Records: records, - } - flowSet = optsTemplatefs - - if tpli != nil { - for _, record := range records { - tpli.AddTemplate(version, obsDomainId, record) - //tpli.AddTemplate(ctx, templates.NewTemplateKey(templateKey, version, obsDomainId, record.TemplateId), record) - } - } - - } else if fsheader.Id >= 256 { - dataReader := bytes.NewBuffer(payload.Next(nextrelpos)) - - if tpli == nil { - continue - } - - template, err := tpli.GetTemplate(version, obsDomainId, fsheader.Id) - //template, err := tpli.GetTemplate(ctx, templates.NewTemplateKey(templateKey, version, obsDomainId, fsheader.Id)) - - if err == nil { - switch templatec := template.(type) { - case TemplateRecord: - records, err := DecodeDataSet(version, dataReader, templatec.Fields) - if err != nil { - return returnItem, fmt.Errorf("Error decoding DataSet: %v", err) - } - datafs := DataFlowSet{ - FlowSetHeader: fsheader, - Records: records, - } - flowSet = datafs - case IPFIXOptionsTemplateRecord: - records, err := DecodeOptionsDataSet(version, dataReader, templatec.Scopes, templatec.Options) - if err != nil { - return returnItem, fmt.Errorf("Error decoding DataSet: %v", err) - } - - datafs := OptionsDataFlowSet{ - FlowSetHeader: fsheader, - Records: records, - } - flowSet = datafs - case NFv9OptionsTemplateRecord: - records, err := DecodeOptionsDataSet(version, dataReader, templatec.Scopes, templatec.Options) - if err != nil { - return returnItem, fmt.Errorf("Error decoding OptionDataSet: %v", err) - } - - datafs := OptionsDataFlowSet{ - FlowSetHeader: fsheader, - Records: records, - } - flowSet = datafs - } - } else { - return returnItem, err - } - } else { - return returnItem, fmt.Errorf("Error with ID %d", fsheader.Id) - } - - if version == 9 && flowSet != nil { - packetNFv9.FlowSets = append(packetNFv9.FlowSets, flowSet) - } else if version == 10 && flowSet != nil { - packetIPFIX.FlowSets = append(packetIPFIX.FlowSets, flowSet) - } - read = startSize - payload.Len() + 16 - } - - if version == 9 { - return packetNFv9, nil - } else if version == 10 { - return packetIPFIX, nil - } else { - return returnItem, fmt.Errorf("Unknown version: %d", version) - } -} diff --git a/vendor/github.com/netsampler/goflow2/decoders/netflow/nfv9.go b/vendor/github.com/netsampler/goflow2/decoders/netflow/nfv9.go deleted file mode 100644 index 64fe227d..00000000 --- a/vendor/github.com/netsampler/goflow2/decoders/netflow/nfv9.go +++ /dev/null @@ -1,317 +0,0 @@ -package netflow - -import ( - "fmt" - "time" -) - -const ( - NFV9_FIELD_IN_BYTES = 1 - NFV9_FIELD_IN_PKTS = 2 - NFV9_FIELD_FLOWS = 3 - NFV9_FIELD_PROTOCOL = 4 - NFV9_FIELD_SRC_TOS = 5 - NFV9_FIELD_TCP_FLAGS = 6 - NFV9_FIELD_L4_SRC_PORT = 7 - NFV9_FIELD_IPV4_SRC_ADDR = 8 - NFV9_FIELD_SRC_MASK = 9 - NFV9_FIELD_INPUT_SNMP = 10 - NFV9_FIELD_L4_DST_PORT = 11 - NFV9_FIELD_IPV4_DST_ADDR = 12 - NFV9_FIELD_DST_MASK = 13 - NFV9_FIELD_OUTPUT_SNMP = 14 - NFV9_FIELD_IPV4_NEXT_HOP = 15 - NFV9_FIELD_SRC_AS = 16 - NFV9_FIELD_DST_AS = 17 - NFV9_FIELD_BGP_IPV4_NEXT_HOP = 18 - NFV9_FIELD_MUL_DST_PKTS = 19 - NFV9_FIELD_MUL_DST_BYTES = 20 - NFV9_FIELD_LAST_SWITCHED = 21 - NFV9_FIELD_FIRST_SWITCHED = 22 - NFV9_FIELD_OUT_BYTES = 23 - NFV9_FIELD_OUT_PKTS = 24 - NFV9_FIELD_MIN_PKT_LNGTH = 25 - NFV9_FIELD_MAX_PKT_LNGTH = 26 - NFV9_FIELD_IPV6_SRC_ADDR = 27 - NFV9_FIELD_IPV6_DST_ADDR = 28 - NFV9_FIELD_IPV6_SRC_MASK = 29 - NFV9_FIELD_IPV6_DST_MASK = 30 - NFV9_FIELD_IPV6_FLOW_LABEL = 31 - NFV9_FIELD_ICMP_TYPE = 32 - NFV9_FIELD_MUL_IGMP_TYPE = 33 - NFV9_FIELD_SAMPLING_INTERVAL = 34 - NFV9_FIELD_SAMPLING_ALGORITHM = 35 - NFV9_FIELD_FLOW_ACTIVE_TIMEOUT = 36 - NFV9_FIELD_FLOW_INACTIVE_TIMEOUT = 37 - NFV9_FIELD_ENGINE_TYPE = 38 - NFV9_FIELD_ENGINE_ID = 39 - NFV9_FIELD_TOTAL_BYTES_EXP = 40 - NFV9_FIELD_TOTAL_PKTS_EXP = 41 - NFV9_FIELD_TOTAL_FLOWS_EXP = 42 - NFV9_FIELD_IPV4_SRC_PREFIX = 44 - NFV9_FIELD_IPV4_DST_PREFIX = 45 - NFV9_FIELD_MPLS_TOP_LABEL_TYPE = 46 - NFV9_FIELD_MPLS_TOP_LABEL_IP_ADDR = 47 - NFV9_FIELD_FLOW_SAMPLER_ID = 48 - NFV9_FIELD_FLOW_SAMPLER_MODE = 49 - NFV9_FIELD_FLOW_SAMPLER_RANDOM_INTERVAL = 50 - NFV9_FIELD_MIN_TTL = 52 - NFV9_FIELD_MAX_TTL = 53 - NFV9_FIELD_IPV4_IDENT = 54 - NFV9_FIELD_DST_TOS = 55 - NFV9_FIELD_IN_SRC_MAC = 56 - NFV9_FIELD_OUT_DST_MAC = 57 - NFV9_FIELD_SRC_VLAN = 58 - NFV9_FIELD_DST_VLAN = 59 - NFV9_FIELD_IP_PROTOCOL_VERSION = 60 - NFV9_FIELD_DIRECTION = 61 - NFV9_FIELD_IPV6_NEXT_HOP = 62 - NFV9_FIELD_BGP_IPV6_NEXT_HOP = 63 - NFV9_FIELD_IPV6_OPTION_HEADERS = 64 - NFV9_FIELD_MPLS_LABEL_1 = 70 - NFV9_FIELD_MPLS_LABEL_2 = 71 - NFV9_FIELD_MPLS_LABEL_3 = 72 - NFV9_FIELD_MPLS_LABEL_4 = 73 - NFV9_FIELD_MPLS_LABEL_5 = 74 - NFV9_FIELD_MPLS_LABEL_6 = 75 - NFV9_FIELD_MPLS_LABEL_7 = 76 - NFV9_FIELD_MPLS_LABEL_8 = 77 - NFV9_FIELD_MPLS_LABEL_9 = 78 - NFV9_FIELD_MPLS_LABEL_10 = 79 - NFV9_FIELD_IN_DST_MAC = 80 - NFV9_FIELD_OUT_SRC_MAC = 81 - NFV9_FIELD_IF_NAME = 82 - NFV9_FIELD_IF_DESC = 83 - NFV9_FIELD_SAMPLER_NAME = 84 - NFV9_FIELD_IN_PERMANENT_BYTES = 85 - NFV9_FIELD_IN_PERMANENT_PKTS = 86 - NFV9_FIELD_FRAGMENT_OFFSET = 88 - NFV9_FIELD_FORWARDING_STATUS = 89 - NFV9_FIELD_MPLS_PAL_RD = 90 - NFV9_FIELD_MPLS_PREFIX_LEN = 91 - NFV9_FIELD_SRC_TRAFFIC_INDEX = 92 - NFV9_FIELD_DST_TRAFFIC_INDEX = 93 - NFV9_FIELD_APPLICATION_DESCRIPTION = 94 - NFV9_FIELD_APPLICATION_TAG = 95 - NFV9_FIELD_APPLICATION_NAME = 96 - NFV9_FIELD_postipDiffServCodePoint = 98 - NFV9_FIELD_replication_factor = 99 - NFV9_FIELD_layer2packetSectionOffset = 102 - NFV9_FIELD_layer2packetSectionSize = 103 - NFV9_FIELD_layer2packetSectionData = 104 -) - -type NFv9Packet struct { - Version uint16 - Count uint16 - SystemUptime uint32 - UnixSeconds uint32 - SequenceNumber uint32 - SourceId uint32 - FlowSets []interface{} -} - -type NFv9OptionsTemplateFlowSet struct { - FlowSetHeader - Records []NFv9OptionsTemplateRecord -} - -type NFv9OptionsTemplateRecord struct { - TemplateId uint16 - ScopeLength uint16 - OptionLength uint16 - Scopes []Field - Options []Field -} - -func NFv9TypeToString(typeId uint16) string { - - nameList := map[uint16]string{ - 1: "IN_BYTES", - 2: "IN_PKTS", - 3: "FLOWS", - 4: "PROTOCOL", - 5: "SRC_TOS", - 6: "TCP_FLAGS", - 7: "L4_SRC_PORT", - 8: "IPV4_SRC_ADDR", - 9: "SRC_MASK", - 10: "INPUT_SNMP", - 11: "L4_DST_PORT", - 12: "IPV4_DST_ADDR", - 13: "DST_MASK", - 14: "OUTPUT_SNMP", - 15: "IPV4_NEXT_HOP", - 16: "SRC_AS", - 17: "DST_AS", - 18: "BGP_IPV4_NEXT_HOP", - 19: "MUL_DST_PKTS", - 20: "MUL_DST_BYTES", - 21: "LAST_SWITCHED", - 22: "FIRST_SWITCHED", - 23: "OUT_BYTES", - 24: "OUT_PKTS", - 25: "MIN_PKT_LNGTH", - 26: "MAX_PKT_LNGTH", - 27: "IPV6_SRC_ADDR", - 28: "IPV6_DST_ADDR", - 29: "IPV6_SRC_MASK", - 30: "IPV6_DST_MASK", - 31: "IPV6_FLOW_LABEL", - 32: "ICMP_TYPE", - 33: "MUL_IGMP_TYPE", - 34: "SAMPLING_INTERVAL", - 35: "SAMPLING_ALGORITHM", - 36: "FLOW_ACTIVE_TIMEOUT", - 37: "FLOW_INACTIVE_TIMEOUT", - 38: "ENGINE_TYPE", - 39: "ENGINE_ID", - 40: "TOTAL_BYTES_EXP", - 41: "TOTAL_PKTS_EXP", - 42: "TOTAL_FLOWS_EXP", - 43: "*Vendor Proprietary*", - 44: "IPV4_SRC_PREFIX", - 45: "IPV4_DST_PREFIX", - 46: "MPLS_TOP_LABEL_TYPE", - 47: "MPLS_TOP_LABEL_IP_ADDR", - 48: "FLOW_SAMPLER_ID", - 49: "FLOW_SAMPLER_MODE", - 50: "FLOW_SAMPLER_RANDOM_INTERVAL", - 51: "*Vendor Proprietary*", - 52: "MIN_TTL", - 53: "MAX_TTL", - 54: "IPV4_IDENT", - 55: "DST_TOS", - 56: "IN_SRC_MAC", - 57: "OUT_DST_MAC", - 58: "SRC_VLAN", - 59: "DST_VLAN", - 60: "IP_PROTOCOL_VERSION", - 61: "DIRECTION", - 62: "IPV6_NEXT_HOP", - 63: "BPG_IPV6_NEXT_HOP", - 64: "IPV6_OPTION_HEADERS", - 65: "*Vendor Proprietary*", - 66: "*Vendor Proprietary*", - 67: "*Vendor Proprietary*", - 68: "*Vendor Proprietary*", - 69: "*Vendor Proprietary*", - 70: "MPLS_LABEL_1", - 71: "MPLS_LABEL_2", - 72: "MPLS_LABEL_3", - 73: "MPLS_LABEL_4", - 74: "MPLS_LABEL_5", - 75: "MPLS_LABEL_6", - 76: "MPLS_LABEL_7", - 77: "MPLS_LABEL_8", - 78: "MPLS_LABEL_9", - 79: "MPLS_LABEL_10", - 80: "IN_DST_MAC", - 81: "OUT_SRC_MAC", - 82: "IF_NAME", - 83: "IF_DESC", - 84: "SAMPLER_NAME", - 85: "IN_ PERMANENT _BYTES", - 86: "IN_ PERMANENT _PKTS", - 87: "*Vendor Proprietary*", - 88: "FRAGMENT_OFFSET", - 89: "FORWARDING STATUS", - 90: "MPLS PAL RD", - 91: "MPLS PREFIX LEN", - 92: "SRC TRAFFIC INDEX", - 93: "DST TRAFFIC INDEX", - 94: "APPLICATION DESCRIPTION", - 95: "APPLICATION TAG", - 96: "APPLICATION NAME", - 98: "postipDiffServCodePoint", - 99: "replication factor", - 100: "DEPRECATED", - 102: "layer2packetSectionOffset", - 103: "layer2packetSectionSize", - 104: "layer2packetSectionData", - 234: "ingressVRFID", - 235: "egressVRFID", - } - - if typeId > 104 || typeId == 0 { - return "Unassigned" - } else { - return nameList[typeId] - } -} - -func NFv9ScopeToString(scopeId uint16) string { - nameList := map[uint16]string{ - 1: "System", - 2: "Interface", - 3: "Line Card", - 4: "NetFlow Cache", - 5: "Template", - } - - if scopeId >= 1 && scopeId <= 5 { - return nameList[scopeId] - } else { - return "Unassigned" - } -} - -func (flowSet NFv9OptionsTemplateFlowSet) String(TypeToString func(uint16) string) string { - str := fmt.Sprintf(" Id %v\n", flowSet.Id) - str += fmt.Sprintf(" Length: %v\n", flowSet.Length) - str += fmt.Sprintf(" Records (%v records):\n", len(flowSet.Records)) - - for j, record := range flowSet.Records { - str += fmt.Sprintf(" - Record %v:\n", j) - str += fmt.Sprintf(" TemplateId: %v\n", record.TemplateId) - str += fmt.Sprintf(" ScopeLength: %v\n", record.ScopeLength) - str += fmt.Sprintf(" OptionLength: %v\n", record.OptionLength) - str += fmt.Sprintf(" Scopes (%v):\n", len(record.Scopes)) - - for k, field := range record.Scopes { - str += fmt.Sprintf(" - %v. %v (%v): %v\n", k, NFv9ScopeToString(field.Type), field.Type, field.Length) - } - - str += fmt.Sprintf(" Options (%v):\n", len(record.Options)) - - for k, field := range record.Options { - str += fmt.Sprintf(" - %v. %v (%v): %v\n", k, TypeToString(field.Type), field.Type, field.Length) - } - } - - return str -} - -func (p NFv9Packet) String() string { - str := "Flow Packet\n" - str += "------------\n" - str += fmt.Sprintf(" Version: %v\n", p.Version) - str += fmt.Sprintf(" Count: %v\n", p.Count) - - unixSeconds := time.Unix(int64(p.UnixSeconds), 0) - str += fmt.Sprintf(" SystemUptime: %v\n", p.SystemUptime) - str += fmt.Sprintf(" UnixSeconds: %v\n", unixSeconds.UTC().String()) - str += fmt.Sprintf(" SequenceNumber: %v\n", p.SequenceNumber) - str += fmt.Sprintf(" SourceId: %v\n", p.SourceId) - str += fmt.Sprintf(" FlowSets (%v):\n", len(p.FlowSets)) - - for i, flowSet := range p.FlowSets { - switch flowSet := flowSet.(type) { - case TemplateFlowSet: - str += fmt.Sprintf(" - TemplateFlowSet %v:\n", i) - str += flowSet.String(NFv9TypeToString) - case NFv9OptionsTemplateFlowSet: - str += fmt.Sprintf(" - OptionsTemplateFlowSet %v:\n", i) - str += flowSet.String(NFv9TypeToString) - case DataFlowSet: - str += fmt.Sprintf(" - DataFlowSet %v:\n", i) - str += flowSet.String(NFv9TypeToString) - case OptionsDataFlowSet: - str += fmt.Sprintf(" - OptionsDataFlowSet %v:\n", i) - str += flowSet.String(NFv9TypeToString, NFv9ScopeToString) - default: - str += fmt.Sprintf(" - (unknown type) %v: %v\n", i, flowSet) - } - } - return str -} diff --git a/vendor/github.com/netsampler/goflow2/decoders/netflow/packet.go b/vendor/github.com/netsampler/goflow2/decoders/netflow/packet.go deleted file mode 100644 index 3e3707d6..00000000 --- a/vendor/github.com/netsampler/goflow2/decoders/netflow/packet.go +++ /dev/null @@ -1,158 +0,0 @@ -package netflow - -import ( - "fmt" -) - -// FlowSetHeader contains fields shared by all Flow Sets (DataFlowSet, -// TemplateFlowSet, OptionsTemplateFlowSet). -type FlowSetHeader struct { - // FlowSet ID: - // 0 for TemplateFlowSet - // 1 for OptionsTemplateFlowSet - // 256-65535 for DataFlowSet (used as TemplateId) - Id uint16 - - // The total length of this FlowSet in bytes (including padding). - Length uint16 -} - -// TemplateFlowSet is a collection of templates that describe structure of Data -// Records (actual NetFlow data). -type TemplateFlowSet struct { - FlowSetHeader - - // List of Template Records - Records []TemplateRecord -} - -// DataFlowSet is a collection of Data Records (actual NetFlow data) and Options -// Data Records (meta data). -type DataFlowSet struct { - FlowSetHeader - - Records []DataRecord -} - -type OptionsDataFlowSet struct { - FlowSetHeader - - Records []OptionsDataRecord -} - -// TemplateRecord is a single template that describes structure of a Flow Record -// (actual Netflow data). -type TemplateRecord struct { - // Each of the newly generated Template Records is given a unique - // Template ID. This uniqueness is local to the Observation Domain that - // generated the Template ID. Template IDs of Data FlowSets are numbered - // from 256 to 65535. - TemplateId uint16 - - // Number of fields in this Template Record. Because a Template FlowSet - // usually contains multiple Template Records, this field allows the - // Collector to determine the end of the current Template Record and - // the start of the next. - FieldCount uint16 - - // List of fields in this Template Record. - Fields []Field -} - -type DataRecord struct { - Values []DataField -} - -// OptionsDataRecord is meta data sent alongide actual NetFlow data. Combined -// with OptionsTemplateRecord it can be decoded to a single data row. -type OptionsDataRecord struct { - // List of Scope values stored in raw format as []byte - ScopesValues []DataField - - // List of Optons values stored in raw format as []byte - OptionsValues []DataField -} - -// Field describes type and length of a single value in a Flow Data Record. -// Field does not contain the record value itself it is just a description of -// what record value will look like. -type Field struct { - // A numeric value that represents the type of field. - PenProvided bool - Type uint16 - - // The length (in bytes) of the field. - Length uint16 - - Pen uint32 -} - -type DataField struct { - // A numeric value that represents the type of field. - PenProvided bool - Type uint16 - Pen uint32 - - // The value (in bytes) of the field. - Value interface{} - //Value []byte -} - -func (flowSet OptionsDataFlowSet) String(TypeToString func(uint16) string, ScopeToString func(uint16) string) string { - str := fmt.Sprintf(" Id %v\n", flowSet.Id) - str += fmt.Sprintf(" Length: %v\n", flowSet.Length) - str += fmt.Sprintf(" Records (%v records):\n", len(flowSet.Records)) - - for j, record := range flowSet.Records { - str += fmt.Sprintf(" - Record %v:\n", j) - str += fmt.Sprintf(" Scopes (%v):\n", len(record.ScopesValues)) - - for k, value := range record.ScopesValues { - str += fmt.Sprintf(" - %v. %v (%v): %v\n", k, ScopeToString(value.Type), value.Type, value.Value) - } - - str += fmt.Sprintf(" Options (%v):\n", len(record.OptionsValues)) - - for k, value := range record.OptionsValues { - str += fmt.Sprintf(" - %v. %v (%v): %v\n", k, TypeToString(value.Type), value.Type, value.Value) - } - } - - return str -} - -func (flowSet DataFlowSet) String(TypeToString func(uint16) string) string { - str := fmt.Sprintf(" Id %v\n", flowSet.Id) - str += fmt.Sprintf(" Length: %v\n", flowSet.Length) - str += fmt.Sprintf(" Records (%v records):\n", len(flowSet.Records)) - - for j, record := range flowSet.Records { - str += fmt.Sprintf(" - Record %v:\n", j) - str += fmt.Sprintf(" Values (%v):\n", len(record.Values)) - - for k, value := range record.Values { - str += fmt.Sprintf(" - %v. %v (%v): %v\n", k, TypeToString(value.Type), value.Type, value.Value) - } - } - - return str -} - -func (flowSet TemplateFlowSet) String(TypeToString func(uint16) string) string { - str := fmt.Sprintf(" Id %v\n", flowSet.Id) - str += fmt.Sprintf(" Length: %v\n", flowSet.Length) - str += fmt.Sprintf(" Records (%v records):\n", len(flowSet.Records)) - - for j, record := range flowSet.Records { - str += fmt.Sprintf(" - %v. Record:\n", j) - str += fmt.Sprintf(" TemplateId: %v\n", record.TemplateId) - str += fmt.Sprintf(" FieldCount: %v\n", record.FieldCount) - str += fmt.Sprintf(" Fields (%v):\n", len(record.Fields)) - - for k, field := range record.Fields { - str += fmt.Sprintf(" - %v. %v (%v/%v): %v\n", k, TypeToString(field.Type), field.Type, field.PenProvided, field.Length) - } - } - - return str -} diff --git a/vendor/github.com/netsampler/goflow2/decoders/netflow/templates/templates.go b/vendor/github.com/netsampler/goflow2/decoders/netflow/templates/templates.go deleted file mode 100644 index 525e6b10..00000000 --- a/vendor/github.com/netsampler/goflow2/decoders/netflow/templates/templates.go +++ /dev/null @@ -1,139 +0,0 @@ -package templates - -import ( - "context" - "fmt" - "strconv" - "strings" - "sync" -) - -var ( - templateDrivers = make(map[string]TemplateDriver) // might be better to change into "factory" - lock = &sync.RWMutex{} -) - -type TemplateDriver interface { - TemplateInterface - - Prepare() error // Prepare driver (eg: flag registration) - Init(context.Context) error // Initialize driver (eg: parse keying) - Close(context.Context) error // Close drive (eg: close file) -} - -type TemplateKey struct { - TemplateKey string - Version uint16 - ObsDomainId uint32 - TemplateId uint16 -} - -func NewTemplateKey(templateKey string, version uint16, obsDomainId uint32, templateId uint16) *TemplateKey { - return &TemplateKey{ - TemplateKey: templateKey, - Version: version, - ObsDomainId: obsDomainId, - TemplateId: templateId, - } -} - -func (k *TemplateKey) String() string { - return fmt.Sprintf("%s-%d-%d-%d", k.TemplateKey, k.Version, k.ObsDomainId, k.TemplateId) -} - -func ParseTemplateKey(key string, k *TemplateKey) error { - if k != nil { - return nil - } - var version uint16 - var obsDomainId uint32 - var templateId uint16 - - keySplit := strings.Split(key, "-") - if len(keySplit) != 4 { - return fmt.Errorf("template key format is invalid") - } - templateKey := keySplit[0] - if val, err := strconv.ParseUint(keySplit[1], 10, 64); err != nil { - return fmt.Errorf("template key version is invalid") - } else { - version = uint16(val) - } - if val, err := strconv.ParseUint(keySplit[2], 10, 64); err != nil { - fmt.Errorf("template key observation domain I Dis invalid") - } else { - obsDomainId = uint32(val) - } - if val, err := strconv.ParseUint(keySplit[3], 10, 64); err != nil { - fmt.Errorf("template key template ID is invalid") - } else { - templateId = uint16(val) - } - - k.TemplateKey = templateKey - k.Version = version - k.ObsDomainId = obsDomainId - k.TemplateId = templateId - - return nil -} - -type TemplateInterface interface { - ListTemplates(ctx context.Context, ch chan *TemplateKey) error - GetTemplate(ctx context.Context, key *TemplateKey) (interface{}, error) - AddTemplate(ctx context.Context, key *TemplateKey, template interface{}) error // add expiration -} - -type TemplateSystem struct { - driver TemplateDriver -} - -func (t *TemplateSystem) ListTemplates(ctx context.Context, ch chan *TemplateKey) error { - return t.driver.ListTemplates(ctx, ch) -} - -func (t *TemplateSystem) AddTemplate(ctx context.Context, key *TemplateKey, template interface{}) error { - return t.driver.AddTemplate(ctx, key, template) -} - -func (t *TemplateSystem) GetTemplate(ctx context.Context, key *TemplateKey) (interface{}, error) { - return t.driver.GetTemplate(ctx, key) -} - -func (t *TemplateSystem) Close(ctx context.Context) error { - return t.driver.Close(ctx) -} - -func RegisterTemplateDriver(name string, t TemplateDriver) { - lock.Lock() - templateDrivers[name] = t - lock.Unlock() - - if err := t.Prepare(); err != nil { - panic(err) - } -} - -func FindTemplateSystem(ctx context.Context, name string) (*TemplateSystem, error) { - lock.RLock() - t, ok := templateDrivers[name] - lock.RUnlock() - if !ok { - return nil, fmt.Errorf("Template %s not found", name) - } - - err := t.Init(ctx) - return &TemplateSystem{t}, err -} - -func GetTemplates() []string { - lock.RLock() - defer lock.RUnlock() - t := make([]string, len(templateDrivers)) - var i int - for k, _ := range templateDrivers { - t[i] = k - i++ - } - return t -} diff --git a/vendor/github.com/netsampler/goflow2/decoders/netflowlegacy/netflow.go b/vendor/github.com/netsampler/goflow2/decoders/netflowlegacy/netflow.go deleted file mode 100644 index 955f82ce..00000000 --- a/vendor/github.com/netsampler/goflow2/decoders/netflowlegacy/netflow.go +++ /dev/null @@ -1,90 +0,0 @@ -package netflowlegacy - -import ( - "bytes" - "fmt" - - "github.com/netsampler/goflow2/decoders/utils" -) - -const ( - MAX_COUNT = 1536 -) - -type ErrorVersion struct { - version uint16 -} - -func NewErrorVersion(version uint16) *ErrorVersion { - return &ErrorVersion{ - version: version, - } -} - -func (e *ErrorVersion) Error() string { - return fmt.Sprintf("Unknown NetFlow version %v (only decodes v5)", e.version) -} - -func DecodeMessage(payload *bytes.Buffer) (interface{}, error) { - var version uint16 - err := utils.BinaryDecoder(payload, &version) - if err != nil { - return nil, err - } - packet := PacketNetFlowV5{} - if version == 5 { - packet.Version = version - - utils.BinaryDecoder(payload, - &(packet.Count), - &(packet.SysUptime), - &(packet.UnixSecs), - &(packet.UnixNSecs), - &(packet.FlowSequence), - &(packet.EngineType), - &(packet.EngineId), - &(packet.SamplingInterval), - ) - - packet.SamplingInterval = packet.SamplingInterval & 0x3FFF - - if packet.Count > MAX_COUNT { - return nil, fmt.Errorf("Too many samples (%d > %d) in packet", packet.Count, MAX_COUNT) - } - - packet.Records = make([]RecordsNetFlowV5, int(packet.Count)) - for i := 0; i < int(packet.Count) && payload.Len() >= 48; i++ { - record := RecordsNetFlowV5{} - err := utils.BinaryDecoder(payload, - &record.SrcAddr, - &record.DstAddr, - &record.NextHop, - &record.Input, - &record.Output, - &record.DPkts, - &record.DOctets, - &record.First, - &record.Last, - &record.SrcPort, - &record.DstPort, - &record.Pad1, - &record.TCPFlags, - &record.Proto, - &record.Tos, - &record.SrcAS, - &record.DstAS, - &record.SrcMask, - &record.DstMask, - &record.Pad2, - ) - if err != nil { - return packet, err - } - packet.Records[i] = record - } - - return packet, nil - } else { - return nil, NewErrorVersion(version) - } -} diff --git a/vendor/github.com/netsampler/goflow2/decoders/netflowlegacy/packet.go b/vendor/github.com/netsampler/goflow2/decoders/netflowlegacy/packet.go deleted file mode 100644 index 078bba4d..00000000 --- a/vendor/github.com/netsampler/goflow2/decoders/netflowlegacy/packet.go +++ /dev/null @@ -1,96 +0,0 @@ -package netflowlegacy - -import ( - "encoding/binary" - "fmt" - "net" - "time" -) - -type PacketNetFlowV5 struct { - Version uint16 - Count uint16 - SysUptime uint32 - UnixSecs uint32 - UnixNSecs uint32 - FlowSequence uint32 - EngineType uint8 - EngineId uint8 - SamplingInterval uint16 - Records []RecordsNetFlowV5 -} - -type RecordsNetFlowV5 struct { - SrcAddr uint32 - DstAddr uint32 - NextHop uint32 - Input uint16 - Output uint16 - DPkts uint32 - DOctets uint32 - First uint32 - Last uint32 - SrcPort uint16 - DstPort uint16 - Pad1 byte - TCPFlags uint8 - Proto uint8 - Tos uint8 - SrcAS uint16 - DstAS uint16 - SrcMask uint8 - DstMask uint8 - Pad2 uint16 -} - -func (p PacketNetFlowV5) String() string { - str := "NetFlow v5 Packet\n" - str += "-----------------\n" - str += fmt.Sprintf(" Version: %v\n", p.Version) - str += fmt.Sprintf(" Count: %v\n", p.Count) - - unixSeconds := time.Unix(int64(p.UnixSecs), int64(p.UnixNSecs)) - str += fmt.Sprintf(" SystemUptime: %v\n", time.Duration(p.SysUptime)*time.Millisecond) - str += fmt.Sprintf(" UnixSeconds: %v\n", unixSeconds.String()) - str += fmt.Sprintf(" FlowSequence: %v\n", p.FlowSequence) - str += fmt.Sprintf(" EngineType: %v\n", p.EngineType) - str += fmt.Sprintf(" EngineId: %v\n", p.EngineId) - str += fmt.Sprintf(" SamplingInterval: %v\n", p.SamplingInterval) - str += fmt.Sprintf(" Records (%v):\n", len(p.Records)) - - for i, record := range p.Records { - str += fmt.Sprintf(" Record %v:\n", i) - str += record.String() - } - return str -} - -func (r RecordsNetFlowV5) String() string { - srcaddr := make(net.IP, 4) - binary.BigEndian.PutUint32(srcaddr, r.SrcAddr) - dstaddr := make(net.IP, 4) - binary.BigEndian.PutUint32(dstaddr, r.DstAddr) - nexthop := make(net.IP, 4) - binary.BigEndian.PutUint32(nexthop, r.NextHop) - - str := fmt.Sprintf(" SrcAddr: %v\n", srcaddr.String()) - str += fmt.Sprintf(" DstAddr: %v\n", dstaddr.String()) - str += fmt.Sprintf(" NextHop: %v\n", nexthop.String()) - str += fmt.Sprintf(" Input: %v\n", r.Input) - str += fmt.Sprintf(" Output: %v\n", r.Output) - str += fmt.Sprintf(" DPkts: %v\n", r.DPkts) - str += fmt.Sprintf(" DOctets: %v\n", r.DOctets) - str += fmt.Sprintf(" First: %v\n", time.Duration(r.First)*time.Millisecond) - str += fmt.Sprintf(" Last: %v\n", time.Duration(r.Last)*time.Millisecond) - str += fmt.Sprintf(" SrcPort: %v\n", r.SrcPort) - str += fmt.Sprintf(" DstPort: %v\n", r.DstPort) - str += fmt.Sprintf(" TCPFlags: %v\n", r.TCPFlags) - str += fmt.Sprintf(" Proto: %v\n", r.Proto) - str += fmt.Sprintf(" Tos: %v\n", r.Tos) - str += fmt.Sprintf(" SrcAS: %v\n", r.SrcAS) - str += fmt.Sprintf(" DstAS: %v\n", r.DstAS) - str += fmt.Sprintf(" SrcMask: %v\n", r.SrcMask) - str += fmt.Sprintf(" DstMask: %v\n", r.DstMask) - - return str -} diff --git a/vendor/github.com/netsampler/goflow2/decoders/sflow/datastructure.go b/vendor/github.com/netsampler/goflow2/decoders/sflow/datastructure.go deleted file mode 100644 index 670652a2..00000000 --- a/vendor/github.com/netsampler/goflow2/decoders/sflow/datastructure.go +++ /dev/null @@ -1,103 +0,0 @@ -package sflow - -type SampledHeader struct { - Protocol uint32 - FrameLength uint32 - Stripped uint32 - OriginalLength uint32 - HeaderData []byte -} - -type SampledEthernet struct { - Length uint32 - SrcMac []byte - DstMac []byte - EthType uint32 -} - -type SampledIP_Base struct { - Length uint32 - Protocol uint32 - SrcIP []byte - DstIP []byte - SrcPort uint32 - DstPort uint32 - TcpFlags uint32 -} - -type SampledIPv4 struct { - Base SampledIP_Base - Tos uint32 -} - -type SampledIPv6 struct { - Base SampledIP_Base - Priority uint32 -} - -type ExtendedSwitch struct { - SrcVlan uint32 - SrcPriority uint32 - DstVlan uint32 - DstPriority uint32 -} - -type ExtendedRouter struct { - NextHopIPVersion uint32 - NextHop []byte - SrcMaskLen uint32 - DstMaskLen uint32 -} - -type ExtendedGateway struct { - NextHopIPVersion uint32 - NextHop []byte - AS uint32 - SrcAS uint32 - SrcPeerAS uint32 - ASDestinations uint32 - ASPathType uint32 - ASPathLength uint32 - ASPath []uint32 - CommunitiesLength uint32 - Communities []uint32 - LocalPref uint32 -} - -type IfCounters struct { - IfIndex uint32 - IfType uint32 - IfSpeed uint64 - IfDirection uint32 - IfStatus uint32 - IfInOctets uint64 - IfInUcastPkts uint32 - IfInMulticastPkts uint32 - IfInBroadcastPkts uint32 - IfInDiscards uint32 - IfInErrors uint32 - IfInUnknownProtos uint32 - IfOutOctets uint64 - IfOutUcastPkts uint32 - IfOutMulticastPkts uint32 - IfOutBroadcastPkts uint32 - IfOutDiscards uint32 - IfOutErrors uint32 - IfPromiscuousMode uint32 -} - -type EthernetCounters struct { - Dot3StatsAlignmentErrors uint32 - Dot3StatsFCSErrors uint32 - Dot3StatsSingleCollisionFrames uint32 - Dot3StatsMultipleCollisionFrames uint32 - Dot3StatsSQETestErrors uint32 - Dot3StatsDeferredTransmissions uint32 - Dot3StatsLateCollisions uint32 - Dot3StatsExcessiveCollisions uint32 - Dot3StatsInternalMacTransmitErrors uint32 - Dot3StatsCarrierSenseErrors uint32 - Dot3StatsFrameTooLongs uint32 - Dot3StatsInternalMacReceiveErrors uint32 - Dot3StatsSymbolErrors uint32 -} diff --git a/vendor/github.com/netsampler/goflow2/decoders/sflow/packet.go b/vendor/github.com/netsampler/goflow2/decoders/sflow/packet.go deleted file mode 100644 index 647f83db..00000000 --- a/vendor/github.com/netsampler/goflow2/decoders/sflow/packet.go +++ /dev/null @@ -1,73 +0,0 @@ -package sflow - -type Packet struct { - Version uint32 - IPVersion uint32 - AgentIP []byte - SubAgentId uint32 - SequenceNumber uint32 - Uptime uint32 - SamplesCount uint32 - Samples []interface{} -} - -type SampleHeader struct { - Format uint32 - Length uint32 - - SampleSequenceNumber uint32 - SourceIdType uint32 - SourceIdValue uint32 -} - -type FlowSample struct { - Header SampleHeader - - SamplingRate uint32 - SamplePool uint32 - Drops uint32 - Input uint32 - Output uint32 - FlowRecordsCount uint32 - Records []FlowRecord -} - -type CounterSample struct { - Header SampleHeader - - CounterRecordsCount uint32 - Records []CounterRecord -} - -type ExpandedFlowSample struct { - Header SampleHeader - - SamplingRate uint32 - SamplePool uint32 - Drops uint32 - InputIfFormat uint32 - InputIfValue uint32 - OutputIfFormat uint32 - OutputIfValue uint32 - FlowRecordsCount uint32 - Records []FlowRecord -} - -type RecordHeader struct { - DataFormat uint32 - Length uint32 -} - -type FlowRecord struct { - Header RecordHeader - Data interface{} -} - -type FlowRecordRaw struct { - Data []byte -} - -type CounterRecord struct { - Header RecordHeader - Data interface{} -} diff --git a/vendor/github.com/netsampler/goflow2/decoders/sflow/sflow.go b/vendor/github.com/netsampler/goflow2/decoders/sflow/sflow.go deleted file mode 100644 index 309e965a..00000000 --- a/vendor/github.com/netsampler/goflow2/decoders/sflow/sflow.go +++ /dev/null @@ -1,482 +0,0 @@ -package sflow - -import ( - "bytes" - "errors" - "fmt" - - "github.com/netsampler/goflow2/decoders/utils" -) - -const ( - FORMAT_EXT_SWITCH = 1001 - FORMAT_EXT_ROUTER = 1002 - FORMAT_EXT_GATEWAY = 1003 - FORMAT_RAW_PKT = 1 - FORMAT_ETH = 2 - FORMAT_IPV4 = 3 - FORMAT_IPV6 = 4 - - MAX_SAMPLES = 512 - MAX_RECORDS = 8192 - MAX_ATTRS = 16383 -) - -type ErrorDecodingSFlow struct { - msg string -} - -func NewErrorDecodingSFlow(msg string) *ErrorDecodingSFlow { - return &ErrorDecodingSFlow{ - msg: msg, - } -} - -func (e *ErrorDecodingSFlow) Error() string { - return fmt.Sprintf("Error decoding sFlow: %v", e.msg) -} - -type ErrorDataFormat struct { - dataformat uint32 -} - -func NewErrorDataFormat(dataformat uint32) *ErrorDataFormat { - return &ErrorDataFormat{ - dataformat: dataformat, - } -} - -func (e *ErrorDataFormat) Error() string { - return fmt.Sprintf("Unknown data format %v", e.dataformat) -} - -type ErrorIPVersion struct { - version uint32 -} - -func NewErrorIPVersion(version uint32) *ErrorIPVersion { - return &ErrorIPVersion{ - version: version, - } -} - -func (e *ErrorIPVersion) Error() string { - return fmt.Sprintf("Unknown IP version: %v", e.version) -} - -type ErrorVersion struct { - version uint32 -} - -func NewErrorVersion(version uint32) *ErrorVersion { - return &ErrorVersion{ - version: version, - } -} - -func (e *ErrorVersion) Error() string { - return fmt.Sprintf("Unknown sFlow version %v (supported v5)", e.version) -} - -func DecodeCounterRecord(header *RecordHeader, payload *bytes.Buffer) (CounterRecord, error) { - counterRecord := CounterRecord{ - Header: *header, - } - switch (*header).DataFormat { - case 1: - ifCounters := IfCounters{} - err := utils.BinaryDecoder(payload, - &ifCounters.IfIndex, - &ifCounters.IfType, - &ifCounters.IfSpeed, - &ifCounters.IfDirection, - &ifCounters.IfStatus, - &ifCounters.IfInOctets, - &ifCounters.IfInUcastPkts, - &ifCounters.IfInMulticastPkts, - &ifCounters.IfInBroadcastPkts, - &ifCounters.IfInDiscards, - &ifCounters.IfInErrors, - &ifCounters.IfInUnknownProtos, - &ifCounters.IfOutOctets, - &ifCounters.IfOutUcastPkts, - &ifCounters.IfOutMulticastPkts, - &ifCounters.IfOutBroadcastPkts, - &ifCounters.IfOutDiscards, - &ifCounters.IfOutErrors, - &ifCounters.IfPromiscuousMode, - ) - if err != nil { - return counterRecord, err - } - counterRecord.Data = ifCounters - case 2: - ethernetCounters := EthernetCounters{} - err := utils.BinaryDecoder(payload, - ðernetCounters.Dot3StatsAlignmentErrors, - ðernetCounters.Dot3StatsFCSErrors, - ðernetCounters.Dot3StatsSingleCollisionFrames, - ðernetCounters.Dot3StatsMultipleCollisionFrames, - ðernetCounters.Dot3StatsSQETestErrors, - ðernetCounters.Dot3StatsDeferredTransmissions, - ðernetCounters.Dot3StatsLateCollisions, - ðernetCounters.Dot3StatsExcessiveCollisions, - ðernetCounters.Dot3StatsInternalMacTransmitErrors, - ðernetCounters.Dot3StatsCarrierSenseErrors, - ðernetCounters.Dot3StatsFrameTooLongs, - ðernetCounters.Dot3StatsInternalMacReceiveErrors, - ðernetCounters.Dot3StatsSymbolErrors, - ) - if err != nil { - return counterRecord, err - } - counterRecord.Data = ethernetCounters - default: - counterRecord.Data = &FlowRecordRaw{ - Data: payload.Next(int(header.Length)), - } - } - - return counterRecord, nil -} - -func DecodeIP(payload *bytes.Buffer) (uint32, []byte, error) { - var ipVersion uint32 - err := utils.BinaryDecoder(payload, &ipVersion) - if err != nil { - return 0, nil, err - } - var ip []byte - if ipVersion == 1 { - ip = make([]byte, 4) - } else if ipVersion == 2 { - ip = make([]byte, 16) - } else { - return ipVersion, ip, NewErrorIPVersion(ipVersion) - } - if payload.Len() >= len(ip) { - err := utils.BinaryDecoder(payload, ip) - if err != nil { - return 0, nil, err - } - } else { - return ipVersion, ip, NewErrorDecodingSFlow(fmt.Sprintf("Not enough data: %v, needs %v.", payload.Len(), len(ip))) - } - return ipVersion, ip, nil -} - -func DecodeFlowRecord(header *RecordHeader, payload *bytes.Buffer) (FlowRecord, error) { - flowRecord := FlowRecord{ - Header: *header, - } - switch (*header).DataFormat { - case FORMAT_EXT_SWITCH: - extendedSwitch := ExtendedSwitch{} - err := utils.BinaryDecoder(payload, &extendedSwitch.SrcVlan, &extendedSwitch.SrcPriority, &extendedSwitch.DstVlan, &extendedSwitch.DstPriority) - if err != nil { - return flowRecord, err - } - flowRecord.Data = extendedSwitch - case FORMAT_RAW_PKT: - sampledHeader := SampledHeader{} - err := utils.BinaryDecoder(payload, &sampledHeader.Protocol, &sampledHeader.FrameLength, &sampledHeader.Stripped, &sampledHeader.OriginalLength) - if err != nil { - return flowRecord, err - } - sampledHeader.HeaderData = payload.Bytes() - flowRecord.Data = sampledHeader - case FORMAT_IPV4: - sampledIPBase := SampledIP_Base{ - SrcIP: make([]byte, 4), - DstIP: make([]byte, 4), - } - err := utils.BinaryDecoder(payload, &sampledIPBase.Length, &sampledIPBase.Protocol, sampledIPBase.SrcIP, sampledIPBase.DstIP, &sampledIPBase.SrcPort, &sampledIPBase.DstPort, &sampledIPBase.TcpFlags) - if err != nil { - return flowRecord, err - } - sampledIPv4 := SampledIPv4{ - Base: sampledIPBase, - } - err = utils.BinaryDecoder(payload, &(sampledIPv4.Tos)) - if err != nil { - return flowRecord, err - } - flowRecord.Data = sampledIPv4 - case FORMAT_IPV6: - sampledIPBase := SampledIP_Base{ - SrcIP: make([]byte, 16), - DstIP: make([]byte, 16), - } - err := utils.BinaryDecoder(payload, &sampledIPBase.Length, &sampledIPBase.Protocol, sampledIPBase.SrcIP, sampledIPBase.DstIP, &sampledIPBase.SrcPort, &sampledIPBase.DstPort, &sampledIPBase.TcpFlags) - if err != nil { - return flowRecord, err - } - sampledIPv6 := SampledIPv6{ - Base: sampledIPBase, - } - err = utils.BinaryDecoder(payload, &sampledIPv6.Priority) - if err != nil { - return flowRecord, err - } - flowRecord.Data = sampledIPv6 - case FORMAT_EXT_ROUTER: - extendedRouter := ExtendedRouter{} - - ipVersion, ip, err := DecodeIP(payload) - if err != nil { - return flowRecord, err - } - extendedRouter.NextHopIPVersion = ipVersion - extendedRouter.NextHop = ip - err = utils.BinaryDecoder(payload, &extendedRouter.SrcMaskLen, &extendedRouter.DstMaskLen) - if err != nil { - return flowRecord, err - } - flowRecord.Data = extendedRouter - case FORMAT_EXT_GATEWAY: - extendedGateway := ExtendedGateway{} - ipVersion, ip, err := DecodeIP(payload) - if err != nil { - return flowRecord, err - } - extendedGateway.NextHopIPVersion = ipVersion - extendedGateway.NextHop = ip - err = utils.BinaryDecoder(payload, &extendedGateway.AS, &extendedGateway.SrcAS, &extendedGateway.SrcPeerAS, - &extendedGateway.ASDestinations) - if err != nil { - return flowRecord, err - } - var asPath []uint32 - if extendedGateway.ASDestinations != 0 { - err := utils.BinaryDecoder(payload, &extendedGateway.ASPathType, &extendedGateway.ASPathLength) - if err != nil { - return flowRecord, err - } - if int(extendedGateway.ASPathLength) > payload.Len()-4 { - return flowRecord, errors.New(fmt.Sprintf("Invalid AS path length: %v.", extendedGateway.ASPathLength)) - } - - if extendedGateway.ASPathLength > MAX_ATTRS { - return flowRecord, fmt.Errorf("AS path too large (%d > %d) in record", extendedGateway.ASPathLength, MAX_ATTRS) - } - - asPath = make([]uint32, extendedGateway.ASPathLength) - if len(asPath) > 0 { - err = utils.BinaryDecoder(payload, asPath) - if err != nil { - return flowRecord, err - } - } - } - extendedGateway.ASPath = asPath - - err = utils.BinaryDecoder(payload, &extendedGateway.CommunitiesLength) - if err != nil { - return flowRecord, err - } - if extendedGateway.CommunitiesLength > MAX_ATTRS { - return flowRecord, fmt.Errorf("Communities list too large (%d > %d) in record", extendedGateway.CommunitiesLength, MAX_ATTRS) - } - - if int(extendedGateway.CommunitiesLength) > payload.Len()-4 { - return flowRecord, errors.New(fmt.Sprintf("Invalid Communities length: %v.", extendedGateway.ASPathLength)) - } - communities := make([]uint32, extendedGateway.CommunitiesLength) - if len(communities) > 0 { - err = utils.BinaryDecoder(payload, communities) - if err != nil { - return flowRecord, err - } - } - err = utils.BinaryDecoder(payload, &extendedGateway.LocalPref) - if err != nil { - return flowRecord, err - } - extendedGateway.Communities = communities - - flowRecord.Data = extendedGateway - default: - //return flowRecord, errors.New(fmt.Sprintf("Unknown data format %v.", (*header).DataFormat)) - flowRecord.Data = &FlowRecordRaw{ - Data: payload.Next(int(header.Length)), - } - } - return flowRecord, nil -} - -func DecodeSample(header *SampleHeader, payload *bytes.Buffer) (interface{}, error) { - format := header.Format - var sample interface{} - - err := utils.BinaryDecoder(payload, &header.SampleSequenceNumber) - if err != nil { - return sample, err - } - if format == FORMAT_RAW_PKT || format == FORMAT_ETH { - var sourceId uint32 - err = utils.BinaryDecoder(payload, &sourceId) - if err != nil { - return sample, err - } - - (*header).SourceIdType = sourceId >> 24 - (*header).SourceIdValue = sourceId & 0x00ffffff - } else if format == FORMAT_IPV4 || format == FORMAT_IPV6 { - err = utils.BinaryDecoder(payload, &header.SourceIdType, &header.SourceIdValue) - if err != nil { - return sample, err - } - } else { - return nil, NewErrorDataFormat(format) - } - - var recordsCount uint32 - var flowSample FlowSample - var counterSample CounterSample - var expandedFlowSample ExpandedFlowSample - if format == FORMAT_RAW_PKT { - flowSample = FlowSample{ - Header: *header, - } - err = utils.BinaryDecoder(payload, &flowSample.SamplingRate, &flowSample.SamplePool, - &flowSample.Drops, &flowSample.Input, &flowSample.Output, &flowSample.FlowRecordsCount) - if err != nil { - return sample, err - } - recordsCount = flowSample.FlowRecordsCount - - if recordsCount > MAX_RECORDS { - return flowSample, fmt.Errorf("Too many records (%d > %d) in packet", recordsCount, MAX_RECORDS) - } - - flowSample.Records = make([]FlowRecord, recordsCount) - sample = flowSample - } else if format == FORMAT_ETH || format == FORMAT_IPV6 { - err = utils.BinaryDecoder(payload, &recordsCount) - if err != nil { - return sample, err - } - counterSample = CounterSample{ - Header: *header, - CounterRecordsCount: recordsCount, - } - - if recordsCount > MAX_RECORDS { - return flowSample, fmt.Errorf("Too many records (%d > %d) in packet", recordsCount, MAX_RECORDS) - } - counterSample.Records = make([]CounterRecord, recordsCount) - sample = counterSample - } else if format == FORMAT_IPV4 { - expandedFlowSample = ExpandedFlowSample{ - Header: *header, - } - err = utils.BinaryDecoder(payload, &expandedFlowSample.SamplingRate, &expandedFlowSample.SamplePool, - &expandedFlowSample.Drops, &expandedFlowSample.InputIfFormat, &expandedFlowSample.InputIfValue, - &expandedFlowSample.OutputIfFormat, &expandedFlowSample.OutputIfValue, &expandedFlowSample.FlowRecordsCount) - if err != nil { - return sample, err - } - recordsCount = expandedFlowSample.FlowRecordsCount - - if recordsCount > MAX_RECORDS { - return flowSample, fmt.Errorf("Too many records (%d > %d) in packet", recordsCount, MAX_RECORDS) - } - expandedFlowSample.Records = make([]FlowRecord, recordsCount) - sample = expandedFlowSample - } - for i := 0; i < int(recordsCount) && payload.Len() >= 8; i++ { - recordHeader := RecordHeader{} - err = utils.BinaryDecoder(payload, &recordHeader.DataFormat, &recordHeader.Length) - if err != nil { - return sample, err - } - if int(recordHeader.Length) > payload.Len() { - break - } - recordReader := bytes.NewBuffer(payload.Next(int(recordHeader.Length))) - if format == FORMAT_RAW_PKT || format == FORMAT_IPV4 { - record, err := DecodeFlowRecord(&recordHeader, recordReader) - if err != nil { - continue - } - if format == FORMAT_RAW_PKT { - flowSample.Records[i] = record - } else if format == FORMAT_IPV4 { - expandedFlowSample.Records[i] = record - } - } else if format == FORMAT_ETH || format == FORMAT_IPV6 { - record, err := DecodeCounterRecord(&recordHeader, recordReader) - if err != nil { - continue - } - counterSample.Records[i] = record - } - } - return sample, nil -} - -func DecodeMessage(payload *bytes.Buffer) (interface{}, error) { - var version uint32 - err := utils.BinaryDecoder(payload, &version) - if err != nil { - return nil, err - } - packetV5 := Packet{} - if version == 5 { - packetV5.Version = version - err = utils.BinaryDecoder(payload, &(packetV5.IPVersion)) - if err != nil { - return packetV5, err - } - var ip []byte - if packetV5.IPVersion == 1 { - ip = make([]byte, 4) - err = utils.BinaryDecoder(payload, ip) - if err != nil { - return packetV5, err - } - } else if packetV5.IPVersion == 2 { - ip = make([]byte, 16) - err = utils.BinaryDecoder(payload, ip) - if err != nil { - return packetV5, err - } - } else { - return nil, NewErrorIPVersion(packetV5.IPVersion) - } - - packetV5.AgentIP = ip - err = utils.BinaryDecoder(payload, &packetV5.SubAgentId, &packetV5.SequenceNumber, &packetV5.Uptime, &packetV5.SamplesCount) - if err != nil { - return packetV5, err - } - - if packetV5.SamplesCount > MAX_SAMPLES { - return nil, fmt.Errorf("Too many samples (%d > %d) in packet", packetV5.SamplesCount, MAX_SAMPLES) - } - - packetV5.Samples = make([]interface{}, int(packetV5.SamplesCount)) - for i := 0; i < int(packetV5.SamplesCount) && payload.Len() >= 8; i++ { - header := SampleHeader{} - err = utils.BinaryDecoder(payload, &(header.Format), &(header.Length)) - if err != nil { - return packetV5, err - } - if int(header.Length) > payload.Len() { - break - } - sampleReader := bytes.NewBuffer(payload.Next(int(header.Length))) - - sample, err := DecodeSample(&header, sampleReader) - if err != nil { - continue - } else { - packetV5.Samples[i] = sample - } - } - - return packetV5, nil - } else { - return nil, NewErrorVersion(version) - } -} diff --git a/vendor/github.com/netsampler/goflow2/decoders/utils/utils.go b/vendor/github.com/netsampler/goflow2/decoders/utils/utils.go deleted file mode 100644 index 9c8e597f..00000000 --- a/vendor/github.com/netsampler/goflow2/decoders/utils/utils.go +++ /dev/null @@ -1,128 +0,0 @@ -package utils - -import ( - "bytes" - "encoding/binary" - "errors" - "io" - "reflect" -) - -type BytesBuffer interface { - io.Reader - Next(int) []byte -} - -func BinaryDecoder(payload *bytes.Buffer, dests ...interface{}) error { - for _, dest := range dests { - err := BinaryRead(payload, binary.BigEndian, dest) - if err != nil { - return err - } - } - return nil -} -func BinaryRead(payload BytesBuffer, order binary.ByteOrder, data any) error { - // Fast path for basic types and slices. - if n := intDataSize(data); n != 0 { - bs := payload.Next(n) - if len(bs) < n { - return io.ErrUnexpectedEOF - } - switch data := data.(type) { - case *bool: - *data = bs[0] != 0 - case *int8: - *data = int8(bs[0]) - case *uint8: - *data = bs[0] - case *int16: - *data = int16(order.Uint16(bs)) - case *uint16: - *data = order.Uint16(bs) - case *int32: - *data = int32(order.Uint32(bs)) - case *uint32: - *data = order.Uint32(bs) - case *int64: - *data = int64(order.Uint64(bs)) - case *uint64: - *data = order.Uint64(bs) - case []bool: - for i, x := range bs { // Easier to loop over the input for 8-bit values. - data[i] = x != 0 - } - case []int8: - for i, x := range bs { - data[i] = int8(x) - } - case []uint8: - copy(data, bs) - case []int16: - for i := range data { - data[i] = int16(order.Uint16(bs[2*i:])) - } - case []uint16: - for i := range data { - data[i] = order.Uint16(bs[2*i:]) - } - case []int32: - for i := range data { - data[i] = int32(order.Uint32(bs[4*i:])) - } - case []uint32: - for i := range data { - data[i] = order.Uint32(bs[4*i:]) - } - case []int64: - for i := range data { - data[i] = int64(order.Uint64(bs[8*i:])) - } - case []uint64: - for i := range data { - data[i] = order.Uint64(bs[8*i:]) - } - default: - n = 0 // fast path doesn't apply - } - if n != 0 { - return nil - } - } - - return errors.New("binary.Read: invalid type " + reflect.TypeOf(data).String()) -} - -// intDataSize returns the size of the data required to represent the data when encoded. -// It returns zero if the type cannot be implemented by the fast path in Read or Write. -func intDataSize(data any) int { - switch data := data.(type) { - case bool, int8, uint8, *bool, *int8, *uint8: - return 1 - case []bool: - return len(data) - case []int8: - return len(data) - case []uint8: - return len(data) - case int16, uint16, *int16, *uint16: - return 2 - case []int16: - return 2 * len(data) - case []uint16: - return 2 * len(data) - case int32, uint32, *int32, *uint32: - return 4 - case []int32: - return 4 * len(data) - case []uint32: - return 4 * len(data) - case int64, uint64, *int64, *uint64: - return 8 - case []int64: - return 8 * len(data) - case []uint64: - return 8 * len(data) - } - return 0 -} diff --git a/vendor/github.com/netsampler/goflow2/pb/flow.pb.go b/vendor/github.com/netsampler/goflow2/pb/flow.pb.go deleted file mode 100644 index 4b3402ce..00000000 --- a/vendor/github.com/netsampler/goflow2/pb/flow.pb.go +++ /dev/null @@ -1,924 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.21.4 -// source: pb/flow.proto - -package flowpb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type FlowMessage_FlowType int32 - -const ( - FlowMessage_FLOWUNKNOWN FlowMessage_FlowType = 0 - FlowMessage_SFLOW_5 FlowMessage_FlowType = 1 - FlowMessage_NETFLOW_V5 FlowMessage_FlowType = 2 - FlowMessage_NETFLOW_V9 FlowMessage_FlowType = 3 - FlowMessage_IPFIX FlowMessage_FlowType = 4 -) - -// Enum value maps for FlowMessage_FlowType. -var ( - FlowMessage_FlowType_name = map[int32]string{ - 0: "FLOWUNKNOWN", - 1: "SFLOW_5", - 2: "NETFLOW_V5", - 3: "NETFLOW_V9", - 4: "IPFIX", - } - FlowMessage_FlowType_value = map[string]int32{ - "FLOWUNKNOWN": 0, - "SFLOW_5": 1, - "NETFLOW_V5": 2, - "NETFLOW_V9": 3, - "IPFIX": 4, - } -) - -func (x FlowMessage_FlowType) Enum() *FlowMessage_FlowType { - p := new(FlowMessage_FlowType) - *p = x - return p -} - -func (x FlowMessage_FlowType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (FlowMessage_FlowType) Descriptor() protoreflect.EnumDescriptor { - return file_pb_flow_proto_enumTypes[0].Descriptor() -} - -func (FlowMessage_FlowType) Type() protoreflect.EnumType { - return &file_pb_flow_proto_enumTypes[0] -} - -func (x FlowMessage_FlowType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use FlowMessage_FlowType.Descriptor instead. -func (FlowMessage_FlowType) EnumDescriptor() ([]byte, []int) { - return file_pb_flow_proto_rawDescGZIP(), []int{0, 0} -} - -type FlowMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type FlowMessage_FlowType `protobuf:"varint,1,opt,name=type,proto3,enum=flowpb.FlowMessage_FlowType" json:"type,omitempty"` - TimeReceived uint64 `protobuf:"varint,2,opt,name=time_received,json=timeReceived,proto3" json:"time_received,omitempty"` - SequenceNum uint32 `protobuf:"varint,4,opt,name=sequence_num,json=sequenceNum,proto3" json:"sequence_num,omitempty"` - SamplingRate uint64 `protobuf:"varint,3,opt,name=sampling_rate,json=samplingRate,proto3" json:"sampling_rate,omitempty"` - FlowDirection uint32 `protobuf:"varint,42,opt,name=flow_direction,json=flowDirection,proto3" json:"flow_direction,omitempty"` - // Sampler information - SamplerAddress []byte `protobuf:"bytes,11,opt,name=sampler_address,json=samplerAddress,proto3" json:"sampler_address,omitempty"` - // Found inside packet - TimeFlowStart uint64 `protobuf:"varint,38,opt,name=time_flow_start,json=timeFlowStart,proto3" json:"time_flow_start,omitempty"` - TimeFlowEnd uint64 `protobuf:"varint,5,opt,name=time_flow_end,json=timeFlowEnd,proto3" json:"time_flow_end,omitempty"` - TimeFlowStartMs uint64 `protobuf:"varint,63,opt,name=time_flow_start_ms,json=timeFlowStartMs,proto3" json:"time_flow_start_ms,omitempty"` - TimeFlowEndMs uint64 `protobuf:"varint,64,opt,name=time_flow_end_ms,json=timeFlowEndMs,proto3" json:"time_flow_end_ms,omitempty"` - // Size of the sampled packet - Bytes uint64 `protobuf:"varint,9,opt,name=bytes,proto3" json:"bytes,omitempty"` - Packets uint64 `protobuf:"varint,10,opt,name=packets,proto3" json:"packets,omitempty"` - // Source/destination addresses - SrcAddr []byte `protobuf:"bytes,6,opt,name=src_addr,json=srcAddr,proto3" json:"src_addr,omitempty"` - DstAddr []byte `protobuf:"bytes,7,opt,name=dst_addr,json=dstAddr,proto3" json:"dst_addr,omitempty"` - // Layer 3 protocol (IPv4/IPv6/ARP/MPLS...) - Etype uint32 `protobuf:"varint,30,opt,name=etype,proto3" json:"etype,omitempty"` - // Layer 4 protocol - Proto uint32 `protobuf:"varint,20,opt,name=proto,proto3" json:"proto,omitempty"` - // Ports for UDP and TCP - SrcPort uint32 `protobuf:"varint,21,opt,name=src_port,json=srcPort,proto3" json:"src_port,omitempty"` - DstPort uint32 `protobuf:"varint,22,opt,name=dst_port,json=dstPort,proto3" json:"dst_port,omitempty"` - // Interfaces - InIf uint32 `protobuf:"varint,18,opt,name=in_if,json=inIf,proto3" json:"in_if,omitempty"` - OutIf uint32 `protobuf:"varint,19,opt,name=out_if,json=outIf,proto3" json:"out_if,omitempty"` - // Ethernet information - SrcMac uint64 `protobuf:"varint,27,opt,name=src_mac,json=srcMac,proto3" json:"src_mac,omitempty"` - DstMac uint64 `protobuf:"varint,28,opt,name=dst_mac,json=dstMac,proto3" json:"dst_mac,omitempty"` - // Vlan - SrcVlan uint32 `protobuf:"varint,33,opt,name=src_vlan,json=srcVlan,proto3" json:"src_vlan,omitempty"` - DstVlan uint32 `protobuf:"varint,34,opt,name=dst_vlan,json=dstVlan,proto3" json:"dst_vlan,omitempty"` - // 802.1q VLAN in sampled packet - VlanId uint32 `protobuf:"varint,29,opt,name=vlan_id,json=vlanId,proto3" json:"vlan_id,omitempty"` - // VRF - IngressVrfId uint32 `protobuf:"varint,39,opt,name=ingress_vrf_id,json=ingressVrfId,proto3" json:"ingress_vrf_id,omitempty"` - EgressVrfId uint32 `protobuf:"varint,40,opt,name=egress_vrf_id,json=egressVrfId,proto3" json:"egress_vrf_id,omitempty"` - // IP and TCP special flags - IpTos uint32 `protobuf:"varint,23,opt,name=ip_tos,json=ipTos,proto3" json:"ip_tos,omitempty"` - ForwardingStatus uint32 `protobuf:"varint,24,opt,name=forwarding_status,json=forwardingStatus,proto3" json:"forwarding_status,omitempty"` - IpTtl uint32 `protobuf:"varint,25,opt,name=ip_ttl,json=ipTtl,proto3" json:"ip_ttl,omitempty"` - TcpFlags uint32 `protobuf:"varint,26,opt,name=tcp_flags,json=tcpFlags,proto3" json:"tcp_flags,omitempty"` - IcmpType uint32 `protobuf:"varint,31,opt,name=icmp_type,json=icmpType,proto3" json:"icmp_type,omitempty"` - IcmpCode uint32 `protobuf:"varint,32,opt,name=icmp_code,json=icmpCode,proto3" json:"icmp_code,omitempty"` - Ipv6FlowLabel uint32 `protobuf:"varint,37,opt,name=ipv6_flow_label,json=ipv6FlowLabel,proto3" json:"ipv6_flow_label,omitempty"` - // Fragments (IPv4/IPv6) - FragmentId uint32 `protobuf:"varint,35,opt,name=fragment_id,json=fragmentId,proto3" json:"fragment_id,omitempty"` - FragmentOffset uint32 `protobuf:"varint,36,opt,name=fragment_offset,json=fragmentOffset,proto3" json:"fragment_offset,omitempty"` - BiFlowDirection uint32 `protobuf:"varint,41,opt,name=bi_flow_direction,json=biFlowDirection,proto3" json:"bi_flow_direction,omitempty"` - // Autonomous system information - SrcAs uint32 `protobuf:"varint,14,opt,name=src_as,json=srcAs,proto3" json:"src_as,omitempty"` - DstAs uint32 `protobuf:"varint,15,opt,name=dst_as,json=dstAs,proto3" json:"dst_as,omitempty"` - NextHop []byte `protobuf:"bytes,12,opt,name=next_hop,json=nextHop,proto3" json:"next_hop,omitempty"` - NextHopAs uint32 `protobuf:"varint,13,opt,name=next_hop_as,json=nextHopAs,proto3" json:"next_hop_as,omitempty"` - // Prefix size - SrcNet uint32 `protobuf:"varint,16,opt,name=src_net,json=srcNet,proto3" json:"src_net,omitempty"` - DstNet uint32 `protobuf:"varint,17,opt,name=dst_net,json=dstNet,proto3" json:"dst_net,omitempty"` - // BGP information - BgpNextHop []byte `protobuf:"bytes,100,opt,name=bgp_next_hop,json=bgpNextHop,proto3" json:"bgp_next_hop,omitempty"` - BgpCommunities []uint32 `protobuf:"varint,101,rep,packed,name=bgp_communities,json=bgpCommunities,proto3" json:"bgp_communities,omitempty"` - AsPath []uint32 `protobuf:"varint,102,rep,packed,name=as_path,json=asPath,proto3" json:"as_path,omitempty"` - // MPLS information - HasMpls bool `protobuf:"varint,53,opt,name=has_mpls,json=hasMpls,proto3" json:"has_mpls,omitempty"` - MplsCount uint32 `protobuf:"varint,54,opt,name=mpls_count,json=mplsCount,proto3" json:"mpls_count,omitempty"` - Mpls_1Ttl uint32 `protobuf:"varint,55,opt,name=mpls_1_ttl,json=mpls1Ttl,proto3" json:"mpls_1_ttl,omitempty"` // First TTL - Mpls_1Label uint32 `protobuf:"varint,56,opt,name=mpls_1_label,json=mpls1Label,proto3" json:"mpls_1_label,omitempty"` // First Label - Mpls_2Ttl uint32 `protobuf:"varint,57,opt,name=mpls_2_ttl,json=mpls2Ttl,proto3" json:"mpls_2_ttl,omitempty"` // Second TTL - Mpls_2Label uint32 `protobuf:"varint,58,opt,name=mpls_2_label,json=mpls2Label,proto3" json:"mpls_2_label,omitempty"` // Second Label - Mpls_3Ttl uint32 `protobuf:"varint,59,opt,name=mpls_3_ttl,json=mpls3Ttl,proto3" json:"mpls_3_ttl,omitempty"` // Third TTL - Mpls_3Label uint32 `protobuf:"varint,60,opt,name=mpls_3_label,json=mpls3Label,proto3" json:"mpls_3_label,omitempty"` // Third Label - MplsLastTtl uint32 `protobuf:"varint,61,opt,name=mpls_last_ttl,json=mplsLastTtl,proto3" json:"mpls_last_ttl,omitempty"` // Last TTL - MplsLastLabel uint32 `protobuf:"varint,62,opt,name=mpls_last_label,json=mplsLastLabel,proto3" json:"mpls_last_label,omitempty"` // Last Label - MplsLabelIp []byte `protobuf:"bytes,65,opt,name=mpls_label_ip,json=mplsLabelIp,proto3" json:"mpls_label_ip,omitempty"` // MPLS TOP Label IP - ObservationDomainId uint32 `protobuf:"varint,70,opt,name=observation_domain_id,json=observationDomainId,proto3" json:"observation_domain_id,omitempty"` - ObservationPointId uint32 `protobuf:"varint,71,opt,name=observation_point_id,json=observationPointId,proto3" json:"observation_point_id,omitempty"` - // Custom allocations - CustomInteger_1 uint64 `protobuf:"varint,1001,opt,name=custom_integer_1,json=customInteger1,proto3" json:"custom_integer_1,omitempty"` - CustomInteger_2 uint64 `protobuf:"varint,1002,opt,name=custom_integer_2,json=customInteger2,proto3" json:"custom_integer_2,omitempty"` - CustomInteger_3 uint64 `protobuf:"varint,1003,opt,name=custom_integer_3,json=customInteger3,proto3" json:"custom_integer_3,omitempty"` - CustomInteger_4 uint64 `protobuf:"varint,1004,opt,name=custom_integer_4,json=customInteger4,proto3" json:"custom_integer_4,omitempty"` - CustomInteger_5 uint64 `protobuf:"varint,1005,opt,name=custom_integer_5,json=customInteger5,proto3" json:"custom_integer_5,omitempty"` - CustomBytes_1 []byte `protobuf:"bytes,1011,opt,name=custom_bytes_1,json=customBytes1,proto3" json:"custom_bytes_1,omitempty"` - CustomBytes_2 []byte `protobuf:"bytes,1012,opt,name=custom_bytes_2,json=customBytes2,proto3" json:"custom_bytes_2,omitempty"` - CustomBytes_3 []byte `protobuf:"bytes,1013,opt,name=custom_bytes_3,json=customBytes3,proto3" json:"custom_bytes_3,omitempty"` - CustomBytes_4 []byte `protobuf:"bytes,1014,opt,name=custom_bytes_4,json=customBytes4,proto3" json:"custom_bytes_4,omitempty"` - CustomBytes_5 []byte `protobuf:"bytes,1015,opt,name=custom_bytes_5,json=customBytes5,proto3" json:"custom_bytes_5,omitempty"` - CustomList_1 []uint32 `protobuf:"varint,1021,rep,packed,name=custom_list_1,json=customList1,proto3" json:"custom_list_1,omitempty"` -} - -func (x *FlowMessage) Reset() { - *x = FlowMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_pb_flow_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FlowMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FlowMessage) ProtoMessage() {} - -func (x *FlowMessage) ProtoReflect() protoreflect.Message { - mi := &file_pb_flow_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FlowMessage.ProtoReflect.Descriptor instead. -func (*FlowMessage) Descriptor() ([]byte, []int) { - return file_pb_flow_proto_rawDescGZIP(), []int{0} -} - -func (x *FlowMessage) GetType() FlowMessage_FlowType { - if x != nil { - return x.Type - } - return FlowMessage_FLOWUNKNOWN -} - -func (x *FlowMessage) GetTimeReceived() uint64 { - if x != nil { - return x.TimeReceived - } - return 0 -} - -func (x *FlowMessage) GetSequenceNum() uint32 { - if x != nil { - return x.SequenceNum - } - return 0 -} - -func (x *FlowMessage) GetSamplingRate() uint64 { - if x != nil { - return x.SamplingRate - } - return 0 -} - -func (x *FlowMessage) GetFlowDirection() uint32 { - if x != nil { - return x.FlowDirection - } - return 0 -} - -func (x *FlowMessage) GetSamplerAddress() []byte { - if x != nil { - return x.SamplerAddress - } - return nil -} - -func (x *FlowMessage) GetTimeFlowStart() uint64 { - if x != nil { - return x.TimeFlowStart - } - return 0 -} - -func (x *FlowMessage) GetTimeFlowEnd() uint64 { - if x != nil { - return x.TimeFlowEnd - } - return 0 -} - -func (x *FlowMessage) GetTimeFlowStartMs() uint64 { - if x != nil { - return x.TimeFlowStartMs - } - return 0 -} - -func (x *FlowMessage) GetTimeFlowEndMs() uint64 { - if x != nil { - return x.TimeFlowEndMs - } - return 0 -} - -func (x *FlowMessage) GetBytes() uint64 { - if x != nil { - return x.Bytes - } - return 0 -} - -func (x *FlowMessage) GetPackets() uint64 { - if x != nil { - return x.Packets - } - return 0 -} - -func (x *FlowMessage) GetSrcAddr() []byte { - if x != nil { - return x.SrcAddr - } - return nil -} - -func (x *FlowMessage) GetDstAddr() []byte { - if x != nil { - return x.DstAddr - } - return nil -} - -func (x *FlowMessage) GetEtype() uint32 { - if x != nil { - return x.Etype - } - return 0 -} - -func (x *FlowMessage) GetProto() uint32 { - if x != nil { - return x.Proto - } - return 0 -} - -func (x *FlowMessage) GetSrcPort() uint32 { - if x != nil { - return x.SrcPort - } - return 0 -} - -func (x *FlowMessage) GetDstPort() uint32 { - if x != nil { - return x.DstPort - } - return 0 -} - -func (x *FlowMessage) GetInIf() uint32 { - if x != nil { - return x.InIf - } - return 0 -} - -func (x *FlowMessage) GetOutIf() uint32 { - if x != nil { - return x.OutIf - } - return 0 -} - -func (x *FlowMessage) GetSrcMac() uint64 { - if x != nil { - return x.SrcMac - } - return 0 -} - -func (x *FlowMessage) GetDstMac() uint64 { - if x != nil { - return x.DstMac - } - return 0 -} - -func (x *FlowMessage) GetSrcVlan() uint32 { - if x != nil { - return x.SrcVlan - } - return 0 -} - -func (x *FlowMessage) GetDstVlan() uint32 { - if x != nil { - return x.DstVlan - } - return 0 -} - -func (x *FlowMessage) GetVlanId() uint32 { - if x != nil { - return x.VlanId - } - return 0 -} - -func (x *FlowMessage) GetIngressVrfId() uint32 { - if x != nil { - return x.IngressVrfId - } - return 0 -} - -func (x *FlowMessage) GetEgressVrfId() uint32 { - if x != nil { - return x.EgressVrfId - } - return 0 -} - -func (x *FlowMessage) GetIpTos() uint32 { - if x != nil { - return x.IpTos - } - return 0 -} - -func (x *FlowMessage) GetForwardingStatus() uint32 { - if x != nil { - return x.ForwardingStatus - } - return 0 -} - -func (x *FlowMessage) GetIpTtl() uint32 { - if x != nil { - return x.IpTtl - } - return 0 -} - -func (x *FlowMessage) GetTcpFlags() uint32 { - if x != nil { - return x.TcpFlags - } - return 0 -} - -func (x *FlowMessage) GetIcmpType() uint32 { - if x != nil { - return x.IcmpType - } - return 0 -} - -func (x *FlowMessage) GetIcmpCode() uint32 { - if x != nil { - return x.IcmpCode - } - return 0 -} - -func (x *FlowMessage) GetIpv6FlowLabel() uint32 { - if x != nil { - return x.Ipv6FlowLabel - } - return 0 -} - -func (x *FlowMessage) GetFragmentId() uint32 { - if x != nil { - return x.FragmentId - } - return 0 -} - -func (x *FlowMessage) GetFragmentOffset() uint32 { - if x != nil { - return x.FragmentOffset - } - return 0 -} - -func (x *FlowMessage) GetBiFlowDirection() uint32 { - if x != nil { - return x.BiFlowDirection - } - return 0 -} - -func (x *FlowMessage) GetSrcAs() uint32 { - if x != nil { - return x.SrcAs - } - return 0 -} - -func (x *FlowMessage) GetDstAs() uint32 { - if x != nil { - return x.DstAs - } - return 0 -} - -func (x *FlowMessage) GetNextHop() []byte { - if x != nil { - return x.NextHop - } - return nil -} - -func (x *FlowMessage) GetNextHopAs() uint32 { - if x != nil { - return x.NextHopAs - } - return 0 -} - -func (x *FlowMessage) GetSrcNet() uint32 { - if x != nil { - return x.SrcNet - } - return 0 -} - -func (x *FlowMessage) GetDstNet() uint32 { - if x != nil { - return x.DstNet - } - return 0 -} - -func (x *FlowMessage) GetBgpNextHop() []byte { - if x != nil { - return x.BgpNextHop - } - return nil -} - -func (x *FlowMessage) GetBgpCommunities() []uint32 { - if x != nil { - return x.BgpCommunities - } - return nil -} - -func (x *FlowMessage) GetAsPath() []uint32 { - if x != nil { - return x.AsPath - } - return nil -} - -func (x *FlowMessage) GetHasMpls() bool { - if x != nil { - return x.HasMpls - } - return false -} - -func (x *FlowMessage) GetMplsCount() uint32 { - if x != nil { - return x.MplsCount - } - return 0 -} - -func (x *FlowMessage) GetMpls_1Ttl() uint32 { - if x != nil { - return x.Mpls_1Ttl - } - return 0 -} - -func (x *FlowMessage) GetMpls_1Label() uint32 { - if x != nil { - return x.Mpls_1Label - } - return 0 -} - -func (x *FlowMessage) GetMpls_2Ttl() uint32 { - if x != nil { - return x.Mpls_2Ttl - } - return 0 -} - -func (x *FlowMessage) GetMpls_2Label() uint32 { - if x != nil { - return x.Mpls_2Label - } - return 0 -} - -func (x *FlowMessage) GetMpls_3Ttl() uint32 { - if x != nil { - return x.Mpls_3Ttl - } - return 0 -} - -func (x *FlowMessage) GetMpls_3Label() uint32 { - if x != nil { - return x.Mpls_3Label - } - return 0 -} - -func (x *FlowMessage) GetMplsLastTtl() uint32 { - if x != nil { - return x.MplsLastTtl - } - return 0 -} - -func (x *FlowMessage) GetMplsLastLabel() uint32 { - if x != nil { - return x.MplsLastLabel - } - return 0 -} - -func (x *FlowMessage) GetMplsLabelIp() []byte { - if x != nil { - return x.MplsLabelIp - } - return nil -} - -func (x *FlowMessage) GetObservationDomainId() uint32 { - if x != nil { - return x.ObservationDomainId - } - return 0 -} - -func (x *FlowMessage) GetObservationPointId() uint32 { - if x != nil { - return x.ObservationPointId - } - return 0 -} - -func (x *FlowMessage) GetCustomInteger_1() uint64 { - if x != nil { - return x.CustomInteger_1 - } - return 0 -} - -func (x *FlowMessage) GetCustomInteger_2() uint64 { - if x != nil { - return x.CustomInteger_2 - } - return 0 -} - -func (x *FlowMessage) GetCustomInteger_3() uint64 { - if x != nil { - return x.CustomInteger_3 - } - return 0 -} - -func (x *FlowMessage) GetCustomInteger_4() uint64 { - if x != nil { - return x.CustomInteger_4 - } - return 0 -} - -func (x *FlowMessage) GetCustomInteger_5() uint64 { - if x != nil { - return x.CustomInteger_5 - } - return 0 -} - -func (x *FlowMessage) GetCustomBytes_1() []byte { - if x != nil { - return x.CustomBytes_1 - } - return nil -} - -func (x *FlowMessage) GetCustomBytes_2() []byte { - if x != nil { - return x.CustomBytes_2 - } - return nil -} - -func (x *FlowMessage) GetCustomBytes_3() []byte { - if x != nil { - return x.CustomBytes_3 - } - return nil -} - -func (x *FlowMessage) GetCustomBytes_4() []byte { - if x != nil { - return x.CustomBytes_4 - } - return nil -} - -func (x *FlowMessage) GetCustomBytes_5() []byte { - if x != nil { - return x.CustomBytes_5 - } - return nil -} - -func (x *FlowMessage) GetCustomList_1() []uint32 { - if x != nil { - return x.CustomList_1 - } - return nil -} - -var File_pb_flow_proto protoreflect.FileDescriptor - -var file_pb_flow_proto_rawDesc = []byte{ - 0x0a, 0x0d, 0x70, 0x62, 0x2f, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x06, 0x66, 0x6c, 0x6f, 0x77, 0x70, 0x62, 0x22, 0x90, 0x13, 0x0a, 0x0b, 0x46, 0x6c, 0x6f, 0x77, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x66, 0x6c, 0x6f, 0x77, 0x70, 0x62, 0x2e, 0x46, - 0x6c, 0x6f, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x46, 0x6c, 0x6f, 0x77, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x69, 0x6d, - 0x65, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, 0x21, - 0x0a, 0x0c, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x4e, 0x75, - 0x6d, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x61, - 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x69, - 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x64, - 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, - 0x66, 0x6c, 0x6f, 0x77, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, - 0x0f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x66, - 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x26, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x46, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x22, - 0x0a, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x65, 0x6e, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x46, 0x6c, 0x6f, 0x77, 0x45, - 0x6e, 0x64, 0x12, 0x2b, 0x0a, 0x12, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x66, 0x6c, 0x6f, 0x77, 0x5f, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6d, 0x73, 0x18, 0x3f, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, - 0x74, 0x69, 0x6d, 0x65, 0x46, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x72, 0x74, 0x4d, 0x73, 0x12, - 0x27, 0x0a, 0x10, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x65, 0x6e, 0x64, - 0x5f, 0x6d, 0x73, 0x18, 0x40, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x46, - 0x6c, 0x6f, 0x77, 0x45, 0x6e, 0x64, 0x4d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x18, - 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x07, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x72, 0x63, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x72, 0x63, 0x41, - 0x64, 0x64, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x64, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x12, 0x14, - 0x0a, 0x05, 0x65, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x65, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x18, 0x14, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x72, - 0x63, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x73, 0x72, - 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x73, 0x74, 0x5f, 0x70, 0x6f, 0x72, - 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x64, 0x73, 0x74, 0x50, 0x6f, 0x72, 0x74, - 0x12, 0x13, 0x0a, 0x05, 0x69, 0x6e, 0x5f, 0x69, 0x66, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x04, 0x69, 0x6e, 0x49, 0x66, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x5f, 0x69, 0x66, 0x18, - 0x13, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6f, 0x75, 0x74, 0x49, 0x66, 0x12, 0x17, 0x0a, 0x07, - 0x73, 0x72, 0x63, 0x5f, 0x6d, 0x61, 0x63, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x73, - 0x72, 0x63, 0x4d, 0x61, 0x63, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x73, 0x74, 0x5f, 0x6d, 0x61, 0x63, - 0x18, 0x1c, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x64, 0x73, 0x74, 0x4d, 0x61, 0x63, 0x12, 0x19, - 0x0a, 0x08, 0x73, 0x72, 0x63, 0x5f, 0x76, 0x6c, 0x61, 0x6e, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x07, 0x73, 0x72, 0x63, 0x56, 0x6c, 0x61, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x73, 0x74, - 0x5f, 0x76, 0x6c, 0x61, 0x6e, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x64, 0x73, 0x74, - 0x56, 0x6c, 0x61, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x76, 0x6c, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x1d, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x76, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x24, 0x0a, - 0x0e, 0x69, 0x6e, 0x67, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x76, 0x72, 0x66, 0x5f, 0x69, 0x64, 0x18, - 0x27, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x69, 0x6e, 0x67, 0x72, 0x65, 0x73, 0x73, 0x56, 0x72, - 0x66, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x65, 0x67, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x76, 0x72, - 0x66, 0x5f, 0x69, 0x64, 0x18, 0x28, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x65, 0x67, 0x72, 0x65, - 0x73, 0x73, 0x56, 0x72, 0x66, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x70, 0x5f, 0x74, 0x6f, - 0x73, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x70, 0x54, 0x6f, 0x73, 0x12, 0x2b, - 0x0a, 0x11, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x66, 0x6f, 0x72, 0x77, 0x61, - 0x72, 0x64, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x69, - 0x70, 0x5f, 0x74, 0x74, 0x6c, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x70, 0x54, - 0x74, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x63, 0x70, 0x5f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, - 0x1a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x74, 0x63, 0x70, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x12, - 0x1b, 0x0a, 0x09, 0x69, 0x63, 0x6d, 0x70, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x1f, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x08, 0x69, 0x63, 0x6d, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, - 0x69, 0x63, 0x6d, 0x70, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x08, 0x69, 0x63, 0x6d, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x69, 0x70, 0x76, - 0x36, 0x5f, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x25, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0d, 0x69, 0x70, 0x76, 0x36, 0x46, 0x6c, 0x6f, 0x77, 0x4c, 0x61, 0x62, 0x65, - 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x23, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, - 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x24, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x66, 0x72, 0x61, - 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x62, - 0x69, 0x5f, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x29, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x62, 0x69, 0x46, 0x6c, 0x6f, 0x77, 0x44, 0x69, - 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x72, 0x63, 0x5f, 0x61, - 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x72, 0x63, 0x41, 0x73, 0x12, 0x15, - 0x0a, 0x06, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x64, 0x73, 0x74, 0x41, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x68, 0x6f, - 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, - 0x12, 0x1e, 0x0a, 0x0b, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x68, 0x6f, 0x70, 0x5f, 0x61, 0x73, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x48, 0x6f, 0x70, 0x41, 0x73, - 0x12, 0x17, 0x0a, 0x07, 0x73, 0x72, 0x63, 0x5f, 0x6e, 0x65, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x06, 0x73, 0x72, 0x63, 0x4e, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x73, 0x74, - 0x5f, 0x6e, 0x65, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x64, 0x73, 0x74, 0x4e, - 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x62, 0x67, 0x70, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x68, - 0x6f, 0x70, 0x18, 0x64, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x62, 0x67, 0x70, 0x4e, 0x65, 0x78, - 0x74, 0x48, 0x6f, 0x70, 0x12, 0x27, 0x0a, 0x0f, 0x62, 0x67, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, - 0x75, 0x6e, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x65, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0e, 0x62, - 0x67, 0x70, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x17, 0x0a, - 0x07, 0x61, 0x73, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x66, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, - 0x61, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x70, - 0x6c, 0x73, 0x18, 0x35, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x4d, 0x70, 0x6c, - 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x70, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x36, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6d, 0x70, 0x6c, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x1c, 0x0a, 0x0a, 0x6d, 0x70, 0x6c, 0x73, 0x5f, 0x31, 0x5f, 0x74, 0x74, 0x6c, 0x18, 0x37, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x6d, 0x70, 0x6c, 0x73, 0x31, 0x54, 0x74, 0x6c, 0x12, 0x20, - 0x0a, 0x0c, 0x6d, 0x70, 0x6c, 0x73, 0x5f, 0x31, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x38, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x70, 0x6c, 0x73, 0x31, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x12, 0x1c, 0x0a, 0x0a, 0x6d, 0x70, 0x6c, 0x73, 0x5f, 0x32, 0x5f, 0x74, 0x74, 0x6c, 0x18, 0x39, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x6d, 0x70, 0x6c, 0x73, 0x32, 0x54, 0x74, 0x6c, 0x12, 0x20, - 0x0a, 0x0c, 0x6d, 0x70, 0x6c, 0x73, 0x5f, 0x32, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x3a, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x70, 0x6c, 0x73, 0x32, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x12, 0x1c, 0x0a, 0x0a, 0x6d, 0x70, 0x6c, 0x73, 0x5f, 0x33, 0x5f, 0x74, 0x74, 0x6c, 0x18, 0x3b, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x6d, 0x70, 0x6c, 0x73, 0x33, 0x54, 0x74, 0x6c, 0x12, 0x20, - 0x0a, 0x0c, 0x6d, 0x70, 0x6c, 0x73, 0x5f, 0x33, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x3c, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x70, 0x6c, 0x73, 0x33, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x12, 0x22, 0x0a, 0x0d, 0x6d, 0x70, 0x6c, 0x73, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x74, 0x74, - 0x6c, 0x18, 0x3d, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x6d, 0x70, 0x6c, 0x73, 0x4c, 0x61, 0x73, - 0x74, 0x54, 0x74, 0x6c, 0x12, 0x26, 0x0a, 0x0f, 0x6d, 0x70, 0x6c, 0x73, 0x5f, 0x6c, 0x61, 0x73, - 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x3e, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6d, - 0x70, 0x6c, 0x73, 0x4c, 0x61, 0x73, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x22, 0x0a, 0x0d, - 0x6d, 0x70, 0x6c, 0x73, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x69, 0x70, 0x18, 0x41, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x6d, 0x70, 0x6c, 0x73, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x49, 0x70, - 0x12, 0x32, 0x0a, 0x15, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x46, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x13, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x47, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x12, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x5f, 0x31, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, - 0x31, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x69, 0x6e, 0x74, 0x65, - 0x67, 0x65, 0x72, 0x5f, 0x32, 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x63, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x32, 0x12, 0x29, 0x0a, 0x10, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x5f, 0x33, - 0x18, 0xeb, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x49, - 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x33, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x5f, 0x34, 0x18, 0xec, 0x07, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x65, - 0x72, 0x34, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x69, 0x6e, 0x74, - 0x65, 0x67, 0x65, 0x72, 0x5f, 0x35, 0x18, 0xed, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x63, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x35, 0x12, 0x25, 0x0a, - 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x31, 0x18, - 0xf3, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x79, - 0x74, 0x65, 0x73, 0x31, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, - 0x79, 0x74, 0x65, 0x73, 0x5f, 0x32, 0x18, 0xf4, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x79, 0x74, 0x65, 0x73, 0x32, 0x12, 0x25, 0x0a, 0x0e, 0x63, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x33, 0x18, 0xf5, 0x07, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x33, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x62, 0x79, 0x74, - 0x65, 0x73, 0x5f, 0x34, 0x18, 0xf6, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x42, 0x79, 0x74, 0x65, 0x73, 0x34, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x35, 0x18, 0xf7, 0x07, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x42, 0x79, 0x74, 0x65, 0x73, 0x35, - 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, - 0x31, 0x18, 0xfd, 0x07, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x4c, 0x69, 0x73, 0x74, 0x31, 0x22, 0x53, 0x0a, 0x08, 0x46, 0x6c, 0x6f, 0x77, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x46, 0x4c, 0x4f, 0x57, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, - 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x35, 0x10, 0x01, 0x12, - 0x0e, 0x0a, 0x0a, 0x4e, 0x45, 0x54, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x56, 0x35, 0x10, 0x02, 0x12, - 0x0e, 0x0a, 0x0a, 0x4e, 0x45, 0x54, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x56, 0x39, 0x10, 0x03, 0x12, - 0x09, 0x0a, 0x05, 0x49, 0x50, 0x46, 0x49, 0x58, 0x10, 0x04, 0x42, 0x29, 0x5a, 0x27, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x65, 0x74, 0x73, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x72, 0x2f, 0x67, 0x6f, 0x66, 0x6c, 0x6f, 0x77, 0x32, 0x2f, 0x70, 0x62, 0x3b, 0x66, - 0x6c, 0x6f, 0x77, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_pb_flow_proto_rawDescOnce sync.Once - file_pb_flow_proto_rawDescData = file_pb_flow_proto_rawDesc -) - -func file_pb_flow_proto_rawDescGZIP() []byte { - file_pb_flow_proto_rawDescOnce.Do(func() { - file_pb_flow_proto_rawDescData = protoimpl.X.CompressGZIP(file_pb_flow_proto_rawDescData) - }) - return file_pb_flow_proto_rawDescData -} - -var file_pb_flow_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_pb_flow_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_pb_flow_proto_goTypes = []interface{}{ - (FlowMessage_FlowType)(0), // 0: flowpb.FlowMessage.FlowType - (*FlowMessage)(nil), // 1: flowpb.FlowMessage -} -var file_pb_flow_proto_depIdxs = []int32{ - 0, // 0: flowpb.FlowMessage.type:type_name -> flowpb.FlowMessage.FlowType - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_pb_flow_proto_init() } -func file_pb_flow_proto_init() { - if File_pb_flow_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_pb_flow_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FlowMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_pb_flow_proto_rawDesc, - NumEnums: 1, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_pb_flow_proto_goTypes, - DependencyIndexes: file_pb_flow_proto_depIdxs, - EnumInfos: file_pb_flow_proto_enumTypes, - MessageInfos: file_pb_flow_proto_msgTypes, - }.Build() - File_pb_flow_proto = out.File - file_pb_flow_proto_rawDesc = nil - file_pb_flow_proto_goTypes = nil - file_pb_flow_proto_depIdxs = nil -} diff --git a/vendor/github.com/netsampler/goflow2/pb/flow.proto b/vendor/github.com/netsampler/goflow2/pb/flow.proto deleted file mode 100644 index 1cbaae8d..00000000 --- a/vendor/github.com/netsampler/goflow2/pb/flow.proto +++ /dev/null @@ -1,131 +0,0 @@ -syntax = "proto3"; -package flowpb; -option go_package = "github.com/netsampler/goflow2/pb;flowpb"; - -message FlowMessage { - - enum FlowType { - FLOWUNKNOWN = 0; - SFLOW_5 = 1; - NETFLOW_V5 = 2; - NETFLOW_V9 = 3; - IPFIX = 4; - } - FlowType type = 1; - - uint64 time_received = 2; - uint32 sequence_num = 4; - uint64 sampling_rate = 3; - - uint32 flow_direction = 42; - - // Sampler information - bytes sampler_address = 11; - - // Found inside packet - uint64 time_flow_start = 38; - uint64 time_flow_end = 5; - uint64 time_flow_start_ms = 63; - uint64 time_flow_end_ms = 64; - - // Size of the sampled packet - uint64 bytes = 9; - uint64 packets = 10; - - // Source/destination addresses - bytes src_addr = 6; - bytes dst_addr = 7; - - // Layer 3 protocol (IPv4/IPv6/ARP/MPLS...) - uint32 etype = 30; - - // Layer 4 protocol - uint32 proto = 20; - - // Ports for UDP and TCP - uint32 src_port = 21; - uint32 dst_port = 22; - - // Interfaces - uint32 in_if = 18; - uint32 out_if = 19; - - // Ethernet information - uint64 src_mac = 27; - uint64 dst_mac = 28; - - // Vlan - uint32 src_vlan = 33; - uint32 dst_vlan = 34; - // 802.1q VLAN in sampled packet - uint32 vlan_id = 29; - - // VRF - uint32 ingress_vrf_id = 39; - uint32 egress_vrf_id = 40; - - // IP and TCP special flags - uint32 ip_tos = 23; - uint32 forwarding_status = 24; - uint32 ip_ttl = 25; - uint32 tcp_flags = 26; - uint32 icmp_type = 31; - uint32 icmp_code = 32; - uint32 ipv6_flow_label = 37; - // Fragments (IPv4/IPv6) - uint32 fragment_id = 35; - uint32 fragment_offset = 36; - uint32 bi_flow_direction = 41; - - // Autonomous system information - uint32 src_as = 14; - uint32 dst_as = 15; - - bytes next_hop = 12; - uint32 next_hop_as = 13; - - // Prefix size - uint32 src_net = 16; - uint32 dst_net = 17; - - // BGP information - bytes bgp_next_hop = 100; - repeated uint32 bgp_communities = 101; - repeated uint32 as_path = 102; - - // MPLS information - bool has_mpls = 53; - uint32 mpls_count = 54; - uint32 mpls_1_ttl = 55; // First TTL - uint32 mpls_1_label = 56; // First Label - uint32 mpls_2_ttl = 57; // Second TTL - uint32 mpls_2_label = 58; // Second Label - uint32 mpls_3_ttl = 59; // Third TTL - uint32 mpls_3_label = 60; // Third Label - uint32 mpls_last_ttl = 61; // Last TTL - uint32 mpls_last_label = 62; // Last Label - bytes mpls_label_ip = 65; // MPLS TOP Label IP - - uint32 observation_domain_id = 70; - uint32 observation_point_id = 71; - - // Custom fields: start after ID 1000: - // uint32 my_custom_field = 1000; - - - // Custom allocations - uint64 custom_integer_1 = 1001; - uint64 custom_integer_2 = 1002; - uint64 custom_integer_3 = 1003; - uint64 custom_integer_4 = 1004; - uint64 custom_integer_5 = 1005; - - bytes custom_bytes_1 = 1011; - bytes custom_bytes_2 = 1012; - bytes custom_bytes_3 = 1013; - bytes custom_bytes_4 = 1014; - bytes custom_bytes_5 = 1015; - - repeated uint32 custom_list_1 = 1021; - -} diff --git a/vendor/github.com/netsampler/goflow2/producer/producer_nf.go b/vendor/github.com/netsampler/goflow2/producer/producer_nf.go deleted file mode 100644 index d1493655..00000000 --- a/vendor/github.com/netsampler/goflow2/producer/producer_nf.go +++ /dev/null @@ -1,683 +0,0 @@ -package producer - -import ( - "bytes" - "encoding/binary" - "errors" - "fmt" - "net" - "sync" - "time" - - "github.com/netsampler/goflow2/decoders/netflow" - "github.com/netsampler/goflow2/decoders/utils" - flowmessage "github.com/netsampler/goflow2/pb" -) - -type SamplingRateSystem interface { - GetSamplingRate(version uint16, obsDomainId uint32) (uint32, error) - AddSamplingRate(version uint16, obsDomainId uint32, samplingRate uint32) -} - -type basicSamplingRateSystem struct { - sampling map[uint16]map[uint32]uint32 - samplinglock *sync.RWMutex -} - -func CreateSamplingSystem() SamplingRateSystem { - ts := &basicSamplingRateSystem{ - sampling: make(map[uint16]map[uint32]uint32), - samplinglock: &sync.RWMutex{}, - } - return ts -} - -func (s *basicSamplingRateSystem) AddSamplingRate(version uint16, obsDomainId uint32, samplingRate uint32) { - s.samplinglock.Lock() - defer s.samplinglock.Unlock() - _, exists := s.sampling[version] - if exists != true { - s.sampling[version] = make(map[uint32]uint32) - } - s.sampling[version][obsDomainId] = samplingRate -} - -func (s *basicSamplingRateSystem) GetSamplingRate(version uint16, obsDomainId uint32) (uint32, error) { - s.samplinglock.RLock() - defer s.samplinglock.RUnlock() - samplingVersion, okver := s.sampling[version] - if okver { - samplingRate, okid := samplingVersion[obsDomainId] - if okid { - return samplingRate, nil - } - return 0, errors.New("") // TBC - } - return 0, errors.New("") // TBC -} - -type SingleSamplingRateSystem struct { - Sampling uint32 -} - -func (s *SingleSamplingRateSystem) AddSamplingRate(version uint16, obsDomainId uint32, samplingRate uint32) { -} - -func (s *SingleSamplingRateSystem) GetSamplingRate(version uint16, obsDomainId uint32) (uint32, error) { - return s.Sampling, nil -} - -func NetFlowLookFor(dataFields []netflow.DataField, typeId uint16) (bool, interface{}) { - for _, dataField := range dataFields { - if dataField.Type == typeId { - return true, dataField.Value - } - } - return false, nil -} - -func NetFlowPopulate(dataFields []netflow.DataField, typeId uint16, addr interface{}) bool { - exists, value := NetFlowLookFor(dataFields, typeId) - if exists && value != nil { - valueBytes, ok := value.([]byte) - valueReader := bytes.NewBuffer(valueBytes) - if ok { - switch addrt := addr.(type) { - case *(net.IP): - *addrt = valueBytes - case *(time.Time): - t := uint64(0) - utils.BinaryRead(valueReader, binary.BigEndian, &t) - t64 := int64(t / 1000) - *addrt = time.Unix(t64, 0) - default: - utils.BinaryRead(valueReader, binary.BigEndian, addr) - } - } - } - return exists -} - -func WriteUDecoded(o uint64, out interface{}) error { - switch t := out.(type) { - case *byte: - *t = byte(o) - case *uint16: - *t = uint16(o) - case *uint32: - *t = uint32(o) - case *uint64: - *t = o - default: - return errors.New("The parameter is not a pointer to a byte/uint16/uint32/uint64 structure") - } - return nil -} - -func WriteDecoded(o int64, out interface{}) error { - switch t := out.(type) { - case *int8: - *t = int8(o) - case *int16: - *t = int16(o) - case *int32: - *t = int32(o) - case *int64: - *t = o - default: - return errors.New("The parameter is not a pointer to a int8/int16/int32/int64 structure") - } - return nil -} - -func DecodeUNumber(b []byte, out interface{}) error { - var o uint64 - l := len(b) - switch l { - case 1: - o = uint64(b[0]) - case 2: - o = uint64(binary.BigEndian.Uint16(b)) - case 4: - o = uint64(binary.BigEndian.Uint32(b)) - case 8: - o = binary.BigEndian.Uint64(b) - default: - if l < 8 { - var iter uint - for i := range b { - o |= uint64(b[i]) << uint(8*(uint(l)-iter-1)) - iter++ - } - } else { - return errors.New(fmt.Sprintf("Non-regular number of bytes for a number: %v", l)) - } - } - return WriteUDecoded(o, out) -} - -func DecodeUNumberLE(b []byte, out interface{}) error { - var o uint64 - l := len(b) - switch l { - case 1: - o = uint64(b[0]) - case 2: - o = uint64(binary.LittleEndian.Uint16(b)) - case 4: - o = uint64(binary.LittleEndian.Uint32(b)) - case 8: - o = binary.LittleEndian.Uint64(b) - default: - if l < 8 { - var iter uint - for i := range b { - o |= uint64(b[i]) << uint(8*(iter)) - iter++ - } - } else { - return errors.New(fmt.Sprintf("Non-regular number of bytes for a number: %v", l)) - } - } - return WriteUDecoded(o, out) -} - -func DecodeNumber(b []byte, out interface{}) error { - var o int64 - l := len(b) - switch l { - case 1: - o = int64(int8(b[0])) - case 2: - o = int64(int16(binary.BigEndian.Uint16(b))) - case 4: - o = int64(int32(binary.BigEndian.Uint32(b))) - case 8: - o = int64(binary.BigEndian.Uint64(b)) - default: - if l < 8 { - var iter int - for i := range b { - o |= int64(b[i]) << int(8*(int(l)-iter-1)) - iter++ - } - } else { - return errors.New(fmt.Sprintf("Non-regular number of bytes for a number: %v", l)) - } - } - return WriteDecoded(o, out) -} - -func DecodeNumberLE(b []byte, out interface{}) error { - var o int64 - l := len(b) - switch l { - case 1: - o = int64(int8(b[0])) - case 2: - o = int64(int16(binary.LittleEndian.Uint16(b))) - case 4: - o = int64(int32(binary.LittleEndian.Uint32(b))) - case 8: - o = int64(binary.LittleEndian.Uint64(b)) - default: - if l < 8 { - var iter int - for i := range b { - o |= int64(b[i]) << int(8*(iter)) - iter++ - } - } else { - return errors.New(fmt.Sprintf("Non-regular number of bytes for a number: %v", l)) - } - } - return WriteDecoded(o, out) -} - -func allZeroes(v []byte) bool { - for _, b := range v { - if b != 0 { - return false - } - } - return true -} - -func addrReplaceCheck(dstAddr *[]byte, v []byte, eType *uint32, ipv6 bool) { - if (len(*dstAddr) == 0 && len(v) > 0) || - (len(*dstAddr) != 0 && len(v) > 0 && !allZeroes(v)) { - *dstAddr = v - - if ipv6 { - *eType = 0x86dd - } else { - *eType = 0x800 - } - - } -} - -func ConvertNetFlowDataSet(version uint16, baseTime uint32, uptime uint32, record []netflow.DataField, mapperNetFlow *NetFlowMapper, mapperSFlow *SFlowMapper) *flowmessage.FlowMessage { - flowMessage := &flowmessage.FlowMessage{} - var time uint64 - - if version == 9 { - flowMessage.Type = flowmessage.FlowMessage_NETFLOW_V9 - } else if version == 10 { - flowMessage.Type = flowmessage.FlowMessage_IPFIX - } - - for i := range record { - df := record[i] - - v, ok := df.Value.([]byte) - if !ok { - continue - } - - MapCustomNetFlow(flowMessage, df, mapperNetFlow) - - if df.PenProvided { - continue - } - - switch df.Type { - - case netflow.IPFIX_FIELD_observationPointId: - DecodeUNumber(v, &(flowMessage.ObservationPointId)) - - // Statistics - case netflow.NFV9_FIELD_IN_BYTES: - DecodeUNumber(v, &(flowMessage.Bytes)) - case netflow.NFV9_FIELD_IN_PKTS: - DecodeUNumber(v, &(flowMessage.Packets)) - case netflow.NFV9_FIELD_OUT_BYTES: - DecodeUNumber(v, &(flowMessage.Bytes)) - case netflow.NFV9_FIELD_OUT_PKTS: - DecodeUNumber(v, &(flowMessage.Packets)) - - // L4 - case netflow.NFV9_FIELD_L4_SRC_PORT: - DecodeUNumber(v, &(flowMessage.SrcPort)) - case netflow.NFV9_FIELD_L4_DST_PORT: - DecodeUNumber(v, &(flowMessage.DstPort)) - case netflow.NFV9_FIELD_PROTOCOL: - DecodeUNumber(v, &(flowMessage.Proto)) - - // Network - case netflow.NFV9_FIELD_SRC_AS: - DecodeUNumber(v, &(flowMessage.SrcAs)) - case netflow.NFV9_FIELD_DST_AS: - DecodeUNumber(v, &(flowMessage.DstAs)) - - // Interfaces - case netflow.NFV9_FIELD_INPUT_SNMP: - DecodeUNumber(v, &(flowMessage.InIf)) - case netflow.NFV9_FIELD_OUTPUT_SNMP: - DecodeUNumber(v, &(flowMessage.OutIf)) - - case netflow.NFV9_FIELD_FORWARDING_STATUS: - DecodeUNumber(v, &(flowMessage.ForwardingStatus)) - case netflow.NFV9_FIELD_SRC_TOS: - DecodeUNumber(v, &(flowMessage.IpTos)) - case netflow.NFV9_FIELD_TCP_FLAGS: - DecodeUNumber(v, &(flowMessage.TcpFlags)) - case netflow.NFV9_FIELD_MIN_TTL: - DecodeUNumber(v, &(flowMessage.IpTtl)) - - // IP - case netflow.NFV9_FIELD_IP_PROTOCOL_VERSION: - if len(v) > 0 { - if v[0] == 4 { - flowMessage.Etype = 0x800 - } else if v[0] == 6 { - flowMessage.Etype = 0x86dd - } - } - - case netflow.NFV9_FIELD_IPV4_SRC_ADDR: - addrReplaceCheck(&(flowMessage.SrcAddr), v, &(flowMessage.Etype), false) - - case netflow.NFV9_FIELD_IPV4_DST_ADDR: - addrReplaceCheck(&(flowMessage.DstAddr), v, &(flowMessage.Etype), false) - - case netflow.NFV9_FIELD_SRC_MASK: - DecodeUNumber(v, &(flowMessage.SrcNet)) - case netflow.NFV9_FIELD_DST_MASK: - DecodeUNumber(v, &(flowMessage.DstNet)) - - case netflow.NFV9_FIELD_IPV6_SRC_ADDR: - addrReplaceCheck(&(flowMessage.SrcAddr), v, &(flowMessage.Etype), true) - - case netflow.NFV9_FIELD_IPV6_DST_ADDR: - addrReplaceCheck(&(flowMessage.DstAddr), v, &(flowMessage.Etype), true) - - case netflow.NFV9_FIELD_IPV6_SRC_MASK: - DecodeUNumber(v, &(flowMessage.SrcNet)) - case netflow.NFV9_FIELD_IPV6_DST_MASK: - DecodeUNumber(v, &(flowMessage.DstNet)) - - case netflow.NFV9_FIELD_IPV4_NEXT_HOP: - flowMessage.NextHop = v - case netflow.NFV9_FIELD_BGP_IPV4_NEXT_HOP: - flowMessage.BgpNextHop = v - - case netflow.NFV9_FIELD_IPV6_NEXT_HOP: - flowMessage.NextHop = v - case netflow.NFV9_FIELD_BGP_IPV6_NEXT_HOP: - flowMessage.BgpNextHop = v - - // ICMP - case netflow.NFV9_FIELD_ICMP_TYPE: - var icmpTypeCode uint16 - DecodeUNumber(v, &icmpTypeCode) - flowMessage.IcmpType = uint32(icmpTypeCode >> 8) - flowMessage.IcmpCode = uint32(icmpTypeCode & 0xff) - case netflow.IPFIX_FIELD_icmpTypeCodeIPv6: - var icmpTypeCode uint16 - DecodeUNumber(v, &icmpTypeCode) - flowMessage.IcmpType = uint32(icmpTypeCode >> 8) - flowMessage.IcmpCode = uint32(icmpTypeCode & 0xff) - case netflow.IPFIX_FIELD_icmpTypeIPv4: - DecodeUNumber(v, &(flowMessage.IcmpType)) - case netflow.IPFIX_FIELD_icmpTypeIPv6: - DecodeUNumber(v, &(flowMessage.IcmpType)) - case netflow.IPFIX_FIELD_icmpCodeIPv4: - DecodeUNumber(v, &(flowMessage.IcmpCode)) - case netflow.IPFIX_FIELD_icmpCodeIPv6: - DecodeUNumber(v, &(flowMessage.IcmpCode)) - - // Mac - case netflow.NFV9_FIELD_IN_SRC_MAC: - DecodeUNumber(v, &(flowMessage.SrcMac)) - case netflow.NFV9_FIELD_IN_DST_MAC: - DecodeUNumber(v, &(flowMessage.DstMac)) - case netflow.NFV9_FIELD_OUT_SRC_MAC: - DecodeUNumber(v, &(flowMessage.SrcMac)) - case netflow.NFV9_FIELD_OUT_DST_MAC: - DecodeUNumber(v, &(flowMessage.DstMac)) - - case netflow.NFV9_FIELD_SRC_VLAN: - DecodeUNumber(v, &(flowMessage.VlanId)) - DecodeUNumber(v, &(flowMessage.SrcVlan)) - case netflow.NFV9_FIELD_DST_VLAN: - DecodeUNumber(v, &(flowMessage.DstVlan)) - - case netflow.IPFIX_FIELD_ingressVRFID: - DecodeUNumber(v, &(flowMessage.IngressVrfId)) - case netflow.IPFIX_FIELD_egressVRFID: - DecodeUNumber(v, &(flowMessage.EgressVrfId)) - - case netflow.NFV9_FIELD_IPV4_IDENT: - DecodeUNumber(v, &(flowMessage.FragmentId)) - case netflow.NFV9_FIELD_FRAGMENT_OFFSET: - var fragOffset uint32 - DecodeUNumber(v, &fragOffset) - flowMessage.FragmentOffset |= fragOffset - case netflow.IPFIX_FIELD_fragmentFlags: - var ipFlags uint32 - DecodeUNumber(v, &ipFlags) - flowMessage.FragmentOffset |= ipFlags - case netflow.NFV9_FIELD_IPV6_FLOW_LABEL: - DecodeUNumber(v, &(flowMessage.Ipv6FlowLabel)) - - case netflow.IPFIX_FIELD_biflowDirection: - DecodeUNumber(v, &(flowMessage.BiFlowDirection)) - - case netflow.NFV9_FIELD_DIRECTION: - DecodeUNumber(v, &(flowMessage.FlowDirection)) - - // MPLS - case netflow.IPFIX_FIELD_mplsTopLabelStackSection: - var mplsLabel uint32 - DecodeUNumber(v, &mplsLabel) - flowMessage.Mpls_1Label = uint32(mplsLabel >> 4) - flowMessage.HasMpls = true - case netflow.IPFIX_FIELD_mplsLabelStackSection2: - var mplsLabel uint32 - DecodeUNumber(v, &mplsLabel) - flowMessage.Mpls_2Label = uint32(mplsLabel >> 4) - case netflow.IPFIX_FIELD_mplsLabelStackSection3: - var mplsLabel uint32 - DecodeUNumber(v, &mplsLabel) - flowMessage.Mpls_3Label = uint32(mplsLabel >> 4) - case netflow.IPFIX_FIELD_mplsTopLabelIPv4Address: - flowMessage.MplsLabelIp = v - case netflow.IPFIX_FIELD_mplsTopLabelIPv6Address: - flowMessage.MplsLabelIp = v - - default: - if version == 9 { - // NetFlow v9 time works with a differential based on router's uptime - switch df.Type { - case netflow.NFV9_FIELD_FIRST_SWITCHED: - var timeFirstSwitched uint32 - DecodeUNumber(v, &timeFirstSwitched) - timeDiff := (uptime - timeFirstSwitched) - flowMessage.TimeFlowStart = uint64(baseTime - timeDiff/1000) - flowMessage.TimeFlowStartMs = uint64(baseTime)*1000 - uint64(timeDiff) - case netflow.NFV9_FIELD_LAST_SWITCHED: - var timeLastSwitched uint32 - DecodeUNumber(v, &timeLastSwitched) - timeDiff := (uptime - timeLastSwitched) - flowMessage.TimeFlowEnd = uint64(baseTime - timeDiff/1000) - flowMessage.TimeFlowEndMs = uint64(baseTime)*1000 - uint64(timeDiff) - } - } else if version == 10 { - switch df.Type { - case netflow.IPFIX_FIELD_flowStartSeconds: - DecodeUNumber(v, &time) - flowMessage.TimeFlowStart = time - flowMessage.TimeFlowStartMs = time * 1000 - case netflow.IPFIX_FIELD_flowStartMilliseconds: - DecodeUNumber(v, &time) - flowMessage.TimeFlowStart = time / 1000 - flowMessage.TimeFlowStartMs = time - case netflow.IPFIX_FIELD_flowStartMicroseconds: - DecodeUNumber(v, &time) - flowMessage.TimeFlowStart = time / 1000000 - flowMessage.TimeFlowStartMs = time / 1000 - case netflow.IPFIX_FIELD_flowStartNanoseconds: - DecodeUNumber(v, &time) - flowMessage.TimeFlowStart = time / 1000000000 - flowMessage.TimeFlowStartMs = time / 1000000 - case netflow.IPFIX_FIELD_flowEndSeconds: - DecodeUNumber(v, &time) - flowMessage.TimeFlowEnd = time - flowMessage.TimeFlowEndMs = time * 1000 - case netflow.IPFIX_FIELD_flowEndMilliseconds: - DecodeUNumber(v, &time) - flowMessage.TimeFlowEnd = time / 1000 - flowMessage.TimeFlowEndMs = time - case netflow.IPFIX_FIELD_flowEndMicroseconds: - DecodeUNumber(v, &time) - flowMessage.TimeFlowEnd = time / 1000000 - flowMessage.TimeFlowEndMs = time / 1000 - case netflow.IPFIX_FIELD_flowEndNanoseconds: - DecodeUNumber(v, &time) - flowMessage.TimeFlowEnd = time / 1000000000 - flowMessage.TimeFlowEndMs = time / 1000000 - case netflow.IPFIX_FIELD_flowStartDeltaMicroseconds: - DecodeUNumber(v, &time) - flowMessage.TimeFlowStart = uint64(baseTime) - time/1000000 - flowMessage.TimeFlowStartMs = uint64(baseTime)*1000 - time/1000 - case netflow.IPFIX_FIELD_flowEndDeltaMicroseconds: - DecodeUNumber(v, &time) - flowMessage.TimeFlowEnd = uint64(baseTime) - time/1000000 - flowMessage.TimeFlowEndMs = uint64(baseTime)*1000 - time/1000 - // RFC7133 - case netflow.IPFIX_FIELD_dataLinkFrameSize: - DecodeUNumber(v, &(flowMessage.Bytes)) - flowMessage.Packets = 1 - case netflow.IPFIX_FIELD_dataLinkFrameSection: - ParseEthernetHeader(flowMessage, v, mapperSFlow) - flowMessage.Packets = 1 - if flowMessage.Bytes == 0 { - flowMessage.Bytes = uint64(len(v)) - } - } - } - } - - } - - return flowMessage -} - -func SearchNetFlowDataSetsRecords(version uint16, baseTime uint32, uptime uint32, dataRecords []netflow.DataRecord, mapperNetFlow *NetFlowMapper, mapperSFlow *SFlowMapper) []*flowmessage.FlowMessage { - var flowMessageSet []*flowmessage.FlowMessage - for _, record := range dataRecords { - fmsg := ConvertNetFlowDataSet(version, baseTime, uptime, record.Values, mapperNetFlow, mapperSFlow) - if fmsg != nil { - flowMessageSet = append(flowMessageSet, fmsg) - } - } - return flowMessageSet -} - -func SearchNetFlowDataSets(version uint16, baseTime uint32, uptime uint32, dataFlowSet []netflow.DataFlowSet, mapperNetFlow *NetFlowMapper, mapperSFlow *SFlowMapper) []*flowmessage.FlowMessage { - var flowMessageSet []*flowmessage.FlowMessage - for _, dataFlowSetItem := range dataFlowSet { - fmsg := SearchNetFlowDataSetsRecords(version, baseTime, uptime, dataFlowSetItem.Records, mapperNetFlow, mapperSFlow) - if fmsg != nil { - flowMessageSet = append(flowMessageSet, fmsg...) - } - } - return flowMessageSet -} - -func SearchNetFlowOptionDataSets(dataFlowSet []netflow.OptionsDataFlowSet) (uint32, bool) { - var samplingRate uint32 - var found bool - for _, dataFlowSetItem := range dataFlowSet { - for _, record := range dataFlowSetItem.Records { - b := NetFlowPopulate(record.OptionsValues, 305, &samplingRate) - if b { - return samplingRate, b - } - b = NetFlowPopulate(record.OptionsValues, 50, &samplingRate) - if b { - return samplingRate, b - } - b = NetFlowPopulate(record.OptionsValues, 34, &samplingRate) - if b { - return samplingRate, b - } - } - } - return samplingRate, found -} - -func SplitNetFlowSets(packetNFv9 netflow.NFv9Packet) ([]netflow.DataFlowSet, []netflow.TemplateFlowSet, []netflow.NFv9OptionsTemplateFlowSet, []netflow.OptionsDataFlowSet) { - var dataFlowSet []netflow.DataFlowSet - var templatesFlowSet []netflow.TemplateFlowSet - var optionsTemplatesFlowSet []netflow.NFv9OptionsTemplateFlowSet - var optionsDataFlowSet []netflow.OptionsDataFlowSet - for _, flowSet := range packetNFv9.FlowSets { - switch tFlowSet := flowSet.(type) { - case netflow.TemplateFlowSet: - templatesFlowSet = append(templatesFlowSet, tFlowSet) - case netflow.NFv9OptionsTemplateFlowSet: - optionsTemplatesFlowSet = append(optionsTemplatesFlowSet, tFlowSet) - case netflow.DataFlowSet: - dataFlowSet = append(dataFlowSet, tFlowSet) - case netflow.OptionsDataFlowSet: - optionsDataFlowSet = append(optionsDataFlowSet, tFlowSet) - } - } - return dataFlowSet, templatesFlowSet, optionsTemplatesFlowSet, optionsDataFlowSet -} - -func SplitIPFIXSets(packetIPFIX netflow.IPFIXPacket) ([]netflow.DataFlowSet, []netflow.TemplateFlowSet, []netflow.IPFIXOptionsTemplateFlowSet, []netflow.OptionsDataFlowSet) { - var dataFlowSet []netflow.DataFlowSet - var templatesFlowSet []netflow.TemplateFlowSet - var optionsTemplatesFlowSet []netflow.IPFIXOptionsTemplateFlowSet - var optionsDataFlowSet []netflow.OptionsDataFlowSet - for _, flowSet := range packetIPFIX.FlowSets { - switch tFlowSet := flowSet.(type) { - case netflow.TemplateFlowSet: - templatesFlowSet = append(templatesFlowSet, tFlowSet) - case netflow.IPFIXOptionsTemplateFlowSet: - optionsTemplatesFlowSet = append(optionsTemplatesFlowSet, tFlowSet) - case netflow.DataFlowSet: - dataFlowSet = append(dataFlowSet, tFlowSet) - case netflow.OptionsDataFlowSet: - optionsDataFlowSet = append(optionsDataFlowSet, tFlowSet) - } - } - return dataFlowSet, templatesFlowSet, optionsTemplatesFlowSet, optionsDataFlowSet -} - -func ProcessMessageNetFlow(msgDec interface{}, samplingRateSys SamplingRateSystem) ([]*flowmessage.FlowMessage, error) { - return ProcessMessageNetFlowConfig(msgDec, samplingRateSys, nil) -} - -// Convert a NetFlow datastructure to a FlowMessage protobuf -// Does not put sampling rate -func ProcessMessageNetFlowConfig(msgDec interface{}, samplingRateSys SamplingRateSystem, config *ProducerConfigMapped) ([]*flowmessage.FlowMessage, error) { - seqnum := uint32(0) - var baseTime uint32 - var uptime uint32 - - var flowMessageSet []*flowmessage.FlowMessage - - switch msgDecConv := msgDec.(type) { - case netflow.NFv9Packet: - dataFlowSet, _, _, optionDataFlowSet := SplitNetFlowSets(msgDecConv) - - seqnum = msgDecConv.SequenceNumber - baseTime = msgDecConv.UnixSeconds - uptime = msgDecConv.SystemUptime - obsDomainId := msgDecConv.SourceId - - var cfg *NetFlowMapper - if config != nil { - cfg = config.NetFlowV9 - } - flowMessageSet = SearchNetFlowDataSets(9, baseTime, uptime, dataFlowSet, cfg, nil) - samplingRate, found := SearchNetFlowOptionDataSets(optionDataFlowSet) - if samplingRateSys != nil { - if found { - samplingRateSys.AddSamplingRate(9, obsDomainId, samplingRate) - } else { - samplingRate, _ = samplingRateSys.GetSamplingRate(9, obsDomainId) - } - } - for _, fmsg := range flowMessageSet { - fmsg.SequenceNum = seqnum - fmsg.SamplingRate = uint64(samplingRate) - } - case netflow.IPFIXPacket: - dataFlowSet, _, _, optionDataFlowSet := SplitIPFIXSets(msgDecConv) - - seqnum = msgDecConv.SequenceNumber - baseTime = msgDecConv.ExportTime - obsDomainId := msgDecConv.ObservationDomainId - - var cfgIpfix *NetFlowMapper - var cfgSflow *SFlowMapper - if config != nil { - cfgIpfix = config.IPFIX - cfgSflow = config.SFlow - } - flowMessageSet = SearchNetFlowDataSets(10, baseTime, uptime, dataFlowSet, cfgIpfix, cfgSflow) - - samplingRate, found := SearchNetFlowOptionDataSets(optionDataFlowSet) - if samplingRateSys != nil { - if found { - samplingRateSys.AddSamplingRate(10, obsDomainId, samplingRate) - } else { - samplingRate, _ = samplingRateSys.GetSamplingRate(10, obsDomainId) - } - } - for _, fmsg := range flowMessageSet { - fmsg.SequenceNum = seqnum - fmsg.SamplingRate = uint64(samplingRate) - fmsg.ObservationDomainId = obsDomainId - } - default: - return flowMessageSet, errors.New("Bad NetFlow/IPFIX version") - } - - return flowMessageSet, nil -} diff --git a/vendor/github.com/netsampler/goflow2/producer/producer_nflegacy.go b/vendor/github.com/netsampler/goflow2/producer/producer_nflegacy.go deleted file mode 100644 index 8acb3eea..00000000 --- a/vendor/github.com/netsampler/goflow2/producer/producer_nflegacy.go +++ /dev/null @@ -1,81 +0,0 @@ -package producer - -import ( - "encoding/binary" - "errors" - "net" - - "github.com/netsampler/goflow2/decoders/netflowlegacy" - flowmessage "github.com/netsampler/goflow2/pb" -) - -func ConvertNetFlowLegacyRecord(baseTime uint32, uptime uint32, record netflowlegacy.RecordsNetFlowV5) *flowmessage.FlowMessage { - flowMessage := &flowmessage.FlowMessage{} - - flowMessage.Type = flowmessage.FlowMessage_NETFLOW_V5 - - timeDiffFirst := (uptime - record.First) - timeDiffLast := (uptime - record.Last) - flowMessage.TimeFlowStart = uint64(baseTime - timeDiffFirst/1000) - flowMessage.TimeFlowStartMs = uint64(baseTime)*1000 - uint64(timeDiffFirst) - flowMessage.TimeFlowEnd = uint64(baseTime - timeDiffLast/1000) - flowMessage.TimeFlowEndMs = uint64(baseTime)*1000 - uint64(timeDiffLast) - - v := make(net.IP, 4) - binary.BigEndian.PutUint32(v, record.NextHop) - flowMessage.NextHop = v - v = make(net.IP, 4) - binary.BigEndian.PutUint32(v, record.SrcAddr) - flowMessage.SrcAddr = v - v = make(net.IP, 4) - binary.BigEndian.PutUint32(v, record.DstAddr) - flowMessage.DstAddr = v - - flowMessage.Etype = 0x800 - flowMessage.SrcAs = uint32(record.SrcAS) - flowMessage.DstAs = uint32(record.DstAS) - flowMessage.SrcNet = uint32(record.SrcMask) - flowMessage.DstNet = uint32(record.DstMask) - flowMessage.Proto = uint32(record.Proto) - flowMessage.TcpFlags = uint32(record.TCPFlags) - flowMessage.IpTos = uint32(record.Tos) - flowMessage.InIf = uint32(record.Input) - flowMessage.OutIf = uint32(record.Output) - flowMessage.SrcPort = uint32(record.SrcPort) - flowMessage.DstPort = uint32(record.DstPort) - flowMessage.Packets = uint64(record.DPkts) - flowMessage.Bytes = uint64(record.DOctets) - - return flowMessage -} - -func SearchNetFlowLegacyRecords(baseTime uint32, uptime uint32, dataRecords []netflowlegacy.RecordsNetFlowV5) []*flowmessage.FlowMessage { - var flowMessageSet []*flowmessage.FlowMessage - for _, record := range dataRecords { - fmsg := ConvertNetFlowLegacyRecord(baseTime, uptime, record) - if fmsg != nil { - flowMessageSet = append(flowMessageSet, fmsg) - } - } - return flowMessageSet -} - -func ProcessMessageNetFlowLegacy(msgDec interface{}) ([]*flowmessage.FlowMessage, error) { - switch packet := msgDec.(type) { - case netflowlegacy.PacketNetFlowV5: - seqnum := packet.FlowSequence - samplingRate := packet.SamplingInterval - baseTime := packet.UnixSecs - uptime := packet.SysUptime - - flowMessageSet := SearchNetFlowLegacyRecords(baseTime, uptime, packet.Records) - for _, fmsg := range flowMessageSet { - fmsg.SequenceNum = seqnum - fmsg.SamplingRate = uint64(samplingRate) - } - - return flowMessageSet, nil - default: - return []*flowmessage.FlowMessage{}, errors.New("Bad NetFlow v5 version") - } -} diff --git a/vendor/github.com/netsampler/goflow2/producer/producer_sf.go b/vendor/github.com/netsampler/goflow2/producer/producer_sf.go deleted file mode 100644 index ab949144..00000000 --- a/vendor/github.com/netsampler/goflow2/producer/producer_sf.go +++ /dev/null @@ -1,349 +0,0 @@ -package producer - -import ( - "encoding/binary" - "errors" - "net" - - "github.com/netsampler/goflow2/decoders/sflow" - flowmessage "github.com/netsampler/goflow2/pb" -) - -func GetSFlowFlowSamples(packet *sflow.Packet) []interface{} { - var flowSamples []interface{} - for _, sample := range packet.Samples { - switch sample.(type) { - case sflow.FlowSample: - flowSamples = append(flowSamples, sample) - case sflow.ExpandedFlowSample: - flowSamples = append(flowSamples, sample) - } - } - return flowSamples -} - -func ParseSampledHeader(flowMessage *flowmessage.FlowMessage, sampledHeader *sflow.SampledHeader) error { - return ParseSampledHeaderConfig(flowMessage, sampledHeader, nil) -} - -func ParseEthernetHeader(flowMessage *flowmessage.FlowMessage, data []byte, config *SFlowMapper) { - var hasMpls bool - var countMpls uint32 - var firstLabelMpls uint32 - var firstTtlMpls uint8 - var secondLabelMpls uint32 - var secondTtlMpls uint8 - var thirdLabelMpls uint32 - var thirdTtlMpls uint8 - var lastLabelMpls uint32 - var lastTtlMpls uint8 - - var nextHeader byte - var tcpflags byte - srcIP := net.IP{} - dstIP := net.IP{} - offset := 14 - - var srcMac uint64 - var dstMac uint64 - - var tos byte - var ttl byte - var identification uint16 - var fragOffset uint16 - var flowLabel uint32 - - var srcPort uint16 - var dstPort uint16 - - for _, configLayer := range GetSFlowConfigLayer(config, 0) { - extracted := GetBytes(data, configLayer.Offset, configLayer.Length) - MapCustom(flowMessage, extracted, configLayer.Destination, configLayer.Endian) - } - - etherType := data[12:14] - - dstMac = binary.BigEndian.Uint64(append([]byte{0, 0}, data[0:6]...)) - srcMac = binary.BigEndian.Uint64(append([]byte{0, 0}, data[6:12]...)) - (*flowMessage).SrcMac = srcMac - (*flowMessage).DstMac = dstMac - - encap := true - iterations := 0 - for encap && iterations <= 1 { - encap = false - - if etherType[0] == 0x81 && etherType[1] == 0x0 { // VLAN 802.1Q - (*flowMessage).VlanId = uint32(binary.BigEndian.Uint16(data[14:16])) - offset += 4 - etherType = data[16:18] - } - - if etherType[0] == 0x88 && etherType[1] == 0x47 { // MPLS - iterateMpls := true - hasMpls = true - for iterateMpls { - if len(data) < offset+5 { - iterateMpls = false - break - } - label := binary.BigEndian.Uint32(append([]byte{0}, data[offset:offset+3]...)) >> 4 - //exp := data[offset+2] > 1 - bottom := data[offset+2] & 1 - mplsTtl := data[offset+3] - offset += 4 - - if bottom == 1 || label <= 15 || offset > len(data) { - if data[offset]&0xf0>>4 == 4 { - etherType = []byte{0x8, 0x0} - } else if data[offset]&0xf0>>4 == 6 { - etherType = []byte{0x86, 0xdd} - } - iterateMpls = false - } - - if countMpls == 0 { - firstLabelMpls = label - firstTtlMpls = mplsTtl - } else if countMpls == 1 { - secondLabelMpls = label - secondTtlMpls = mplsTtl - } else if countMpls == 2 { - thirdLabelMpls = label - thirdTtlMpls = mplsTtl - } else { - lastLabelMpls = label - lastTtlMpls = mplsTtl - } - countMpls++ - } - } - - for _, configLayer := range GetSFlowConfigLayer(config, 3) { - extracted := GetBytes(data, offset*8+configLayer.Offset, configLayer.Length) - MapCustom(flowMessage, extracted, configLayer.Destination, configLayer.Endian) - } - - if etherType[0] == 0x8 && etherType[1] == 0x0 { // IPv4 - if len(data) >= offset+20 { - nextHeader = data[offset+9] - srcIP = data[offset+12 : offset+16] - dstIP = data[offset+16 : offset+20] - tos = data[offset+1] - ttl = data[offset+8] - - identification = binary.BigEndian.Uint16(data[offset+4 : offset+6]) - fragOffset = binary.BigEndian.Uint16(data[offset+6:offset+8]) & 8191 - - offset += 20 - } - } else if etherType[0] == 0x86 && etherType[1] == 0xdd { // IPv6 - if len(data) >= offset+40 { - nextHeader = data[offset+6] - srcIP = data[offset+8 : offset+24] - dstIP = data[offset+24 : offset+40] - - tostmp := uint32(binary.BigEndian.Uint16(data[offset : offset+2])) - tos = uint8(tostmp & 0x0ff0 >> 4) - ttl = data[offset+7] - - flowLabel = binary.BigEndian.Uint32(data[offset : offset+4]) - - offset += 40 - - } - } else if etherType[0] == 0x8 && etherType[1] == 0x6 { // ARP - } /*else { - return errors.New(fmt.Sprintf("Unknown EtherType: %v\n", etherType)) - } */ - - for _, configLayer := range GetSFlowConfigLayer(config, 4) { - extracted := GetBytes(data, offset*8+configLayer.Offset, configLayer.Length) - MapCustom(flowMessage, extracted, configLayer.Destination, configLayer.Endian) - } - - appOffset := 0 - if len(data) >= offset+4 && (nextHeader == 17 || nextHeader == 6) && fragOffset&8191 == 0 { - srcPort = binary.BigEndian.Uint16(data[offset+0 : offset+2]) - dstPort = binary.BigEndian.Uint16(data[offset+2 : offset+4]) - } - - if nextHeader == 17 { - appOffset = 8 - } - - if len(data) > offset+13 && nextHeader == 6 { - tcpflags = data[offset+13] - - appOffset = int(data[13]>>4) * 4 - } - - // ICMP and ICMPv6 - if len(data) >= offset+2 && (nextHeader == 1 || nextHeader == 58) { - (*flowMessage).IcmpType = uint32(data[offset+0]) - (*flowMessage).IcmpCode = uint32(data[offset+1]) - } - - if appOffset > 0 { - for _, configLayer := range GetSFlowConfigLayer(config, 7) { - extracted := GetBytes(data, (offset+appOffset)*8+configLayer.Offset, configLayer.Length) - MapCustom(flowMessage, extracted, configLayer.Destination, configLayer.Endian) - } - } - - iterations++ - } - - (*flowMessage).HasMpls = hasMpls - (*flowMessage).MplsCount = countMpls - (*flowMessage).Mpls_1Label = firstLabelMpls - (*flowMessage).Mpls_1Ttl = uint32(firstTtlMpls) - (*flowMessage).Mpls_2Label = secondLabelMpls - (*flowMessage).Mpls_2Ttl = uint32(secondTtlMpls) - (*flowMessage).Mpls_3Label = thirdLabelMpls - (*flowMessage).Mpls_3Ttl = uint32(thirdTtlMpls) - (*flowMessage).MplsLastLabel = lastLabelMpls - (*flowMessage).MplsLastTtl = uint32(lastTtlMpls) - - (*flowMessage).Etype = uint32(binary.BigEndian.Uint16(etherType[0:2])) - (*flowMessage).Ipv6FlowLabel = flowLabel & 0xFFFFF - - (*flowMessage).SrcPort = uint32(srcPort) - (*flowMessage).DstPort = uint32(dstPort) - - (*flowMessage).SrcAddr = srcIP - (*flowMessage).DstAddr = dstIP - (*flowMessage).Proto = uint32(nextHeader) - (*flowMessage).IpTos = uint32(tos) - (*flowMessage).IpTtl = uint32(ttl) - (*flowMessage).TcpFlags = uint32(tcpflags) - - (*flowMessage).FragmentId = uint32(identification) - (*flowMessage).FragmentOffset = uint32(fragOffset) -} - -func ParseSampledHeaderConfig(flowMessage *flowmessage.FlowMessage, sampledHeader *sflow.SampledHeader, config *SFlowMapper) error { - data := (*sampledHeader).HeaderData - switch (*sampledHeader).Protocol { - case 1: // Ethernet - ParseEthernetHeader(flowMessage, data, config) - } - return nil -} - -func SearchSFlowSamples(samples []interface{}) []*flowmessage.FlowMessage { - return SearchSFlowSamples(samples) -} - -func SearchSFlowSamplesConfig(samples []interface{}, config *SFlowMapper) []*flowmessage.FlowMessage { - var flowMessageSet []*flowmessage.FlowMessage - - for _, flowSample := range samples { - var records []sflow.FlowRecord - - flowMessage := &flowmessage.FlowMessage{} - flowMessage.Type = flowmessage.FlowMessage_SFLOW_5 - - switch flowSample := flowSample.(type) { - case sflow.FlowSample: - records = flowSample.Records - flowMessage.SamplingRate = uint64(flowSample.SamplingRate) - flowMessage.InIf = flowSample.Input - flowMessage.OutIf = flowSample.Output - case sflow.ExpandedFlowSample: - records = flowSample.Records - flowMessage.SamplingRate = uint64(flowSample.SamplingRate) - flowMessage.InIf = flowSample.InputIfValue - flowMessage.OutIf = flowSample.OutputIfValue - } - - ipNh := net.IP{} - ipSrc := net.IP{} - ipDst := net.IP{} - flowMessage.Packets = 1 - for _, record := range records { - switch recordData := record.Data.(type) { - case sflow.SampledHeader: - flowMessage.Bytes = uint64(recordData.FrameLength) - ParseSampledHeaderConfig(flowMessage, &recordData, config) - case sflow.SampledIPv4: - ipSrc = recordData.Base.SrcIP - ipDst = recordData.Base.DstIP - flowMessage.SrcAddr = ipSrc - flowMessage.DstAddr = ipDst - flowMessage.Bytes = uint64(recordData.Base.Length) - flowMessage.Proto = recordData.Base.Protocol - flowMessage.SrcPort = recordData.Base.SrcPort - flowMessage.DstPort = recordData.Base.DstPort - flowMessage.IpTos = recordData.Tos - flowMessage.Etype = 0x800 - case sflow.SampledIPv6: - ipSrc = recordData.Base.SrcIP - ipDst = recordData.Base.DstIP - flowMessage.SrcAddr = ipSrc - flowMessage.DstAddr = ipDst - flowMessage.Bytes = uint64(recordData.Base.Length) - flowMessage.Proto = recordData.Base.Protocol - flowMessage.SrcPort = recordData.Base.SrcPort - flowMessage.DstPort = recordData.Base.DstPort - flowMessage.IpTos = recordData.Priority - flowMessage.Etype = 0x86dd - case sflow.ExtendedRouter: - ipNh = recordData.NextHop - flowMessage.NextHop = ipNh - flowMessage.SrcNet = recordData.SrcMaskLen - flowMessage.DstNet = recordData.DstMaskLen - case sflow.ExtendedGateway: - ipNh = recordData.NextHop - flowMessage.BgpNextHop = ipNh - flowMessage.BgpCommunities = recordData.Communities - flowMessage.AsPath = recordData.ASPath - if len(recordData.ASPath) > 0 { - flowMessage.DstAs = recordData.ASPath[len(recordData.ASPath)-1] - flowMessage.NextHopAs = recordData.ASPath[0] - } else { - flowMessage.DstAs = recordData.AS - } - if recordData.SrcAS > 0 { - flowMessage.SrcAs = recordData.SrcAS - } else { - flowMessage.SrcAs = recordData.AS - } - case sflow.ExtendedSwitch: - flowMessage.SrcVlan = recordData.SrcVlan - flowMessage.DstVlan = recordData.DstVlan - } - } - flowMessageSet = append(flowMessageSet, flowMessage) - } - return flowMessageSet -} - -func ProcessMessageSFlow(msgDec interface{}) ([]*flowmessage.FlowMessage, error) { - return ProcessMessageSFlowConfig(msgDec, nil) -} - -func ProcessMessageSFlowConfig(msgDec interface{}, config *ProducerConfigMapped) ([]*flowmessage.FlowMessage, error) { - switch packet := msgDec.(type) { - case sflow.Packet: - seqnum := packet.SequenceNumber - var agent net.IP - agent = packet.AgentIP - - var cfg *SFlowMapper - if config != nil { - cfg = config.SFlow - } - - flowSamples := GetSFlowFlowSamples(&packet) - flowMessageSet := SearchSFlowSamplesConfig(flowSamples, cfg) - for _, fmsg := range flowMessageSet { - fmsg.SamplerAddress = agent - fmsg.SequenceNum = seqnum - } - - return flowMessageSet, nil - default: - return []*flowmessage.FlowMessage{}, errors.New("Bad sFlow version") - } -} diff --git a/vendor/github.com/netsampler/goflow2/producer/reflect.go b/vendor/github.com/netsampler/goflow2/producer/reflect.go deleted file mode 100644 index 91a2a415..00000000 --- a/vendor/github.com/netsampler/goflow2/producer/reflect.go +++ /dev/null @@ -1,233 +0,0 @@ -package producer - -import ( - "fmt" - "reflect" - - "github.com/netsampler/goflow2/decoders/netflow" - flowmessage "github.com/netsampler/goflow2/pb" -) - -type EndianType string - -var ( - BigEndian EndianType = "big" - LittleEndian EndianType = "little" -) - -func GetBytes(d []byte, offset int, length int) []byte { - if length == 0 { - return nil - } - leftBytes := offset / 8 - rightBytes := (offset + length) / 8 - if (offset+length)%8 != 0 { - rightBytes += 1 - } - if leftBytes >= len(d) { - return nil - } - if rightBytes > len(d) { - rightBytes = len(d) - } - chunk := make([]byte, rightBytes-leftBytes) - - offsetMod8 := (offset % 8) - shiftAnd := byte(0xff >> (8 - offsetMod8)) - - var shifted byte - for i := range chunk { - j := len(chunk) - 1 - i - cur := d[j+leftBytes] - chunk[j] = (cur << offsetMod8) | shifted - shifted = shiftAnd & cur - } - last := len(chunk) - 1 - shiftAndLast := byte(0xff << ((8 - ((offset + length) % 8)) % 8)) - chunk[last] = chunk[last] & shiftAndLast - return chunk -} - -func IsUInt(k reflect.Kind) bool { - return k == reflect.Uint8 || k == reflect.Uint16 || k == reflect.Uint32 || k == reflect.Uint64 -} - -func IsInt(k reflect.Kind) bool { - return k == reflect.Int8 || k == reflect.Int16 || k == reflect.Int32 || k == reflect.Int64 -} - -func MapCustomNetFlow(flowMessage *flowmessage.FlowMessage, df netflow.DataField, mapper *NetFlowMapper) { - if mapper == nil { - return - } - mapped, ok := mapper.Map(df) - if ok { - v := df.Value.([]byte) - MapCustom(flowMessage, v, mapped.Destination, mapped.Endian) - } -} - -func MapCustom(flowMessage *flowmessage.FlowMessage, v []byte, destination string, endianness EndianType) { - vfm := reflect.ValueOf(flowMessage) - vfm = reflect.Indirect(vfm) - - fieldValue := vfm.FieldByName(destination) - - if fieldValue.IsValid() { - typeDest := fieldValue.Type() - fieldValueAddr := fieldValue.Addr() - - if typeDest.Kind() == reflect.Slice { - - if typeDest.Elem().Kind() == reflect.Uint8 { - fieldValue.SetBytes(v) - } else { - item := reflect.New(typeDest.Elem()) - - if IsUInt(typeDest.Elem().Kind()) { - if endianness == LittleEndian { - DecodeUNumberLE(v, item.Interface()) - } else { - DecodeUNumber(v, item.Interface()) - } - } else if IsUInt(typeDest.Elem().Kind()) { - if endianness == LittleEndian { - DecodeUNumberLE(v, item.Interface()) - } else { - DecodeUNumber(v, item.Interface()) - } - } - - itemi := reflect.Indirect(item) - tmpFieldValue := reflect.Append(fieldValue, itemi) - fieldValue.Set(tmpFieldValue) - } - - } else if fieldValueAddr.IsValid() && IsUInt(typeDest.Kind()) { - if endianness == LittleEndian { - DecodeUNumberLE(v, fieldValueAddr.Interface()) - } else { - DecodeUNumber(v, fieldValueAddr.Interface()) - } - } else if fieldValueAddr.IsValid() && IsInt(typeDest.Kind()) { - if endianness == LittleEndian { - DecodeUNumberLE(v, fieldValueAddr.Interface()) - } else { - DecodeUNumber(v, fieldValueAddr.Interface()) - } - } - } -} - -type NetFlowMapField struct { - PenProvided bool `json:"penprovided" yaml:"penprovided"` - Type uint16 `json:"field" yaml:"field"` - Pen uint32 `json:"pen" yaml:"pen"` - - Destination string `json:"destination" yaml:"destination"` - Endian EndianType `json:"endianness" yaml:"endianness"` - //DestinationLength uint8 `json:"dlen"` // could be used if populating a slice of uint16 that aren't in protobuf -} - -type IPFIXProducerConfig struct { - Mapping []NetFlowMapField `json:"mapping"` - //PacketMapping []SFlowMapField `json:"packet-mapping"` // for embedded frames: use sFlow configuration -} - -type NetFlowV9ProducerConfig struct { - Mapping []NetFlowMapField `json:"mapping"` -} - -type SFlowMapField struct { - Layer int `json:"layer"` - Offset int `json:"offset"` // offset in bits - Length int `json:"length"` // length in bits - - Destination string `json:"destination" yaml:"destination"` - Endian EndianType `json:"endianness" yaml:"endianness"` - //DestinationLength uint8 `json:"dlen"` -} - -type SFlowProducerConfig struct { - Mapping []SFlowMapField `json:"mapping"` -} - -type ProducerConfig struct { - IPFIX IPFIXProducerConfig `json:"ipfix"` - NetFlowV9 NetFlowV9ProducerConfig `json:"netflowv9"` - SFlow SFlowProducerConfig `json:"sflow"` // also used for IPFIX data frames - - // should do a rename map list for when printing -} - -type DataMap struct { - Destination string - Endian EndianType -} - -type NetFlowMapper struct { - data map[string]DataMap // maps field to destination -} - -func (m *NetFlowMapper) Map(field netflow.DataField) (DataMap, bool) { - mapped, found := m.data[fmt.Sprintf("%v-%d-%d", field.PenProvided, field.Pen, field.Type)] - return mapped, found -} - -func MapFieldsNetFlow(fields []NetFlowMapField) *NetFlowMapper { - ret := make(map[string]DataMap) - for _, field := range fields { - ret[fmt.Sprintf("%v-%d-%d", field.PenProvided, field.Pen, field.Type)] = DataMap{Destination: field.Destination, Endian: field.Endian} - } - return &NetFlowMapper{ret} -} - -type DataMapLayer struct { - Offset int - Length int - Destination string - Endian EndianType -} - -type SFlowMapper struct { - data map[int][]DataMapLayer // map layer to list of offsets -} - -func GetSFlowConfigLayer(m *SFlowMapper, layer int) []DataMapLayer { - if m == nil { - return nil - } - return m.data[layer] -} - -func MapFieldsSFlow(fields []SFlowMapField) *SFlowMapper { - ret := make(map[int][]DataMapLayer) - for _, field := range fields { - retLayerEntry := DataMapLayer{ - Offset: field.Offset, - Length: field.Length, - Destination: field.Destination, - Endian: field.Endian, - } - retLayer := ret[field.Layer] - retLayer = append(retLayer, retLayerEntry) - ret[field.Layer] = retLayer - } - return &SFlowMapper{ret} -} - -type ProducerConfigMapped struct { - IPFIX *NetFlowMapper `json:"ipfix"` - NetFlowV9 *NetFlowMapper `json:"netflowv9"` - SFlow *SFlowMapper `json:"sflow"` -} - -func NewProducerConfigMapped(config *ProducerConfig) *ProducerConfigMapped { - newCfg := &ProducerConfigMapped{} - if config != nil { - newCfg.IPFIX = MapFieldsNetFlow(config.IPFIX.Mapping) - newCfg.NetFlowV9 = MapFieldsNetFlow(config.NetFlowV9.Mapping) - newCfg.SFlow = MapFieldsSFlow(config.SFlow.Mapping) - } - return newCfg -} diff --git a/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go b/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go index 08755043..7f5eae87 100644 --- a/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go +++ b/vendor/go.opentelemetry.io/otel/attribute/internal/attribute.go @@ -13,32 +13,28 @@ import ( // BoolSliceValue converts a bool slice into an array with same elements as slice. func BoolSliceValue(v []bool) any { - var zero bool - cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem() + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[bool]())).Elem() reflect.Copy(cp, reflect.ValueOf(v)) return cp.Interface() } // Int64SliceValue converts an int64 slice into an array with same elements as slice. func Int64SliceValue(v []int64) any { - var zero int64 - cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem() + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[int64]())).Elem() reflect.Copy(cp, reflect.ValueOf(v)) return cp.Interface() } // Float64SliceValue converts a float64 slice into an array with same elements as slice. func Float64SliceValue(v []float64) any { - var zero float64 - cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem() + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[float64]())).Elem() reflect.Copy(cp, reflect.ValueOf(v)) return cp.Interface() } // StringSliceValue converts a string slice into an array with same elements as slice. func StringSliceValue(v []string) any { - var zero string - cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(zero))).Elem() + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[string]())).Elem() reflect.Copy(cp, reflect.ValueOf(v)) return cp.Interface() } diff --git a/vendor/go.opentelemetry.io/otel/attribute/set.go b/vendor/go.opentelemetry.io/otel/attribute/set.go index 911d557e..6572c98b 100644 --- a/vendor/go.opentelemetry.io/otel/attribute/set.go +++ b/vendor/go.opentelemetry.io/otel/attribute/set.go @@ -58,7 +58,7 @@ func isComparable[T comparable](t T) T { return t } var ( // keyValueType is used in computeDistinctReflect. - keyValueType = reflect.TypeOf(KeyValue{}) + keyValueType = reflect.TypeFor[KeyValue]() // emptyHash is the hash of an empty set. emptyHash = xxhash.New().Sum64() diff --git a/vendor/go.opentelemetry.io/otel/attribute/value.go b/vendor/go.opentelemetry.io/otel/attribute/value.go index 653c33a8..5931e712 100644 --- a/vendor/go.opentelemetry.io/otel/attribute/value.go +++ b/vendor/go.opentelemetry.io/otel/attribute/value.go @@ -66,8 +66,7 @@ func IntValue(v int) Value { // IntSliceValue creates an INTSLICE Value. func IntSliceValue(v []int) Value { - var int64Val int64 - cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeOf(int64Val))) + cp := reflect.New(reflect.ArrayOf(len(v), reflect.TypeFor[int64]())) for i, val := range v { cp.Elem().Index(i).SetInt(int64(val)) } diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/MIGRATION.md b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/MIGRATION.md deleted file mode 100644 index 24805478..00000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/MIGRATION.md +++ /dev/null @@ -1,41 +0,0 @@ - -# Migration from v1.36.0 to v1.37.0 - -The `go.opentelemetry.io/otel/semconv/v1.37.0` package should be a drop-in replacement for `go.opentelemetry.io/otel/semconv/v1.36.0` with the following exceptions. - -## Removed - -The following declarations have been removed. -Refer to the [OpenTelemetry Semantic Conventions documentation] for deprecation instructions. - -If the type is not listed in the documentation as deprecated, it has been removed in this version due to lack of applicability or use. -If you use any of these non-deprecated declarations in your Go application, please [open an issue] describing your use-case. - -- `ContainerRuntime` -- `ContainerRuntimeKey` -- `GenAIOpenAIRequestServiceTierAuto` -- `GenAIOpenAIRequestServiceTierDefault` -- `GenAIOpenAIRequestServiceTierKey` -- `GenAIOpenAIResponseServiceTier` -- `GenAIOpenAIResponseServiceTierKey` -- `GenAIOpenAIResponseSystemFingerprint` -- `GenAIOpenAIResponseSystemFingerprintKey` -- `GenAISystemAWSBedrock` -- `GenAISystemAnthropic` -- `GenAISystemAzureAIInference` -- `GenAISystemAzureAIOpenAI` -- `GenAISystemCohere` -- `GenAISystemDeepseek` -- `GenAISystemGCPGemini` -- `GenAISystemGCPGenAI` -- `GenAISystemGCPVertexAI` -- `GenAISystemGroq` -- `GenAISystemIBMWatsonxAI` -- `GenAISystemKey` -- `GenAISystemMistralAI` -- `GenAISystemOpenAI` -- `GenAISystemPerplexity` -- `GenAISystemXai` - -[OpenTelemetry Semantic Conventions documentation]: https://github.com/open-telemetry/semantic-conventions -[open an issue]: https://github.com/open-telemetry/opentelemetry-go/issues/new?template=Blank+issue diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/README.md deleted file mode 100644 index d795247f..00000000 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Semconv v1.37.0 - -[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.37.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.37.0) diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/MIGRATION.md b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/MIGRATION.md new file mode 100644 index 00000000..fed7013e --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/MIGRATION.md @@ -0,0 +1,78 @@ + +# Migration from v1.38.0 to v1.39.0 + +The `go.opentelemetry.io/otel/semconv/v1.39.0` package should be a drop-in replacement for `go.opentelemetry.io/otel/semconv/v1.38.0` with the following exceptions. + +## Removed + +The following declarations have been removed. +Refer to the [OpenTelemetry Semantic Conventions documentation] for deprecation instructions. + +If the type is not listed in the documentation as deprecated, it has been removed in this version due to lack of applicability or use. +If you use any of these non-deprecated declarations in your Go application, please [open an issue] describing your use-case. + +- `LinuxMemorySlabStateKey` +- `LinuxMemorySlabStateReclaimable` +- `LinuxMemorySlabStateUnreclaimable` +- `PeerService` +- `PeerServiceKey` +- `RPCConnectRPCErrorCodeAborted` +- `RPCConnectRPCErrorCodeAlreadyExists` +- `RPCConnectRPCErrorCodeCancelled` +- `RPCConnectRPCErrorCodeDataLoss` +- `RPCConnectRPCErrorCodeDeadlineExceeded` +- `RPCConnectRPCErrorCodeFailedPrecondition` +- `RPCConnectRPCErrorCodeInternal` +- `RPCConnectRPCErrorCodeInvalidArgument` +- `RPCConnectRPCErrorCodeKey` +- `RPCConnectRPCErrorCodeNotFound` +- `RPCConnectRPCErrorCodeOutOfRange` +- `RPCConnectRPCErrorCodePermissionDenied` +- `RPCConnectRPCErrorCodeResourceExhausted` +- `RPCConnectRPCErrorCodeUnauthenticated` +- `RPCConnectRPCErrorCodeUnavailable` +- `RPCConnectRPCErrorCodeUnimplemented` +- `RPCConnectRPCErrorCodeUnknown` +- `RPCConnectRPCRequestMetadata` +- `RPCConnectRPCResponseMetadata` +- `RPCGRPCRequestMetadata` +- `RPCGRPCResponseMetadata` +- `RPCGRPCStatusCodeAborted` +- `RPCGRPCStatusCodeAlreadyExists` +- `RPCGRPCStatusCodeCancelled` +- `RPCGRPCStatusCodeDataLoss` +- `RPCGRPCStatusCodeDeadlineExceeded` +- `RPCGRPCStatusCodeFailedPrecondition` +- `RPCGRPCStatusCodeInternal` +- `RPCGRPCStatusCodeInvalidArgument` +- `RPCGRPCStatusCodeKey` +- `RPCGRPCStatusCodeNotFound` +- `RPCGRPCStatusCodeOk` +- `RPCGRPCStatusCodeOutOfRange` +- `RPCGRPCStatusCodePermissionDenied` +- `RPCGRPCStatusCodeResourceExhausted` +- `RPCGRPCStatusCodeUnauthenticated` +- `RPCGRPCStatusCodeUnavailable` +- `RPCGRPCStatusCodeUnimplemented` +- `RPCGRPCStatusCodeUnknown` +- `RPCJSONRPCErrorCode` +- `RPCJSONRPCErrorCodeKey` +- `RPCJSONRPCErrorMessage` +- `RPCJSONRPCErrorMessageKey` +- `RPCJSONRPCRequestID` +- `RPCJSONRPCRequestIDKey` +- `RPCJSONRPCVersion` +- `RPCJSONRPCVersionKey` +- `RPCService` +- `RPCServiceKey` +- `RPCSystemApacheDubbo` +- `RPCSystemConnectRPC` +- `RPCSystemDotnetWcf` +- `RPCSystemGRPC` +- `RPCSystemJSONRPC` +- `RPCSystemJavaRmi` +- `RPCSystemKey` +- `RPCSystemOncRPC` + +[OpenTelemetry Semantic Conventions documentation]: https://github.com/open-telemetry/semantic-conventions +[open an issue]: https://github.com/open-telemetry/opentelemetry-go/issues/new?template=Blank+issue diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/README.md new file mode 100644 index 00000000..4b0e6f7f --- /dev/null +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/README.md @@ -0,0 +1,3 @@ +# Semconv v1.39.0 + +[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.39.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.39.0) diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/attribute_group.go similarity index 90% rename from vendor/go.opentelemetry.io/otel/semconv/v1.37.0/attribute_group.go rename to vendor/go.opentelemetry.io/otel/semconv/v1.39.0/attribute_group.go index b6b27498..080365fc 100644 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/attribute_group.go +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/attribute_group.go @@ -3,7 +3,7 @@ // Code generated from semantic convention specification. DO NOT EDIT. -package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0" +package semconv // import "go.opentelemetry.io/otel/semconv/v1.39.0" import "go.opentelemetry.io/otel/attribute" @@ -187,6 +187,38 @@ const ( // Examples: 12, 99 AppScreenCoordinateYKey = attribute.Key("app.screen.coordinate.y") + // AppScreenIDKey is the attribute Key conforming to the "app.screen.id" + // semantic conventions. It represents an identifier that uniquely + // differentiates this screen from other screens in the same application. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "f9bc787d-ff05-48ad-90e1-fca1d46130b3", + // "com.example.app.MainActivity", "com.example.shop.ProductDetailFragment", + // "MyApp.ProfileView", "MyApp.ProfileViewController" + // Note: A screen represents only the part of the device display drawn by the + // app. It typically contains multiple widgets or UI components and is larger in + // scope than individual widgets. Multiple screens can coexist on the same + // display simultaneously (e.g., split view on tablets). + AppScreenIDKey = attribute.Key("app.screen.id") + + // AppScreenNameKey is the attribute Key conforming to the "app.screen.name" + // semantic conventions. It represents the name of an application screen. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "MainActivity", "ProductDetailFragment", "ProfileView", + // "ProfileViewController" + // Note: A screen represents only the part of the device display drawn by the + // app. It typically contains multiple widgets or UI components and is larger in + // scope than individual widgets. Multiple screens can coexist on the same + // display simultaneously (e.g., split view on tablets). + AppScreenNameKey = attribute.Key("app.screen.name") + // AppWidgetIDKey is the attribute Key conforming to the "app.widget.id" // semantic conventions. It represents an identifier that uniquely // differentiates this widget from other widgets in the same application. @@ -262,6 +294,20 @@ func AppScreenCoordinateY(val int) attribute.KeyValue { return AppScreenCoordinateYKey.Int(val) } +// AppScreenID returns an attribute KeyValue conforming to the "app.screen.id" +// semantic conventions. It represents an identifier that uniquely differentiates +// this screen from other screens in the same application. +func AppScreenID(val string) attribute.KeyValue { + return AppScreenIDKey.String(val) +} + +// AppScreenName returns an attribute KeyValue conforming to the +// "app.screen.name" semantic conventions. It represents the name of an +// application screen. +func AppScreenName(val string) attribute.KeyValue { + return AppScreenNameKey.String(val) +} + // AppWidgetID returns an attribute KeyValue conforming to the "app.widget.id" // semantic conventions. It represents an identifier that uniquely differentiates // this widget from other widgets in the same application. @@ -1662,7 +1708,7 @@ const ( // Examples: "North Central US", "Australia East", "Australia Southeast" // Note: Region name matches the format of `displayName` in [Azure Location API] // - // [Azure Location API]: https://learn.microsoft.com/rest/api/subscription/subscriptions/list-locations?view=rest-subscription-2021-10-01&tabs=HTTP#location + // [Azure Location API]: https://learn.microsoft.com/rest/api/resources/subscriptions/list-locations AzureCosmosDBOperationContactedRegionsKey = attribute.Key("azure.cosmosdb.operation.contacted_regions") // AzureCosmosDBOperationRequestChargeKey is the attribute Key conforming to the @@ -2646,6 +2692,9 @@ func CloudResourceID(val string) attribute.KeyValue { // Enum values for cloud.platform var ( + // Akamai Cloud Compute + // Stability: development + CloudPlatformAkamaiCloudCompute = CloudPlatformKey.String("akamai_cloud.compute") // Alibaba Cloud Elastic Compute Service // Stability: development CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs") @@ -2697,6 +2746,9 @@ var ( // Azure Red Hat OpenShift // Stability: development CloudPlatformAzureOpenShift = CloudPlatformKey.String("azure.openshift") + // Google Vertex AI Agent Engine + // Stability: development + CloudPlatformGCPAgentEngine = CloudPlatformKey.String("gcp.agent_engine") // Google Bare Metal Solution (BMS) // Stability: development CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution") @@ -2718,6 +2770,9 @@ var ( // Red Hat OpenShift on Google Cloud // Stability: development CloudPlatformGCPOpenShift = CloudPlatformKey.String("gcp_openshift") + // Server on Hetzner Cloud + // Stability: development + CloudPlatformHetznerCloudServer = CloudPlatformKey.String("hetzner.cloud_server") // Red Hat OpenShift on IBM Cloud // Stability: development CloudPlatformIBMCloudOpenShift = CloudPlatformKey.String("ibm_cloud_openshift") @@ -2736,10 +2791,16 @@ var ( // Tencent Cloud Serverless Cloud Function (SCF) // Stability: development CloudPlatformTencentCloudSCF = CloudPlatformKey.String("tencent_cloud_scf") + // Vultr Cloud Compute + // Stability: development + CloudPlatformVultrCloudCompute = CloudPlatformKey.String("vultr.cloud_compute") ) // Enum values for cloud.provider var ( + // Akamai Cloud + // Stability: development + CloudProviderAkamaiCloud = CloudProviderKey.String("akamai_cloud") // Alibaba Cloud // Stability: development CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud") @@ -2755,6 +2816,9 @@ var ( // Heroku Platform as a Service // Stability: development CloudProviderHeroku = CloudProviderKey.String("heroku") + // Hetzner + // Stability: development + CloudProviderHetzner = CloudProviderKey.String("hetzner") // IBM Cloud // Stability: development CloudProviderIBMCloud = CloudProviderKey.String("ibm_cloud") @@ -2764,6 +2828,9 @@ var ( // Tencent Cloud // Stability: development CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud") + // Vultr + // Stability: development + CloudProviderVultr = CloudProviderKey.String("vultr") ) // Namespace: cloudevents @@ -3364,7 +3431,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "a3bf90e006b2" // @@ -3391,7 +3458,7 @@ const ( // environments. Consider using `oci.manifest.digest` if it is important to // identify the same image in different environments/runtimes. // - // [API]: https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect + // [API]: https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Container/operation/ContainerInspect ContainerImageIDKey = attribute.Key("container.image.id") // ContainerImageNameKey is the attribute Key conforming to the @@ -3400,7 +3467,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "gcr.io/opentelemetry/operator" ContainerImageNameKey = attribute.Key("container.image.name") @@ -3411,14 +3478,14 @@ const ( // // Type: string[] // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: // "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", // "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" // Note: [Docker] and [CRI] report those under the `RepoDigests` field. // - // [Docker]: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect + // [Docker]: https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Image/operation/ImageInspect // [CRI]: https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238 ContainerImageRepoDigestsKey = attribute.Key("container.image.repo_digests") @@ -3430,11 +3497,11 @@ const ( // // Type: string[] // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "v1.27.1", "3.5.7-0" // - // [Docker Image Inspect]: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect + // [Docker Image Inspect]: https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Image/operation/ImageInspect ContainerImageTagsKey = attribute.Key("container.image.tags") // ContainerNameKey is the attribute Key conforming to the "container.name" @@ -3560,7 +3627,7 @@ func ContainerImageRepoDigests(val ...string) attribute.KeyValue { // `` section of the full name for example from // `registry.example.com/my-org/my-image:`. // -// [Docker Image Inspect]: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect +// [Docker Image Inspect]: https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Image/operation/ImageInspect func ContainerImageTags(val ...string) attribute.KeyValue { return ContainerImageTagsKey.StringSlice(val) } @@ -3789,7 +3856,7 @@ const ( // [Generating query summary] // section. // - // [Generating query summary]: /docs/database/database-spans.md#generating-a-summary-of-the-query + // [Generating query summary]: /docs/db/database-spans.md#generating-a-summary-of-the-query DBQuerySummaryKey = attribute.Key("db.query.summary") // DBQueryTextKey is the attribute Key conforming to the "db.query.text" @@ -3811,7 +3878,7 @@ const ( // passed as parameter values, and the benefit to observability of capturing the // static part of the query text by default outweighs the risk. // - // [Sanitization of `db.query.text`]: /docs/database/database-spans.md#sanitization-of-dbquerytext + // [Sanitization of `db.query.text`]: /docs/db/database-spans.md#sanitization-of-dbquerytext DBQueryTextKey = attribute.Key("db.query.text") // DBResponseReturnedRowsKey is the attribute Key conforming to the @@ -4463,10 +4530,8 @@ const ( // Stability: Development // // Examples: "www.example.com", "opentelemetry.io" - // Note: If the name field contains non-printable characters (below 32 or above - // 126), those characters should be represented as escaped base 10 integers - // (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, - // and line feeds should be converted to \t, \r, and \n respectively. + // Note: The name represents the queried domain name as it appears in the DNS + // query without any additional normalization. DNSQuestionNameKey = attribute.Key("dns.question.name") ) @@ -4609,7 +4674,7 @@ const ( // `error.type`. // // If a specific domain defines its own set of error identifiers (such as HTTP - // or gRPC status codes), + // or RPC status codes), // it's RECOMMENDED to: // // - Use a domain-specific attribute @@ -4927,7 +4992,7 @@ const ( // // [function version]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html // [revision]: https://cloud.google.com/run/docs/managing/revisions - // [`K_REVISION` environment variable]: https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically + // [`K_REVISION` environment variable]: https://cloud.google.com/run/docs/container-contract#services-env-vars FaaSVersionKey = attribute.Key("faas.version") ) @@ -5729,6 +5794,119 @@ const ( // Examples: "my-workload" GCPAppHubWorkloadIDKey = attribute.Key("gcp.apphub.workload.id") + // GCPAppHubDestinationApplicationContainerKey is the attribute Key conforming + // to the "gcp.apphub_destination.application.container" semantic conventions. + // It represents the container within GCP where the AppHub destination + // application is defined. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "projects/my-container-project" + GCPAppHubDestinationApplicationContainerKey = attribute.Key("gcp.apphub_destination.application.container") + + // GCPAppHubDestinationApplicationIDKey is the attribute Key conforming to the + // "gcp.apphub_destination.application.id" semantic conventions. It represents + // the name of the destination application as configured in AppHub. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "my-application" + GCPAppHubDestinationApplicationIDKey = attribute.Key("gcp.apphub_destination.application.id") + + // GCPAppHubDestinationApplicationLocationKey is the attribute Key conforming to + // the "gcp.apphub_destination.application.location" semantic conventions. It + // represents the GCP zone or region where the destination application is + // defined. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "us-central1" + GCPAppHubDestinationApplicationLocationKey = attribute.Key("gcp.apphub_destination.application.location") + + // GCPAppHubDestinationServiceCriticalityTypeKey is the attribute Key conforming + // to the "gcp.apphub_destination.service.criticality_type" semantic + // conventions. It represents the criticality of a destination workload + // indicates its importance to the business as specified in [AppHub type enum]. + // + // Type: Enum + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: + // + // [AppHub type enum]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type + GCPAppHubDestinationServiceCriticalityTypeKey = attribute.Key("gcp.apphub_destination.service.criticality_type") + + // GCPAppHubDestinationServiceEnvironmentTypeKey is the attribute Key conforming + // to the "gcp.apphub_destination.service.environment_type" semantic + // conventions. It represents the software lifecycle stage of a destination + // service as defined [AppHub environment type]. + // + // Type: Enum + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: + // + // [AppHub environment type]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1 + GCPAppHubDestinationServiceEnvironmentTypeKey = attribute.Key("gcp.apphub_destination.service.environment_type") + + // GCPAppHubDestinationServiceIDKey is the attribute Key conforming to the + // "gcp.apphub_destination.service.id" semantic conventions. It represents the + // name of the destination service as configured in AppHub. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "my-service" + GCPAppHubDestinationServiceIDKey = attribute.Key("gcp.apphub_destination.service.id") + + // GCPAppHubDestinationWorkloadCriticalityTypeKey is the attribute Key + // conforming to the "gcp.apphub_destination.workload.criticality_type" semantic + // conventions. It represents the criticality of a destination workload + // indicates its importance to the business as specified in [AppHub type enum]. + // + // Type: Enum + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: + // + // [AppHub type enum]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type + GCPAppHubDestinationWorkloadCriticalityTypeKey = attribute.Key("gcp.apphub_destination.workload.criticality_type") + + // GCPAppHubDestinationWorkloadEnvironmentTypeKey is the attribute Key + // conforming to the "gcp.apphub_destination.workload.environment_type" semantic + // conventions. It represents the environment of a destination workload is the + // stage of a software lifecycle as provided in the [AppHub environment type]. + // + // Type: Enum + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: + // + // [AppHub environment type]: https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1 + GCPAppHubDestinationWorkloadEnvironmentTypeKey = attribute.Key("gcp.apphub_destination.workload.environment_type") + + // GCPAppHubDestinationWorkloadIDKey is the attribute Key conforming to the + // "gcp.apphub_destination.workload.id" semantic conventions. It represents the + // name of the destination workload as configured in AppHub. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "my-workload" + GCPAppHubDestinationWorkloadIDKey = attribute.Key("gcp.apphub_destination.workload.id") + // GCPClientServiceKey is the attribute Key conforming to the // "gcp.client.service" semantic conventions. It represents the identifies the // Google Cloud service for which the official client library is intended. @@ -5839,6 +6017,43 @@ func GCPAppHubWorkloadID(val string) attribute.KeyValue { return GCPAppHubWorkloadIDKey.String(val) } +// GCPAppHubDestinationApplicationContainer returns an attribute KeyValue +// conforming to the "gcp.apphub_destination.application.container" semantic +// conventions. It represents the container within GCP where the AppHub +// destination application is defined. +func GCPAppHubDestinationApplicationContainer(val string) attribute.KeyValue { + return GCPAppHubDestinationApplicationContainerKey.String(val) +} + +// GCPAppHubDestinationApplicationID returns an attribute KeyValue conforming to +// the "gcp.apphub_destination.application.id" semantic conventions. It +// represents the name of the destination application as configured in AppHub. +func GCPAppHubDestinationApplicationID(val string) attribute.KeyValue { + return GCPAppHubDestinationApplicationIDKey.String(val) +} + +// GCPAppHubDestinationApplicationLocation returns an attribute KeyValue +// conforming to the "gcp.apphub_destination.application.location" semantic +// conventions. It represents the GCP zone or region where the destination +// application is defined. +func GCPAppHubDestinationApplicationLocation(val string) attribute.KeyValue { + return GCPAppHubDestinationApplicationLocationKey.String(val) +} + +// GCPAppHubDestinationServiceID returns an attribute KeyValue conforming to the +// "gcp.apphub_destination.service.id" semantic conventions. It represents the +// name of the destination service as configured in AppHub. +func GCPAppHubDestinationServiceID(val string) attribute.KeyValue { + return GCPAppHubDestinationServiceIDKey.String(val) +} + +// GCPAppHubDestinationWorkloadID returns an attribute KeyValue conforming to the +// "gcp.apphub_destination.workload.id" semantic conventions. It represents the +// name of the destination workload as configured in AppHub. +func GCPAppHubDestinationWorkloadID(val string) attribute.KeyValue { + return GCPAppHubDestinationWorkloadIDKey.String(val) +} + // GCPClientService returns an attribute KeyValue conforming to the // "gcp.client.service" semantic conventions. It represents the identifies the // Google Cloud service for which the official client library is intended. @@ -5952,6 +6167,70 @@ var ( GCPAppHubWorkloadEnvironmentTypeDevelopment = GCPAppHubWorkloadEnvironmentTypeKey.String("DEVELOPMENT") ) +// Enum values for gcp.apphub_destination.service.criticality_type +var ( + // Mission critical service. + // Stability: development + GCPAppHubDestinationServiceCriticalityTypeMissionCritical = GCPAppHubDestinationServiceCriticalityTypeKey.String("MISSION_CRITICAL") + // High impact. + // Stability: development + GCPAppHubDestinationServiceCriticalityTypeHigh = GCPAppHubDestinationServiceCriticalityTypeKey.String("HIGH") + // Medium impact. + // Stability: development + GCPAppHubDestinationServiceCriticalityTypeMedium = GCPAppHubDestinationServiceCriticalityTypeKey.String("MEDIUM") + // Low impact. + // Stability: development + GCPAppHubDestinationServiceCriticalityTypeLow = GCPAppHubDestinationServiceCriticalityTypeKey.String("LOW") +) + +// Enum values for gcp.apphub_destination.service.environment_type +var ( + // Production environment. + // Stability: development + GCPAppHubDestinationServiceEnvironmentTypeProduction = GCPAppHubDestinationServiceEnvironmentTypeKey.String("PRODUCTION") + // Staging environment. + // Stability: development + GCPAppHubDestinationServiceEnvironmentTypeStaging = GCPAppHubDestinationServiceEnvironmentTypeKey.String("STAGING") + // Test environment. + // Stability: development + GCPAppHubDestinationServiceEnvironmentTypeTest = GCPAppHubDestinationServiceEnvironmentTypeKey.String("TEST") + // Development environment. + // Stability: development + GCPAppHubDestinationServiceEnvironmentTypeDevelopment = GCPAppHubDestinationServiceEnvironmentTypeKey.String("DEVELOPMENT") +) + +// Enum values for gcp.apphub_destination.workload.criticality_type +var ( + // Mission critical service. + // Stability: development + GCPAppHubDestinationWorkloadCriticalityTypeMissionCritical = GCPAppHubDestinationWorkloadCriticalityTypeKey.String("MISSION_CRITICAL") + // High impact. + // Stability: development + GCPAppHubDestinationWorkloadCriticalityTypeHigh = GCPAppHubDestinationWorkloadCriticalityTypeKey.String("HIGH") + // Medium impact. + // Stability: development + GCPAppHubDestinationWorkloadCriticalityTypeMedium = GCPAppHubDestinationWorkloadCriticalityTypeKey.String("MEDIUM") + // Low impact. + // Stability: development + GCPAppHubDestinationWorkloadCriticalityTypeLow = GCPAppHubDestinationWorkloadCriticalityTypeKey.String("LOW") +) + +// Enum values for gcp.apphub_destination.workload.environment_type +var ( + // Production environment. + // Stability: development + GCPAppHubDestinationWorkloadEnvironmentTypeProduction = GCPAppHubDestinationWorkloadEnvironmentTypeKey.String("PRODUCTION") + // Staging environment. + // Stability: development + GCPAppHubDestinationWorkloadEnvironmentTypeStaging = GCPAppHubDestinationWorkloadEnvironmentTypeKey.String("STAGING") + // Test environment. + // Stability: development + GCPAppHubDestinationWorkloadEnvironmentTypeTest = GCPAppHubDestinationWorkloadEnvironmentTypeKey.String("TEST") + // Development environment. + // Stability: development + GCPAppHubDestinationWorkloadEnvironmentTypeDevelopment = GCPAppHubDestinationWorkloadEnvironmentTypeKey.String("DEVELOPMENT") +) + // Namespace: gen_ai const ( // GenAIAgentDescriptionKey is the attribute Key conforming to the @@ -6017,6 +6296,68 @@ const ( // `db.*`, to further identify and describe the data source. GenAIDataSourceIDKey = attribute.Key("gen_ai.data_source.id") + // GenAIEmbeddingsDimensionCountKey is the attribute Key conforming to the + // "gen_ai.embeddings.dimension.count" semantic conventions. It represents the + // number of dimensions the resulting output embeddings should have. + // + // Type: int + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: 512, 1024 + GenAIEmbeddingsDimensionCountKey = attribute.Key("gen_ai.embeddings.dimension.count") + + // GenAIEvaluationExplanationKey is the attribute Key conforming to the + // "gen_ai.evaluation.explanation" semantic conventions. It represents a + // free-form explanation for the assigned score provided by the evaluator. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "The response is factually accurate but lacks sufficient detail to + // fully address the question." + GenAIEvaluationExplanationKey = attribute.Key("gen_ai.evaluation.explanation") + + // GenAIEvaluationNameKey is the attribute Key conforming to the + // "gen_ai.evaluation.name" semantic conventions. It represents the name of the + // evaluation metric used for the GenAI response. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "Relevance", "IntentResolution" + GenAIEvaluationNameKey = attribute.Key("gen_ai.evaluation.name") + + // GenAIEvaluationScoreLabelKey is the attribute Key conforming to the + // "gen_ai.evaluation.score.label" semantic conventions. It represents the human + // readable label for evaluation. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "relevant", "not_relevant", "correct", "incorrect", "pass", "fail" + // Note: This attribute provides a human-readable interpretation of the + // evaluation score produced by an evaluator. For example, a score value of 1 + // could mean "relevant" in one evaluation system and "not relevant" in another, + // depending on the scoring range and evaluator. The label SHOULD have low + // cardinality. Possible values depend on the evaluation metric and evaluator + // used; implementations SHOULD document the possible values. + GenAIEvaluationScoreLabelKey = attribute.Key("gen_ai.evaluation.score.label") + + // GenAIEvaluationScoreValueKey is the attribute Key conforming to the + // "gen_ai.evaluation.score.value" semantic conventions. It represents the + // evaluation score returned by the evaluator. + // + // Type: double + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: 4.0 + GenAIEvaluationScoreValueKey = attribute.Key("gen_ai.evaluation.score.value") + // GenAIInputMessagesKey is the attribute Key conforming to the // "gen_ai.input.messages" semantic conventions. It represents the chat history // provided to the model as an input. @@ -6125,6 +6466,17 @@ const ( // `gen_ai.output.{type}.*` attributes. GenAIOutputTypeKey = attribute.Key("gen_ai.output.type") + // GenAIPromptNameKey is the attribute Key conforming to the + // "gen_ai.prompt.name" semantic conventions. It represents the name of the + // prompt that uniquely identifies it. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "analyze-code" + GenAIPromptNameKey = attribute.Key("gen_ai.prompt.name") + // GenAIProviderNameKey is the attribute Key conforming to the // "gen_ai.provider.name" semantic conventions. It represents the Generative AI // provider as identified by the client or server instrumentation. @@ -6360,6 +6712,26 @@ const ( // Examples: "input", "output" GenAITokenTypeKey = attribute.Key("gen_ai.token.type") + // GenAIToolCallArgumentsKey is the attribute Key conforming to the + // "gen_ai.tool.call.arguments" semantic conventions. It represents the + // parameters passed to the tool call. + // + // Type: any + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "{\n "location": "San Francisco?",\n "date": "2025-10-01"\n}\n" + // Note: > [!WARNING] + // + // > This attribute may contain sensitive information. + // + // It's expected to be an object - in case a serialized string is available + // to the instrumentation, the instrumentation SHOULD do the best effort to + // deserialize it to an object. When recorded on spans, it MAY be recorded as a + // JSON string if structured format is not supported and SHOULD be recorded in + // structured form otherwise. + GenAIToolCallArgumentsKey = attribute.Key("gen_ai.tool.call.arguments") + // GenAIToolCallIDKey is the attribute Key conforming to the // "gen_ai.tool.call.id" semantic conventions. It represents the tool call // identifier. @@ -6371,6 +6743,56 @@ const ( // Examples: "call_mszuSIzqtI65i1wAUOE8w5H4" GenAIToolCallIDKey = attribute.Key("gen_ai.tool.call.id") + // GenAIToolCallResultKey is the attribute Key conforming to the + // "gen_ai.tool.call.result" semantic conventions. It represents the result + // returned by the tool call (if any and if execution was successful). + // + // Type: any + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "{\n "temperature_range": {\n "high": 75,\n "low": 60\n },\n + // "conditions": "sunny"\n}\n" + // Note: > [!WARNING] + // + // > This attribute may contain sensitive information. + // + // It's expected to be an object - in case a serialized string is available + // to the instrumentation, the instrumentation SHOULD do the best effort to + // deserialize it to an object. When recorded on spans, it MAY be recorded as a + // JSON string if structured format is not supported and SHOULD be recorded in + // structured form otherwise. + GenAIToolCallResultKey = attribute.Key("gen_ai.tool.call.result") + + // GenAIToolDefinitionsKey is the attribute Key conforming to the + // "gen_ai.tool.definitions" semantic conventions. It represents the list of + // source system tool definitions available to the GenAI agent or model. + // + // Type: any + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "[\n {\n "type": "function",\n "name": "get_current_weather",\n + // "description": "Get the current weather in a given location",\n "parameters": + // {\n "type": "object",\n "properties": {\n "location": {\n "type": "string",\n + // "description": "The city and state, e.g. San Francisco, CA"\n },\n "unit": + // {\n "type": "string",\n "enum": [\n "celsius",\n "fahrenheit"\n ]\n }\n },\n + // "required": [\n "location",\n "unit"\n ]\n }\n }\n]\n" + // Note: The value of this attribute matches source system tool definition + // format. + // + // It's expected to be an array of objects where each object represents a tool + // definition. In case a serialized string is available + // to the instrumentation, the instrumentation SHOULD do the best effort to + // deserialize it to an array. When recorded on spans, it MAY be recorded as a + // JSON string if structured format is not supported and SHOULD be recorded in + // structured form otherwise. + // + // Since this attribute could be large, it's NOT RECOMMENDED to populate + // it by default. Instrumentations MAY provide a way to enable + // populating this attribute. + GenAIToolDefinitionsKey = attribute.Key("gen_ai.tool.definitions") + // GenAIToolDescriptionKey is the attribute Key conforming to the // "gen_ai.tool.description" semantic conventions. It represents the tool // description. @@ -6473,6 +6895,48 @@ func GenAIDataSourceID(val string) attribute.KeyValue { return GenAIDataSourceIDKey.String(val) } +// GenAIEmbeddingsDimensionCount returns an attribute KeyValue conforming to the +// "gen_ai.embeddings.dimension.count" semantic conventions. It represents the +// number of dimensions the resulting output embeddings should have. +func GenAIEmbeddingsDimensionCount(val int) attribute.KeyValue { + return GenAIEmbeddingsDimensionCountKey.Int(val) +} + +// GenAIEvaluationExplanation returns an attribute KeyValue conforming to the +// "gen_ai.evaluation.explanation" semantic conventions. It represents a +// free-form explanation for the assigned score provided by the evaluator. +func GenAIEvaluationExplanation(val string) attribute.KeyValue { + return GenAIEvaluationExplanationKey.String(val) +} + +// GenAIEvaluationName returns an attribute KeyValue conforming to the +// "gen_ai.evaluation.name" semantic conventions. It represents the name of the +// evaluation metric used for the GenAI response. +func GenAIEvaluationName(val string) attribute.KeyValue { + return GenAIEvaluationNameKey.String(val) +} + +// GenAIEvaluationScoreLabel returns an attribute KeyValue conforming to the +// "gen_ai.evaluation.score.label" semantic conventions. It represents the human +// readable label for evaluation. +func GenAIEvaluationScoreLabel(val string) attribute.KeyValue { + return GenAIEvaluationScoreLabelKey.String(val) +} + +// GenAIEvaluationScoreValue returns an attribute KeyValue conforming to the +// "gen_ai.evaluation.score.value" semantic conventions. It represents the +// evaluation score returned by the evaluator. +func GenAIEvaluationScoreValue(val float64) attribute.KeyValue { + return GenAIEvaluationScoreValueKey.Float64(val) +} + +// GenAIPromptName returns an attribute KeyValue conforming to the +// "gen_ai.prompt.name" semantic conventions. It represents the name of the +// prompt that uniquely identifies it. +func GenAIPromptName(val string) attribute.KeyValue { + return GenAIPromptNameKey.String(val) +} + // GenAIRequestChoiceCount returns an attribute KeyValue conforming to the // "gen_ai.request.choice.count" semantic conventions. It represents the target // number of candidate completions to return. @@ -7413,8 +7877,9 @@ const ( // Examples: "GET", "POST", "HEAD" // Note: HTTP request method value SHOULD be "known" to the instrumentation. // By default, this convention defines "known" methods as the ones listed in - // [RFC9110] - // and the PATCH method defined in [RFC5789]. + // [RFC9110], + // the PATCH method defined in [RFC5789] + // and the QUERY method defined in [httpbis-safe-method-w-body]. // // If the HTTP request method is not known to instrumentation, it MUST set the // `http.request.method` attribute to `_OTHER`. @@ -7437,6 +7902,7 @@ const ( // // [RFC9110]: https://www.rfc-editor.org/rfc/rfc9110.html#name-methods // [RFC5789]: https://www.rfc-editor.org/rfc/rfc5789.html + // [httpbis-safe-method-w-body]: https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/?include_text=1 HTTPRequestMethodKey = attribute.Key("http.request.method") // HTTPRequestMethodOriginalKey is the attribute Key conforming to the @@ -7514,19 +7980,36 @@ const ( HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code") // HTTPRouteKey is the attribute Key conforming to the "http.route" semantic - // conventions. It represents the matched route, that is, the path template in - // the format used by the respective server framework. + // conventions. It represents the matched route template for the request. This + // MUST be low-cardinality and include all static path segments, with dynamic + // path segments represented with placeholders. // // Type: string // RequirementLevel: Recommended // Stability: Stable // - // Examples: "/users/:userID?", "{controller}/{action}/{id?}" + // Examples: "/users/:userID?", "my-controller/my-action/{id?}" // Note: MUST NOT be populated when this is not supported by the HTTP server // framework as the route attribute should have low-cardinality and the URI path // can NOT substitute it. // SHOULD include the [application root] if there is one. // + // A static path segment is a part of the route template with a fixed, + // low-cardinality value. This includes literal strings like `/users/` and + // placeholders that + // are constrained to a finite, predefined set of values, e.g. `{controller}` or + // `{action}`. + // + // A dynamic path segment is a placeholder for a value that can have high + // cardinality and is not constrained to a predefined list like static path + // segments. + // + // Instrumentations SHOULD use routing information provided by the corresponding + // web framework. They SHOULD pick the most precise source of routing + // information and MAY + // support custom route formatting. Instrumentations SHOULD document the format + // and the API used to obtain the route string. + // // [application root]: /docs/http/http-spans.md#http-server-definitions HTTPRouteKey = attribute.Key("http.route") ) @@ -7613,8 +8096,9 @@ func HTTPResponseStatusCode(val int) attribute.KeyValue { } // HTTPRoute returns an attribute KeyValue conforming to the "http.route" -// semantic conventions. It represents the matched route, that is, the path -// template in the format used by the respective server framework. +// semantic conventions. It represents the matched route template for the +// request. This MUST be low-cardinality and include all static path segments, +// with dynamic path segments represented with placeholders. func HTTPRoute(val string) attribute.KeyValue { return HTTPRouteKey.String(val) } @@ -7658,6 +8142,9 @@ var ( // TRACE method. // Stability: stable HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE") + // QUERY method. + // Stability: development + HTTPRequestMethodQuery = HTTPRequestMethodKey.String("QUERY") // Any HTTP method that the instrumentation has no prior knowledge of. // Stability: stable HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER") @@ -8300,6 +8787,57 @@ var ( IOSAppStateTerminate = IOSAppStateKey.String("terminate") ) +// Namespace: jsonrpc +const ( + // JSONRPCProtocolVersionKey is the attribute Key conforming to the + // "jsonrpc.protocol.version" semantic conventions. It represents the protocol + // version, as specified in the `jsonrpc` property of the request and its + // corresponding response. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "2.0", "1.0" + JSONRPCProtocolVersionKey = attribute.Key("jsonrpc.protocol.version") + + // JSONRPCRequestIDKey is the attribute Key conforming to the + // "jsonrpc.request.id" semantic conventions. It represents a string + // representation of the `id` property of the request and its corresponding + // response. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "10", "request-7" + // Note: Under the [JSON-RPC specification], the `id` property may be a string, + // number, null, or omitted entirely. When omitted, the request is treated as a + // notification. Using `null` is not equivalent to omitting the `id`, but it is + // discouraged. + // Instrumentations SHOULD NOT capture this attribute when the `id` is `null` or + // omitted. + // + // [JSON-RPC specification]: https://www.jsonrpc.org/specification + JSONRPCRequestIDKey = attribute.Key("jsonrpc.request.id") +) + +// JSONRPCProtocolVersion returns an attribute KeyValue conforming to the +// "jsonrpc.protocol.version" semantic conventions. It represents the protocol +// version, as specified in the `jsonrpc` property of the request and its +// corresponding response. +func JSONRPCProtocolVersion(val string) attribute.KeyValue { + return JSONRPCProtocolVersionKey.String(val) +} + +// JSONRPCRequestID returns an attribute KeyValue conforming to the +// "jsonrpc.request.id" semantic conventions. It represents a string +// representation of the `id` property of the request and its corresponding +// response. +func JSONRPCRequestID(val string) attribute.KeyValue { + return JSONRPCRequestIDKey.String(val) +} + // Namespace: k8s const ( // K8SClusterNameKey is the attribute Key conforming to the "k8s.cluster.name" @@ -8307,7 +8845,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "opentelemetry-cluster" K8SClusterNameKey = attribute.Key("k8s.cluster.name") @@ -8318,7 +8856,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "218fc5a9-a5f1-4b54-aa05-46717d0ab26d" // Note: K8s doesn't have support for obtaining a cluster ID. If this is ever @@ -8354,7 +8892,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "redis" K8SContainerNameKey = attribute.Key("k8s.container.name") @@ -8366,7 +8904,7 @@ const ( // // Type: int // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count") @@ -8417,7 +8955,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "opentelemetry" K8SCronJobNameKey = attribute.Key("k8s.cronjob.name") @@ -8427,7 +8965,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid") @@ -8438,7 +8976,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "opentelemetry" K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name") @@ -8448,7 +8986,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid") @@ -8459,7 +8997,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "opentelemetry" K8SDeploymentNameKey = attribute.Key("k8s.deployment.name") @@ -8470,7 +9008,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid") @@ -8560,7 +9098,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "opentelemetry" K8SJobNameKey = attribute.Key("k8s.job.name") @@ -8570,7 +9108,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SJobUIDKey = attribute.Key("k8s.job.uid") @@ -8581,7 +9119,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "default" K8SNamespaceNameKey = attribute.Key("k8s.namespace.name") @@ -8646,7 +9184,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "node-1" K8SNodeNameKey = attribute.Key("k8s.node.name") @@ -8656,27 +9194,106 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2" K8SNodeUIDKey = attribute.Key("k8s.node.uid") + // K8SPodHostnameKey is the attribute Key conforming to the "k8s.pod.hostname" + // semantic conventions. It represents the specifies the hostname of the Pod. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Alpha + // + // Examples: "collector-gateway" + // Note: The K8s Pod spec has an optional hostname field, which can be used to + // specify a hostname. + // Refer to [K8s docs] + // for more information about this field. + // + // This attribute aligns with the `hostname` field of the + // [K8s PodSpec]. + // + // [K8s docs]: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-hostname-and-subdomain-field + // [K8s PodSpec]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podspec-v1-core + K8SPodHostnameKey = attribute.Key("k8s.pod.hostname") + + // K8SPodIPKey is the attribute Key conforming to the "k8s.pod.ip" semantic + // conventions. It represents the IP address allocated to the Pod. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Alpha + // + // Examples: "172.18.0.2" + // Note: This attribute aligns with the `podIP` field of the + // [K8s PodStatus]. + // + // [K8s PodStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podstatus-v1-core + K8SPodIPKey = attribute.Key("k8s.pod.ip") + // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name" semantic // conventions. It represents the name of the Pod. // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "opentelemetry-pod-autoconf" K8SPodNameKey = attribute.Key("k8s.pod.name") + // K8SPodStartTimeKey is the attribute Key conforming to the + // "k8s.pod.start_time" semantic conventions. It represents the start timestamp + // of the Pod. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Alpha + // + // Examples: "2025-12-04T08:41:03Z" + // Note: Date and time at which the object was acknowledged by the Kubelet. + // This is before the Kubelet pulled the container image(s) for the pod. + // + // This attribute aligns with the `startTime` field of the + // [K8s PodStatus], + // in ISO 8601 (RFC 3339 compatible) format. + // + // [K8s PodStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podstatus-v1-core + K8SPodStartTimeKey = attribute.Key("k8s.pod.start_time") + + // K8SPodStatusPhaseKey is the attribute Key conforming to the + // "k8s.pod.status.phase" semantic conventions. It represents the phase for the + // pod. Corresponds to the `phase` field of the: [K8s PodStatus]. + // + // Type: Enum + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "Pending", "Running" + // + // [K8s PodStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.33/#podstatus-v1-core + K8SPodStatusPhaseKey = attribute.Key("k8s.pod.status.phase") + + // K8SPodStatusReasonKey is the attribute Key conforming to the + // "k8s.pod.status.reason" semantic conventions. It represents the reason for + // the pod state. Corresponds to the `reason` field of the: [K8s PodStatus]. + // + // Type: Enum + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "Evicted", "NodeAffinity" + // + // [K8s PodStatus]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.33/#podstatus-v1-core + K8SPodStatusReasonKey = attribute.Key("k8s.pod.status.reason") + // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid" semantic // conventions. It represents the UID of the Pod. // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SPodUIDKey = attribute.Key("k8s.pod.uid") @@ -8687,7 +9304,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "opentelemetry" K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name") @@ -8698,7 +9315,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid") @@ -8752,7 +9369,7 @@ const ( // Kubernetes for object count quotas. See // [Kubernetes Resource Quotas documentation] for more details. // - // [Kubernetes Resource Quotas documentation]: https://kubernetes.io/docs/concepts/policy/resource-quotas/#object-count-quota + // [Kubernetes Resource Quotas documentation]: https://kubernetes.io/docs/concepts/policy/resource-quotas/#quota-on-object-count K8SResourceQuotaResourceNameKey = attribute.Key("k8s.resourcequota.resource_name") // K8SResourceQuotaUIDKey is the attribute Key conforming to the @@ -8772,7 +9389,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "opentelemetry" K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name") @@ -8783,7 +9400,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: Development + // Stability: Alpha // // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid") @@ -9082,6 +9699,19 @@ func K8SPodAnnotation(key string, val string) attribute.KeyValue { return attribute.String("k8s.pod.annotation."+key, val) } +// K8SPodHostname returns an attribute KeyValue conforming to the +// "k8s.pod.hostname" semantic conventions. It represents the specifies the +// hostname of the Pod. +func K8SPodHostname(val string) attribute.KeyValue { + return K8SPodHostnameKey.String(val) +} + +// K8SPodIP returns an attribute KeyValue conforming to the "k8s.pod.ip" semantic +// conventions. It represents the IP address allocated to the Pod. +func K8SPodIP(val string) attribute.KeyValue { + return K8SPodIPKey.String(val) +} + // K8SPodLabel returns an attribute KeyValue conforming to the "k8s.pod.label" // semantic conventions. It represents the label placed on the Pod, the `` // being the label name, the value being the label value. @@ -9095,6 +9725,13 @@ func K8SPodName(val string) attribute.KeyValue { return K8SPodNameKey.String(val) } +// K8SPodStartTime returns an attribute KeyValue conforming to the +// "k8s.pod.start_time" semantic conventions. It represents the start timestamp +// of the Pod. +func K8SPodStartTime(val string) attribute.KeyValue { + return K8SPodStartTimeKey.String(val) +} + // K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid" // semantic conventions. It represents the UID of the Pod. func K8SPodUID(val string) attribute.KeyValue { @@ -9303,6 +9940,61 @@ var ( K8SNodeConditionTypeNetworkUnavailable = K8SNodeConditionTypeKey.String("NetworkUnavailable") ) +// Enum values for k8s.pod.status.phase +var ( + // The pod has been accepted by the system, but one or more of the containers + // has not been started. This includes time before being bound to a node, as + // well as time spent pulling images onto the host. + // + // Stability: development + K8SPodStatusPhasePending = K8SPodStatusPhaseKey.String("Pending") + // The pod has been bound to a node and all of the containers have been started. + // At least one container is still running or is in the process of being + // restarted. + // + // Stability: development + K8SPodStatusPhaseRunning = K8SPodStatusPhaseKey.String("Running") + // All containers in the pod have voluntarily terminated with a container exit + // code of 0, and the system is not going to restart any of these containers. + // + // Stability: development + K8SPodStatusPhaseSucceeded = K8SPodStatusPhaseKey.String("Succeeded") + // All containers in the pod have terminated, and at least one container has + // terminated in a failure (exited with a non-zero exit code or was stopped by + // the system). + // + // Stability: development + K8SPodStatusPhaseFailed = K8SPodStatusPhaseKey.String("Failed") + // For some reason the state of the pod could not be obtained, typically due to + // an error in communicating with the host of the pod. + // + // Stability: development + K8SPodStatusPhaseUnknown = K8SPodStatusPhaseKey.String("Unknown") +) + +// Enum values for k8s.pod.status.reason +var ( + // The pod is evicted. + // Stability: development + K8SPodStatusReasonEvicted = K8SPodStatusReasonKey.String("Evicted") + // The pod is in a status because of its node affinity + // Stability: development + K8SPodStatusReasonNodeAffinity = K8SPodStatusReasonKey.String("NodeAffinity") + // The reason on a pod when its state cannot be confirmed as kubelet is + // unresponsive on the node it is (was) running. + // + // Stability: development + K8SPodStatusReasonNodeLost = K8SPodStatusReasonKey.String("NodeLost") + // The node is shutdown + // Stability: development + K8SPodStatusReasonShutdown = K8SPodStatusReasonKey.String("Shutdown") + // The pod was rejected admission to the node because of an error during + // admission that could not be categorized. + // + // Stability: development + K8SPodStatusReasonUnexpectedAdmissionError = K8SPodStatusReasonKey.String("UnexpectedAdmissionError") +) + // Enum values for k8s.volume.type var ( // A [persistentVolumeClaim] volume @@ -9337,30 +10029,6 @@ var ( K8SVolumeTypeLocal = K8SVolumeTypeKey.String("local") ) -// Namespace: linux -const ( - // LinuxMemorySlabStateKey is the attribute Key conforming to the - // "linux.memory.slab.state" semantic conventions. It represents the Linux Slab - // memory state. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "reclaimable", "unreclaimable" - LinuxMemorySlabStateKey = attribute.Key("linux.memory.slab.state") -) - -// Enum values for linux.memory.slab.state -var ( - // reclaimable - // Stability: development - LinuxMemorySlabStateReclaimable = LinuxMemorySlabStateKey.String("reclaimable") - // unreclaimable - // Stability: development - LinuxMemorySlabStateUnreclaimable = LinuxMemorySlabStateKey.String("unreclaimable") -) - // Namespace: log const ( // LogFileNameKey is the attribute Key conforming to the "log.file.name" @@ -9521,6 +10189,188 @@ func MainframeLparName(val string) attribute.KeyValue { return MainframeLparNameKey.String(val) } +// Namespace: mcp +const ( + // McpMethodNameKey is the attribute Key conforming to the "mcp.method.name" + // semantic conventions. It represents the name of the request or notification + // method. + // + // Type: Enum + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: + McpMethodNameKey = attribute.Key("mcp.method.name") + + // McpProtocolVersionKey is the attribute Key conforming to the + // "mcp.protocol.version" semantic conventions. It represents the [version] of + // the Model Context Protocol used. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "2025-06-18" + // + // [version]: https://modelcontextprotocol.io/specification/versioning + McpProtocolVersionKey = attribute.Key("mcp.protocol.version") + + // McpResourceURIKey is the attribute Key conforming to the "mcp.resource.uri" + // semantic conventions. It represents the value of the resource uri. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "postgres://database/customers/schema", + // "file:///home/user/documents/report.pdf" + // Note: This is a URI of the resource provided in the following requests or + // notifications: `resources/read`, `resources/subscribe`, + // `resources/unsubscribe`, or `notifications/resources/updated`. + McpResourceURIKey = attribute.Key("mcp.resource.uri") + + // McpSessionIDKey is the attribute Key conforming to the "mcp.session.id" + // semantic conventions. It represents the identifies [MCP session]. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "191c4850af6c49e08843a3f6c80e5046" + // + // [MCP session]: https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#session-management + McpSessionIDKey = attribute.Key("mcp.session.id") +) + +// McpProtocolVersion returns an attribute KeyValue conforming to the +// "mcp.protocol.version" semantic conventions. It represents the [version] of +// the Model Context Protocol used. +// +// [version]: https://modelcontextprotocol.io/specification/versioning +func McpProtocolVersion(val string) attribute.KeyValue { + return McpProtocolVersionKey.String(val) +} + +// McpResourceURI returns an attribute KeyValue conforming to the +// "mcp.resource.uri" semantic conventions. It represents the value of the +// resource uri. +func McpResourceURI(val string) attribute.KeyValue { + return McpResourceURIKey.String(val) +} + +// McpSessionID returns an attribute KeyValue conforming to the "mcp.session.id" +// semantic conventions. It represents the identifies [MCP session]. +// +// [MCP session]: https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#session-management +func McpSessionID(val string) attribute.KeyValue { + return McpSessionIDKey.String(val) +} + +// Enum values for mcp.method.name +var ( + // Notification cancelling a previously-issued request. + // + // Stability: development + McpMethodNameNotificationsCancelled = McpMethodNameKey.String("notifications/cancelled") + // Request to initialize the MCP client. + // + // Stability: development + McpMethodNameInitialize = McpMethodNameKey.String("initialize") + // Notification indicating that the MCP client has been initialized. + // + // Stability: development + McpMethodNameNotificationsInitialized = McpMethodNameKey.String("notifications/initialized") + // Notification indicating the progress for a long-running operation. + // + // Stability: development + McpMethodNameNotificationsProgress = McpMethodNameKey.String("notifications/progress") + // Request to check that the other party is still alive. + // + // Stability: development + McpMethodNamePing = McpMethodNameKey.String("ping") + // Request to list resources available on server. + // + // Stability: development + McpMethodNameResourcesList = McpMethodNameKey.String("resources/list") + // Request to list resource templates available on server. + // + // Stability: development + McpMethodNameResourcesTemplatesList = McpMethodNameKey.String("resources/templates/list") + // Request to read a resource. + // + // Stability: development + McpMethodNameResourcesRead = McpMethodNameKey.String("resources/read") + // Notification indicating that the list of resources has changed. + // + // Stability: development + McpMethodNameNotificationsResourcesListChanged = McpMethodNameKey.String("notifications/resources/list_changed") + // Request to subscribe to a resource. + // + // Stability: development + McpMethodNameResourcesSubscribe = McpMethodNameKey.String("resources/subscribe") + // Request to unsubscribe from resource updates. + // + // Stability: development + McpMethodNameResourcesUnsubscribe = McpMethodNameKey.String("resources/unsubscribe") + // Notification indicating that a resource has been updated. + // + // Stability: development + McpMethodNameNotificationsResourcesUpdated = McpMethodNameKey.String("notifications/resources/updated") + // Request to list prompts available on server. + // + // Stability: development + McpMethodNamePromptsList = McpMethodNameKey.String("prompts/list") + // Request to get a prompt. + // + // Stability: development + McpMethodNamePromptsGet = McpMethodNameKey.String("prompts/get") + // Notification indicating that the list of prompts has changed. + // + // Stability: development + McpMethodNameNotificationsPromptsListChanged = McpMethodNameKey.String("notifications/prompts/list_changed") + // Request to list tools available on server. + // + // Stability: development + McpMethodNameToolsList = McpMethodNameKey.String("tools/list") + // Request to call a tool. + // + // Stability: development + McpMethodNameToolsCall = McpMethodNameKey.String("tools/call") + // Notification indicating that the list of tools has changed. + // + // Stability: development + McpMethodNameNotificationsToolsListChanged = McpMethodNameKey.String("notifications/tools/list_changed") + // Request to set the logging level. + // + // Stability: development + McpMethodNameLoggingSetLevel = McpMethodNameKey.String("logging/setLevel") + // Notification indicating that a message has been received. + // + // Stability: development + McpMethodNameNotificationsMessage = McpMethodNameKey.String("notifications/message") + // Request to create a sampling message. + // + // Stability: development + McpMethodNameSamplingCreateMessage = McpMethodNameKey.String("sampling/createMessage") + // Request to complete a prompt. + // + // Stability: development + McpMethodNameCompletionComplete = McpMethodNameKey.String("completion/complete") + // Request to list roots available on server. + // + // Stability: development + McpMethodNameRootsList = McpMethodNameKey.String("roots/list") + // Notification indicating that the list of roots has changed. + // + // Stability: development + McpMethodNameNotificationsRootsListChanged = McpMethodNameKey.String("notifications/roots/list_changed") + // Request from the server to elicit additional information from the user via + // the client + // + // Stability: development + McpMethodNameElicitationCreate = McpMethodNameKey.String("elicitation/create") +) + // Namespace: messaging const ( // MessagingBatchMessageCountKey is the attribute Key conforming to the @@ -10772,6 +11622,47 @@ var ( NetworkTypeIPv6 = NetworkTypeKey.String("ipv6") ) +// Namespace: nfs +const ( + // NfsOperationNameKey is the attribute Key conforming to the + // "nfs.operation.name" semantic conventions. It represents the NFSv4+ operation + // name. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "OPEN", "READ", "GETATTR" + NfsOperationNameKey = attribute.Key("nfs.operation.name") + + // NfsServerRepcacheStatusKey is the attribute Key conforming to the + // "nfs.server.repcache.status" semantic conventions. It represents the linux: + // one of "hit" (NFSD_STATS_RC_HITS), "miss" (NFSD_STATS_RC_MISSES), or + // "nocache" (NFSD_STATS_RC_NOCACHE -- uncacheable). + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: hit + NfsServerRepcacheStatusKey = attribute.Key("nfs.server.repcache.status") +) + +// NfsOperationName returns an attribute KeyValue conforming to the +// "nfs.operation.name" semantic conventions. It represents the NFSv4+ operation +// name. +func NfsOperationName(val string) attribute.KeyValue { + return NfsOperationNameKey.String(val) +} + +// NfsServerRepcacheStatus returns an attribute KeyValue conforming to the +// "nfs.server.repcache.status" semantic conventions. It represents the linux: +// one of "hit" (NFSD_STATS_RC_HITS), "miss" (NFSD_STATS_RC_MISSES), or "nocache" +// (NFSD_STATS_RC_NOCACHE -- uncacheable). +func NfsServerRepcacheStatus(val string) attribute.KeyValue { + return NfsServerRepcacheStatusKey.String(val) +} + // Namespace: oci const ( // OCIManifestDigestKey is the attribute Key conforming to the @@ -10803,6 +11694,80 @@ func OCIManifestDigest(val string) attribute.KeyValue { return OCIManifestDigestKey.String(val) } +// Namespace: onc_rpc +const ( + // OncRPCProcedureNameKey is the attribute Key conforming to the + // "onc_rpc.procedure.name" semantic conventions. It represents the ONC/Sun RPC + // procedure name. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "OPEN", "READ", "GETATTR" + OncRPCProcedureNameKey = attribute.Key("onc_rpc.procedure.name") + + // OncRPCProcedureNumberKey is the attribute Key conforming to the + // "onc_rpc.procedure.number" semantic conventions. It represents the ONC/Sun + // RPC procedure number. + // + // Type: int + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: + OncRPCProcedureNumberKey = attribute.Key("onc_rpc.procedure.number") + + // OncRPCProgramNameKey is the attribute Key conforming to the + // "onc_rpc.program.name" semantic conventions. It represents the ONC/Sun RPC + // program name. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "portmapper", "nfs" + OncRPCProgramNameKey = attribute.Key("onc_rpc.program.name") + + // OncRPCVersionKey is the attribute Key conforming to the "onc_rpc.version" + // semantic conventions. It represents the ONC/Sun RPC program version. + // + // Type: int + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: + OncRPCVersionKey = attribute.Key("onc_rpc.version") +) + +// OncRPCProcedureName returns an attribute KeyValue conforming to the +// "onc_rpc.procedure.name" semantic conventions. It represents the ONC/Sun RPC +// procedure name. +func OncRPCProcedureName(val string) attribute.KeyValue { + return OncRPCProcedureNameKey.String(val) +} + +// OncRPCProcedureNumber returns an attribute KeyValue conforming to the +// "onc_rpc.procedure.number" semantic conventions. It represents the ONC/Sun RPC +// procedure number. +func OncRPCProcedureNumber(val int) attribute.KeyValue { + return OncRPCProcedureNumberKey.Int(val) +} + +// OncRPCProgramName returns an attribute KeyValue conforming to the +// "onc_rpc.program.name" semantic conventions. It represents the ONC/Sun RPC +// program name. +func OncRPCProgramName(val string) attribute.KeyValue { + return OncRPCProgramNameKey.String(val) +} + +// OncRPCVersion returns an attribute KeyValue conforming to the +// "onc_rpc.version" semantic conventions. It represents the ONC/Sun RPC program +// version. +func OncRPCVersion(val int) attribute.KeyValue { + return OncRPCVersionKey.Int(val) +} + // Namespace: openai const ( // OpenAIRequestServiceTierKey is the attribute Key conforming to the @@ -10863,26 +11828,65 @@ var ( OpenAIRequestServiceTierDefault = OpenAIRequestServiceTierKey.String("default") ) -// Namespace: opentracing +// Namespace: openshift const ( - // OpenTracingRefTypeKey is the attribute Key conforming to the - // "opentracing.ref_type" semantic conventions. It represents the parent-child - // Reference type. + // OpenShiftClusterquotaNameKey is the attribute Key conforming to the + // "openshift.clusterquota.name" semantic conventions. It represents the name of + // the cluster quota. // - // Type: Enum + // Type: string // RequirementLevel: Recommended // Stability: Development // - // Examples: - // Note: The causal relationship between a child Span and a parent Span. - OpenTracingRefTypeKey = attribute.Key("opentracing.ref_type") -) + // Examples: "opentelemetry" + OpenShiftClusterquotaNameKey = attribute.Key("openshift.clusterquota.name") -// Enum values for opentracing.ref_type -var ( - // The parent Span depends on the child Span in some capacity - // Stability: development - OpenTracingRefTypeChildOf = OpenTracingRefTypeKey.String("child_of") + // OpenShiftClusterquotaUIDKey is the attribute Key conforming to the + // "openshift.clusterquota.uid" semantic conventions. It represents the UID of + // the cluster quota. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "275ecb36-5aa8-4c2a-9c47-d8bb681b9aff" + OpenShiftClusterquotaUIDKey = attribute.Key("openshift.clusterquota.uid") +) + +// OpenShiftClusterquotaName returns an attribute KeyValue conforming to the +// "openshift.clusterquota.name" semantic conventions. It represents the name of +// the cluster quota. +func OpenShiftClusterquotaName(val string) attribute.KeyValue { + return OpenShiftClusterquotaNameKey.String(val) +} + +// OpenShiftClusterquotaUID returns an attribute KeyValue conforming to the +// "openshift.clusterquota.uid" semantic conventions. It represents the UID of +// the cluster quota. +func OpenShiftClusterquotaUID(val string) attribute.KeyValue { + return OpenShiftClusterquotaUIDKey.String(val) +} + +// Namespace: opentracing +const ( + // OpenTracingRefTypeKey is the attribute Key conforming to the + // "opentracing.ref_type" semantic conventions. It represents the parent-child + // Reference type. + // + // Type: Enum + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: + // Note: The causal relationship between a child Span and a parent Span. + OpenTracingRefTypeKey = attribute.Key("opentracing.ref_type") +) + +// Enum values for opentracing.ref_type +var ( + // The parent Span depends on the child Span in some capacity + // Stability: development + OpenTracingRefTypeChildOf = OpenTracingRefTypeKey.String("child_of") // The parent Span doesn't depend in any way on the result of the child Span // Stability: development OpenTracingRefTypeFollowsFrom = OpenTracingRefTypeKey.String("follows_from") @@ -11064,6 +12068,20 @@ const ( // E.g. for Java the fully qualified classname SHOULD be used in this case. OTelComponentTypeKey = attribute.Key("otel.component.type") + // OTelEventNameKey is the attribute Key conforming to the "otel.event.name" + // semantic conventions. It represents the identifies the class / type of event. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "browser.mouse.click", "device.app.lifecycle" + // Note: This attribute SHOULD be used by non-OTLP exporters when destination + // does not support `EventName` or equivalent field. This attribute MAY be used + // by applications using existing logging libraries so that it can be used to + // set the `EventName` field by Collector or SDK components. + OTelEventNameKey = attribute.Key("otel.event.name") + // OTelScopeNameKey is the attribute Key conforming to the "otel.scope.name" // semantic conventions. It represents the name of the instrumentation scope - ( // `InstrumentationScope.Name` in OTLP). @@ -11153,6 +12171,13 @@ func OTelComponentName(val string) attribute.KeyValue { return OTelComponentNameKey.String(val) } +// OTelEventName returns an attribute KeyValue conforming to the +// "otel.event.name" semantic conventions. It represents the identifies the class +// / type of event. +func OTelEventName(val string) attribute.KeyValue { + return OTelEventNameKey.String(val) +} + // OTelScopeName returns an attribute KeyValue conforming to the // "otel.scope.name" semantic conventions. It represents the name of the // instrumentation scope - (`InstrumentationScope.Name` in OTLP). @@ -11290,31 +12315,183 @@ var ( OTelStatusCodeError = OTelStatusCodeKey.String("ERROR") ) -// Namespace: peer +// Namespace: pprof const ( - // PeerServiceKey is the attribute Key conforming to the "peer.service" semantic - // conventions. It represents the [`service.name`] of the remote service. SHOULD - // be equal to the actual `service.name` resource attribute of the remote - // service if any. + // PprofLocationIsFoldedKey is the attribute Key conforming to the + // "pprof.location.is_folded" semantic conventions. It represents the provides + // an indication that multiple symbols map to this location's address, for + // example due to identical code folding by the linker. In that case the line + // information represents one of the multiple symbols. This field must be + // recomputed when the symbolization state of the profile changes. + // + // Type: boolean + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: + PprofLocationIsFoldedKey = attribute.Key("pprof.location.is_folded") + + // PprofMappingHasFilenamesKey is the attribute Key conforming to the + // "pprof.mapping.has_filenames" semantic conventions. It represents the + // indicates that there are filenames related to this mapping. + // + // Type: boolean + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: + PprofMappingHasFilenamesKey = attribute.Key("pprof.mapping.has_filenames") + + // PprofMappingHasFunctionsKey is the attribute Key conforming to the + // "pprof.mapping.has_functions" semantic conventions. It represents the + // indicates that there are functions related to this mapping. + // + // Type: boolean + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: + PprofMappingHasFunctionsKey = attribute.Key("pprof.mapping.has_functions") + + // PprofMappingHasInlineFramesKey is the attribute Key conforming to the + // "pprof.mapping.has_inline_frames" semantic conventions. It represents the + // indicates that there are inline frames related to this mapping. + // + // Type: boolean + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: + PprofMappingHasInlineFramesKey = attribute.Key("pprof.mapping.has_inline_frames") + + // PprofMappingHasLineNumbersKey is the attribute Key conforming to the + // "pprof.mapping.has_line_numbers" semantic conventions. It represents the + // indicates that there are line numbers related to this mapping. + // + // Type: boolean + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: + PprofMappingHasLineNumbersKey = attribute.Key("pprof.mapping.has_line_numbers") + + // PprofProfileCommentKey is the attribute Key conforming to the + // "pprof.profile.comment" semantic conventions. It represents the free-form + // text associated with the profile. This field should not be used to store any + // machine-readable information, it is only for human-friendly content. + // + // Type: string[] + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "hello world", "bazinga" + PprofProfileCommentKey = attribute.Key("pprof.profile.comment") + + // PprofProfileDocURLKey is the attribute Key conforming to the + // "pprof.profile.doc_url" semantic conventions. It represents the documentation + // link for this profile type. // // Type: string // RequirementLevel: Recommended // Stability: Development // - // Examples: AuthTokenCache + // Examples: "http://pprof.example.com/cpu-profile.html" + // Note: The URL must be absolute and may be missing if the profile was + // generated by code that did not supply a link + PprofProfileDocURLKey = attribute.Key("pprof.profile.doc_url") + + // PprofProfileDropFramesKey is the attribute Key conforming to the + // "pprof.profile.drop_frames" semantic conventions. It represents the frames + // with Function.function_name fully matching the regexp will be dropped from + // the samples, along with their successors. // - // [`service.name`]: /docs/resource/README.md#service - PeerServiceKey = attribute.Key("peer.service") + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "/foobar/" + PprofProfileDropFramesKey = attribute.Key("pprof.profile.drop_frames") + + // PprofProfileKeepFramesKey is the attribute Key conforming to the + // "pprof.profile.keep_frames" semantic conventions. It represents the frames + // with Function.function_name fully matching the regexp will be kept, even if + // it matches drop_frames. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "/bazinga/" + PprofProfileKeepFramesKey = attribute.Key("pprof.profile.keep_frames") ) -// PeerService returns an attribute KeyValue conforming to the "peer.service" -// semantic conventions. It represents the [`service.name`] of the remote -// service. SHOULD be equal to the actual `service.name` resource attribute of -// the remote service if any. -// -// [`service.name`]: /docs/resource/README.md#service -func PeerService(val string) attribute.KeyValue { - return PeerServiceKey.String(val) +// PprofLocationIsFolded returns an attribute KeyValue conforming to the +// "pprof.location.is_folded" semantic conventions. It represents the provides an +// indication that multiple symbols map to this location's address, for example +// due to identical code folding by the linker. In that case the line information +// represents one of the multiple symbols. This field must be recomputed when the +// symbolization state of the profile changes. +func PprofLocationIsFolded(val bool) attribute.KeyValue { + return PprofLocationIsFoldedKey.Bool(val) +} + +// PprofMappingHasFilenames returns an attribute KeyValue conforming to the +// "pprof.mapping.has_filenames" semantic conventions. It represents the +// indicates that there are filenames related to this mapping. +func PprofMappingHasFilenames(val bool) attribute.KeyValue { + return PprofMappingHasFilenamesKey.Bool(val) +} + +// PprofMappingHasFunctions returns an attribute KeyValue conforming to the +// "pprof.mapping.has_functions" semantic conventions. It represents the +// indicates that there are functions related to this mapping. +func PprofMappingHasFunctions(val bool) attribute.KeyValue { + return PprofMappingHasFunctionsKey.Bool(val) +} + +// PprofMappingHasInlineFrames returns an attribute KeyValue conforming to the +// "pprof.mapping.has_inline_frames" semantic conventions. It represents the +// indicates that there are inline frames related to this mapping. +func PprofMappingHasInlineFrames(val bool) attribute.KeyValue { + return PprofMappingHasInlineFramesKey.Bool(val) +} + +// PprofMappingHasLineNumbers returns an attribute KeyValue conforming to the +// "pprof.mapping.has_line_numbers" semantic conventions. It represents the +// indicates that there are line numbers related to this mapping. +func PprofMappingHasLineNumbers(val bool) attribute.KeyValue { + return PprofMappingHasLineNumbersKey.Bool(val) +} + +// PprofProfileComment returns an attribute KeyValue conforming to the +// "pprof.profile.comment" semantic conventions. It represents the free-form text +// associated with the profile. This field should not be used to store any +// machine-readable information, it is only for human-friendly content. +func PprofProfileComment(val ...string) attribute.KeyValue { + return PprofProfileCommentKey.StringSlice(val) +} + +// PprofProfileDocURL returns an attribute KeyValue conforming to the +// "pprof.profile.doc_url" semantic conventions. It represents the documentation +// link for this profile type. +func PprofProfileDocURL(val string) attribute.KeyValue { + return PprofProfileDocURLKey.String(val) +} + +// PprofProfileDropFrames returns an attribute KeyValue conforming to the +// "pprof.profile.drop_frames" semantic conventions. It represents the frames +// with Function.function_name fully matching the regexp will be dropped from the +// samples, along with their successors. +func PprofProfileDropFrames(val string) attribute.KeyValue { + return PprofProfileDropFramesKey.String(val) +} + +// PprofProfileKeepFrames returns an attribute KeyValue conforming to the +// "pprof.profile.keep_frames" semantic conventions. It represents the frames +// with Function.function_name fully matching the regexp will be kept, even if it +// matches drop_frames. +func PprofProfileKeepFrames(val string) attribute.KeyValue { + return PprofProfileKeepFramesKey.String(val) } // Namespace: process @@ -11378,7 +12555,7 @@ const ( ProcessCommandLineKey = attribute.Key("process.command_line") // ProcessContextSwitchTypeKey is the attribute Key conforming to the - // "process.context_switch_type" semantic conventions. It represents the + // "process.context_switch.type" semantic conventions. It represents the // specifies whether the context switches for this data point were voluntary or // involuntary. // @@ -11387,7 +12564,7 @@ const ( // Stability: Development // // Examples: - ProcessContextSwitchTypeKey = attribute.Key("process.context_switch_type") + ProcessContextSwitchTypeKey = attribute.Key("process.context_switch.type") // ProcessCreationTimeKey is the attribute Key conforming to the // "process.creation.time" semantic conventions. It represents the date and time @@ -11534,18 +12711,6 @@ const ( // Examples: "root" ProcessOwnerKey = attribute.Key("process.owner") - // ProcessPagingFaultTypeKey is the attribute Key conforming to the - // "process.paging.fault_type" semantic conventions. It represents the type of - // page fault for this data point. Type `major` is for major/hard page faults, - // and `minor` is for minor/soft page faults. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - ProcessPagingFaultTypeKey = attribute.Key("process.paging.fault_type") - // ProcessParentPIDKey is the attribute Key conforming to the // "process.parent_pid" semantic conventions. It represents the parent Process // identifier (PPID). @@ -11657,6 +12822,19 @@ const ( // Examples: 14 ProcessSessionLeaderPIDKey = attribute.Key("process.session_leader.pid") + // ProcessStateKey is the attribute Key conforming to the "process.state" + // semantic conventions. It represents the process state, e.g., + // [Linux Process State Codes]. + // + // Type: Enum + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "running" + // + // [Linux Process State Codes]: https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES + ProcessStateKey = attribute.Key("process.state") + // ProcessTitleKey is the attribute Key conforming to the "process.title" // semantic conventions. It represents the process title (proctitle). // @@ -11958,7 +13136,7 @@ func ProcessWorkingDirectory(val string) attribute.KeyValue { return ProcessWorkingDirectoryKey.String(val) } -// Enum values for process.context_switch_type +// Enum values for process.context_switch.type var ( // voluntary // Stability: development @@ -11968,14 +13146,20 @@ var ( ProcessContextSwitchTypeInvoluntary = ProcessContextSwitchTypeKey.String("involuntary") ) -// Enum values for process.paging.fault_type +// Enum values for process.state var ( - // major + // running // Stability: development - ProcessPagingFaultTypeMajor = ProcessPagingFaultTypeKey.String("major") - // minor + ProcessStateRunning = ProcessStateKey.String("running") + // sleeping + // Stability: development + ProcessStateSleeping = ProcessStateKey.String("sleeping") + // stopped + // Stability: development + ProcessStateStopped = ProcessStateKey.String("stopped") + // defunct // Stability: development - ProcessPagingFaultTypeMinor = ProcessPagingFaultTypeKey.String("minor") + ProcessStateDefunct = ProcessStateKey.String("defunct") ) // Namespace: profile @@ -12074,80 +13258,6 @@ var ( // Namespace: rpc const ( - // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the - // "rpc.connect_rpc.error_code" semantic conventions. It represents the - // [error codes] of the Connect request. Error codes are always string values. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // - // [error codes]: https://connectrpc.com//docs/protocol/#error-codes - RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code") - - // RPCGRPCStatusCodeKey is the attribute Key conforming to the - // "rpc.grpc.status_code" semantic conventions. It represents the - // [numeric status code] of the gRPC request. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: - // - // [numeric status code]: https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md - RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") - - // RPCJSONRPCErrorCodeKey is the attribute Key conforming to the - // "rpc.jsonrpc.error_code" semantic conventions. It represents the `error.code` - // property of response if it is an error response. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: -32700, 100 - RPCJSONRPCErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code") - - // RPCJSONRPCErrorMessageKey is the attribute Key conforming to the - // "rpc.jsonrpc.error_message" semantic conventions. It represents the - // `error.message` property of response if it is an error response. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "Parse error", "User already exists" - RPCJSONRPCErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message") - - // RPCJSONRPCRequestIDKey is the attribute Key conforming to the - // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` - // property of request or response. Since protocol allows id to be int, string, - // `null` or missing (for notifications), value is expected to be cast to string - // for simplicity. Use empty string in case of `null` value. Omit entirely if - // this is a notification. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "10", "request-7", "" - RPCJSONRPCRequestIDKey = attribute.Key("rpc.jsonrpc.request_id") - - // RPCJSONRPCVersionKey is the attribute Key conforming to the - // "rpc.jsonrpc.version" semantic conventions. It represents the protocol - // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 - // doesn't specify this, the value can be omitted. - // - // Type: string - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "2.0", "1.0" - RPCJSONRPCVersionKey = attribute.Key("rpc.jsonrpc.version") - // RPCMessageCompressedSizeKey is the attribute Key conforming to the // "rpc.message.compressed_size" semantic conventions. It represents the // compressed size of the message in bytes. @@ -12195,114 +13305,84 @@ const ( RPCMessageUncompressedSizeKey = attribute.Key("rpc.message.uncompressed_size") // RPCMethodKey is the attribute Key conforming to the "rpc.method" semantic - // conventions. It represents the name of the (logical) method being called, - // must be equal to the $method part in the span name. + // conventions. It represents the fully-qualified logical name of the method + // from the RPC interface perspective. // // Type: string // RequirementLevel: Recommended // Stability: Development // - // Examples: exampleMethod - // Note: This is the logical name of the method from the RPC interface - // perspective, which can be different from the name of any implementing - // method/function. The `code.function.name` attribute may be used to store the - // latter (e.g., method actually executing the call on the server side, RPC - // client stub method on the client side). + // Examples: "com.example.ExampleService/exampleMethod", "EchoService/Echo", + // "_OTHER" + // Note: The method name MAY have unbounded cardinality in edge or error cases. + // + // Some RPC frameworks or libraries provide a fixed set of recognized methods + // for client stubs and server implementations. Instrumentations for such + // frameworks MUST set this attribute to the original method name only + // when the method is recognized by the framework or library. + // + // When the method is not recognized, for example, when the server receives + // a request for a method that is not predefined on the server, or when + // instrumentation is not able to reliably detect if the method is predefined, + // the attribute MUST be set to `_OTHER`. In such cases, tracing + // instrumentations MUST also set `rpc.method_original` attribute to + // the original method value. + // + // If the RPC instrumentation could end up converting valid RPC methods to + // `_OTHER`, then it SHOULD provide a way to configure the list of recognized + // RPC methods. + // + // The `rpc.method` can be different from the name of any implementing + // method/function. + // The `code.function.name` attribute may be used to record the fully-qualified + // method actually executing the call on the server side, or the + // RPC client stub method on the client side. RPCMethodKey = attribute.Key("rpc.method") - // RPCServiceKey is the attribute Key conforming to the "rpc.service" semantic - // conventions. It represents the full (logical) name of the service being - // called, including its package name, if applicable. + // RPCMethodOriginalKey is the attribute Key conforming to the + // "rpc.method_original" semantic conventions. It represents the original name + // of the method used by the client. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "com.myservice.EchoService/catchAll", + // "com.myservice.EchoService/unknownMethod", "InvalidMethod" + RPCMethodOriginalKey = attribute.Key("rpc.method_original") + + // RPCResponseStatusCodeKey is the attribute Key conforming to the + // "rpc.response.status_code" semantic conventions. It represents the status + // code of the RPC returned by the RPC server or generated by the client. // // Type: string // RequirementLevel: Recommended // Stability: Development // - // Examples: myservice.EchoService - // Note: This is the logical name of the service from the RPC interface - // perspective, which can be different from the name of any implementing class. - // The `code.namespace` attribute may be used to store the latter (despite the - // attribute name, it may include a class name; e.g., class with method actually - // executing the call on the server side, RPC client stub class on the client - // side). - RPCServiceKey = attribute.Key("rpc.service") + // Examples: "OK", "DEADLINE_EXCEEDED", "-32602" + // Note: Usually it represents an error code, but may also represent partial + // success, warning, or differentiate between various types of successful + // outcomes. + // Semantic conventions for individual RPC frameworks SHOULD document what + // `rpc.response.status_code` means in the context of that system and which + // values are considered to represent errors. + RPCResponseStatusCodeKey = attribute.Key("rpc.response.status_code") - // RPCSystemKey is the attribute Key conforming to the "rpc.system" semantic - // conventions. It represents a string identifying the remoting system. See - // below for a list of well-known identifiers. + // RPCSystemNameKey is the attribute Key conforming to the "rpc.system.name" + // semantic conventions. It represents the Remote Procedure Call (RPC) system. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: - RPCSystemKey = attribute.Key("rpc.system") + // Note: The client and server RPC systems may differ for the same RPC + // interaction. For example, a client may use Apache Dubbo or Connect RPC to + // communicate with a server that uses gRPC since both protocols provide + // compatibility with gRPC. + RPCSystemNameKey = attribute.Key("rpc.system.name") ) -// RPCConnectRPCRequestMetadata returns an attribute KeyValue conforming to the -// "rpc.connect_rpc.request.metadata" semantic conventions. It represents the -// connect request metadata, `` being the normalized Connect Metadata key -// (lowercase), the value being the metadata values. -func RPCConnectRPCRequestMetadata(key string, val ...string) attribute.KeyValue { - return attribute.StringSlice("rpc.connect_rpc.request.metadata."+key, val) -} - -// RPCConnectRPCResponseMetadata returns an attribute KeyValue conforming to the -// "rpc.connect_rpc.response.metadata" semantic conventions. It represents the -// connect response metadata, `` being the normalized Connect Metadata key -// (lowercase), the value being the metadata values. -func RPCConnectRPCResponseMetadata(key string, val ...string) attribute.KeyValue { - return attribute.StringSlice("rpc.connect_rpc.response.metadata."+key, val) -} - -// RPCGRPCRequestMetadata returns an attribute KeyValue conforming to the -// "rpc.grpc.request.metadata" semantic conventions. It represents the gRPC -// request metadata, `` being the normalized gRPC Metadata key (lowercase), -// the value being the metadata values. -func RPCGRPCRequestMetadata(key string, val ...string) attribute.KeyValue { - return attribute.StringSlice("rpc.grpc.request.metadata."+key, val) -} - -// RPCGRPCResponseMetadata returns an attribute KeyValue conforming to the -// "rpc.grpc.response.metadata" semantic conventions. It represents the gRPC -// response metadata, `` being the normalized gRPC Metadata key (lowercase), -// the value being the metadata values. -func RPCGRPCResponseMetadata(key string, val ...string) attribute.KeyValue { - return attribute.StringSlice("rpc.grpc.response.metadata."+key, val) -} - -// RPCJSONRPCErrorCode returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.error_code" semantic conventions. It represents the `error.code` -// property of response if it is an error response. -func RPCJSONRPCErrorCode(val int) attribute.KeyValue { - return RPCJSONRPCErrorCodeKey.Int(val) -} - -// RPCJSONRPCErrorMessage returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.error_message" semantic conventions. It represents the -// `error.message` property of response if it is an error response. -func RPCJSONRPCErrorMessage(val string) attribute.KeyValue { - return RPCJSONRPCErrorMessageKey.String(val) -} - -// RPCJSONRPCRequestID returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` property -// of request or response. Since protocol allows id to be int, string, `null` or -// missing (for notifications), value is expected to be cast to string for -// simplicity. Use empty string in case of `null` value. Omit entirely if this is -// a notification. -func RPCJSONRPCRequestID(val string) attribute.KeyValue { - return RPCJSONRPCRequestIDKey.String(val) -} - -// RPCJSONRPCVersion returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.version" semantic conventions. It represents the protocol version -// as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't -// specify this, the value can be omitted. -func RPCJSONRPCVersion(val string) attribute.KeyValue { - return RPCJSONRPCVersionKey.String(val) -} - // RPCMessageCompressedSize returns an attribute KeyValue conforming to the // "rpc.message.compressed_size" semantic conventions. It represents the // compressed size of the message in bytes. @@ -12325,125 +13405,41 @@ func RPCMessageUncompressedSize(val int) attribute.KeyValue { } // RPCMethod returns an attribute KeyValue conforming to the "rpc.method" -// semantic conventions. It represents the name of the (logical) method being -// called, must be equal to the $method part in the span name. +// semantic conventions. It represents the fully-qualified logical name of the +// method from the RPC interface perspective. func RPCMethod(val string) attribute.KeyValue { return RPCMethodKey.String(val) } -// RPCService returns an attribute KeyValue conforming to the "rpc.service" -// semantic conventions. It represents the full (logical) name of the service -// being called, including its package name, if applicable. -func RPCService(val string) attribute.KeyValue { - return RPCServiceKey.String(val) +// RPCMethodOriginal returns an attribute KeyValue conforming to the +// "rpc.method_original" semantic conventions. It represents the original name of +// the method used by the client. +func RPCMethodOriginal(val string) attribute.KeyValue { + return RPCMethodOriginalKey.String(val) } -// Enum values for rpc.connect_rpc.error_code -var ( - // cancelled - // Stability: development - RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled") - // unknown - // Stability: development - RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown") - // invalid_argument - // Stability: development - RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument") - // deadline_exceeded - // Stability: development - RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded") - // not_found - // Stability: development - RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found") - // already_exists - // Stability: development - RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists") - // permission_denied - // Stability: development - RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied") - // resource_exhausted - // Stability: development - RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted") - // failed_precondition - // Stability: development - RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition") - // aborted - // Stability: development - RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted") - // out_of_range - // Stability: development - RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range") - // unimplemented - // Stability: development - RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented") - // internal - // Stability: development - RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal") - // unavailable - // Stability: development - RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable") - // data_loss - // Stability: development - RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss") - // unauthenticated - // Stability: development - RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated") -) +// RPCRequestMetadata returns an attribute KeyValue conforming to the +// "rpc.request.metadata" semantic conventions. It represents the RPC request +// metadata, `` being the normalized RPC metadata key (lowercase), the value +// being the metadata values. +func RPCRequestMetadata(key string, val ...string) attribute.KeyValue { + return attribute.StringSlice("rpc.request.metadata."+key, val) +} -// Enum values for rpc.grpc.status_code -var ( - // OK - // Stability: development - RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0) - // CANCELLED - // Stability: development - RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1) - // UNKNOWN - // Stability: development - RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2) - // INVALID_ARGUMENT - // Stability: development - RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3) - // DEADLINE_EXCEEDED - // Stability: development - RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4) - // NOT_FOUND - // Stability: development - RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5) - // ALREADY_EXISTS - // Stability: development - RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6) - // PERMISSION_DENIED - // Stability: development - RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7) - // RESOURCE_EXHAUSTED - // Stability: development - RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8) - // FAILED_PRECONDITION - // Stability: development - RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9) - // ABORTED - // Stability: development - RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10) - // OUT_OF_RANGE - // Stability: development - RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11) - // UNIMPLEMENTED - // Stability: development - RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12) - // INTERNAL - // Stability: development - RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13) - // UNAVAILABLE - // Stability: development - RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14) - // DATA_LOSS - // Stability: development - RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15) - // UNAUTHENTICATED - // Stability: development - RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16) -) +// RPCResponseMetadata returns an attribute KeyValue conforming to the +// "rpc.response.metadata" semantic conventions. It represents the RPC response +// metadata, `` being the normalized RPC metadata key (lowercase), the value +// being the metadata values. +func RPCResponseMetadata(key string, val ...string) attribute.KeyValue { + return attribute.StringSlice("rpc.response.metadata."+key, val) +} + +// RPCResponseStatusCode returns an attribute KeyValue conforming to the +// "rpc.response.status_code" semantic conventions. It represents the status code +// of the RPC returned by the RPC server or generated by the client. +func RPCResponseStatusCode(val string) attribute.KeyValue { + return RPCResponseStatusCodeKey.String(val) +} // Enum values for rpc.message.type var ( @@ -12455,23 +13451,28 @@ var ( RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED") ) -// Enum values for rpc.system +// Enum values for rpc.system.name var ( - // gRPC + // [gRPC] // Stability: development - RPCSystemGRPC = RPCSystemKey.String("grpc") - // Java RMI - // Stability: development - RPCSystemJavaRmi = RPCSystemKey.String("java_rmi") - // .NET WCF + // + // [gRPC]: https://grpc.io/ + RPCSystemNameGRPC = RPCSystemNameKey.String("grpc") + // [Apache Dubbo] // Stability: development - RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf") - // Apache Dubbo + // + // [Apache Dubbo]: https://dubbo.apache.org/ + RPCSystemNameDubbo = RPCSystemNameKey.String("dubbo") + // [Connect RPC] // Stability: development - RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo") - // Connect RPC + // + // [Connect RPC]: https://connectrpc.com/ + RPCSystemNameConnectrpc = RPCSystemNameKey.String("connectrpc") + // [JSON-RPC] // Stability: development - RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc") + // + // [JSON-RPC]: https://www.jsonrpc.org/ + RPCSystemNameJSONRPC = RPCSystemNameKey.String("jsonrpc") ) // Namespace: security_rule @@ -12766,9 +13767,38 @@ const ( // namespace. ServiceNamespaceKey = attribute.Key("service.namespace") + // ServicePeerNameKey is the attribute Key conforming to the "service.peer.name" + // semantic conventions. It represents the logical name of the service on the + // other side of the connection. SHOULD be equal to the actual [`service.name`] + // resource attribute of the remote service if any. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "shoppingcart" + // + // [`service.name`]: /docs/resource/README.md#service + ServicePeerNameKey = attribute.Key("service.peer.name") + + // ServicePeerNamespaceKey is the attribute Key conforming to the + // "service.peer.namespace" semantic conventions. It represents the logical + // namespace of the service on the other side of the connection. SHOULD be equal + // to the actual [`service.namespace`] resource attribute of the remote service + // if any. + // + // Type: string + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "Shop" + // + // [`service.namespace`]: /docs/resource/README.md#service + ServicePeerNamespaceKey = attribute.Key("service.peer.namespace") + // ServiceVersionKey is the attribute Key conforming to the "service.version" - // semantic conventions. It represents the version string of the service API or - // implementation. The format is not defined by these conventions. + // semantic conventions. It represents the version string of the service + // component. The format is not defined by these conventions. // // Type: string // RequirementLevel: Recommended @@ -12798,10 +13828,30 @@ func ServiceNamespace(val string) attribute.KeyValue { return ServiceNamespaceKey.String(val) } +// ServicePeerName returns an attribute KeyValue conforming to the +// "service.peer.name" semantic conventions. It represents the logical name of +// the service on the other side of the connection. SHOULD be equal to the actual +// [`service.name`] resource attribute of the remote service if any. +// +// [`service.name`]: /docs/resource/README.md#service +func ServicePeerName(val string) attribute.KeyValue { + return ServicePeerNameKey.String(val) +} + +// ServicePeerNamespace returns an attribute KeyValue conforming to the +// "service.peer.namespace" semantic conventions. It represents the logical +// namespace of the service on the other side of the connection. SHOULD be equal +// to the actual [`service.namespace`] resource attribute of the remote service +// if any. +// +// [`service.namespace`]: /docs/resource/README.md#service +func ServicePeerNamespace(val string) attribute.KeyValue { + return ServicePeerNamespaceKey.String(val) +} + // ServiceVersion returns an attribute KeyValue conforming to the // "service.version" semantic conventions. It represents the version string of -// the service API or implementation. The format is not defined by these -// conventions. +// the service component. The format is not defined by these conventions. func ServiceVersion(val string) attribute.KeyValue { return ServiceVersionKey.String(val) } @@ -12940,17 +13990,6 @@ func SourcePort(val int) attribute.KeyValue { // Namespace: system const ( - // SystemCPULogicalNumberKey is the attribute Key conforming to the - // "system.cpu.logical_number" semantic conventions. It represents the - // deprecated, use `cpu.logical_number` instead. - // - // Type: int - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: 1 - SystemCPULogicalNumberKey = attribute.Key("system.cpu.logical_number") - // SystemDeviceKey is the attribute Key conforming to the "system.device" // semantic conventions. It represents the device identifier. // @@ -13005,6 +14044,17 @@ const ( // Examples: "ext4" SystemFilesystemTypeKey = attribute.Key("system.filesystem.type") + // SystemMemoryLinuxSlabStateKey is the attribute Key conforming to the + // "system.memory.linux.slab.state" semantic conventions. It represents the + // Linux Slab memory state. + // + // Type: Enum + // RequirementLevel: Recommended + // Stability: Development + // + // Examples: "reclaimable", "unreclaimable" + SystemMemoryLinuxSlabStateKey = attribute.Key("system.memory.linux.slab.state") + // SystemMemoryStateKey is the attribute Key conforming to the // "system.memory.state" semantic conventions. It represents the memory state. // @@ -13026,49 +14076,29 @@ const ( // Examples: "in" SystemPagingDirectionKey = attribute.Key("system.paging.direction") - // SystemPagingStateKey is the attribute Key conforming to the - // "system.paging.state" semantic conventions. It represents the memory paging - // state. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: Development - // - // Examples: "free" - SystemPagingStateKey = attribute.Key("system.paging.state") - - // SystemPagingTypeKey is the attribute Key conforming to the - // "system.paging.type" semantic conventions. It represents the memory paging - // type. + // SystemPagingFaultTypeKey is the attribute Key conforming to the + // "system.paging.fault.type" semantic conventions. It represents the paging + // fault type. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // // Examples: "minor" - SystemPagingTypeKey = attribute.Key("system.paging.type") + SystemPagingFaultTypeKey = attribute.Key("system.paging.fault.type") - // SystemProcessStatusKey is the attribute Key conforming to the - // "system.process.status" semantic conventions. It represents the process - // state, e.g., [Linux Process State Codes]. + // SystemPagingStateKey is the attribute Key conforming to the + // "system.paging.state" semantic conventions. It represents the memory paging + // state. // // Type: Enum // RequirementLevel: Recommended // Stability: Development // - // Examples: "running" - // - // [Linux Process State Codes]: https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES - SystemProcessStatusKey = attribute.Key("system.process.status") + // Examples: "free" + SystemPagingStateKey = attribute.Key("system.paging.state") ) -// SystemCPULogicalNumber returns an attribute KeyValue conforming to the -// "system.cpu.logical_number" semantic conventions. It represents the -// deprecated, use `cpu.logical_number` instead. -func SystemCPULogicalNumber(val int) attribute.KeyValue { - return SystemCPULogicalNumberKey.Int(val) -} - // SystemDevice returns an attribute KeyValue conforming to the "system.device" // semantic conventions. It represents the device identifier. func SystemDevice(val string) attribute.KeyValue { @@ -13124,6 +14154,16 @@ var ( SystemFilesystemTypeExt4 = SystemFilesystemTypeKey.String("ext4") ) +// Enum values for system.memory.linux.slab.state +var ( + // reclaimable + // Stability: development + SystemMemoryLinuxSlabStateReclaimable = SystemMemoryLinuxSlabStateKey.String("reclaimable") + // unreclaimable + // Stability: development + SystemMemoryLinuxSlabStateUnreclaimable = SystemMemoryLinuxSlabStateKey.String("unreclaimable") +) + // Enum values for system.memory.state var ( // Actual used virtual memory in bytes. @@ -13150,40 +14190,24 @@ var ( SystemPagingDirectionOut = SystemPagingDirectionKey.String("out") ) -// Enum values for system.paging.state -var ( - // used - // Stability: development - SystemPagingStateUsed = SystemPagingStateKey.String("used") - // free - // Stability: development - SystemPagingStateFree = SystemPagingStateKey.String("free") -) - -// Enum values for system.paging.type +// Enum values for system.paging.fault.type var ( // major // Stability: development - SystemPagingTypeMajor = SystemPagingTypeKey.String("major") + SystemPagingFaultTypeMajor = SystemPagingFaultTypeKey.String("major") // minor // Stability: development - SystemPagingTypeMinor = SystemPagingTypeKey.String("minor") + SystemPagingFaultTypeMinor = SystemPagingFaultTypeKey.String("minor") ) -// Enum values for system.process.status +// Enum values for system.paging.state var ( - // running - // Stability: development - SystemProcessStatusRunning = SystemProcessStatusKey.String("running") - // sleeping - // Stability: development - SystemProcessStatusSleeping = SystemProcessStatusKey.String("sleeping") - // stopped + // used // Stability: development - SystemProcessStatusStopped = SystemProcessStatusKey.String("stopped") - // defunct + SystemPagingStateUsed = SystemPagingStateKey.String("used") + // free // Stability: development - SystemProcessStatusDefunct = SystemProcessStatusKey.String("defunct") + SystemPagingStateFree = SystemPagingStateKey.String("free") ) // Namespace: telemetry @@ -13438,6 +14462,18 @@ const ( // Type: int // RequirementLevel: Recommended // Stability: Development + // + // Note: + // Examples of where the value can be extracted from: + // + // | Language or platform | Source | + // | --- | --- | + // | JVM | `Thread.currentThread().threadId()` | + // | .NET | `Thread.CurrentThread.ManagedThreadId` | + // | Python | `threading.current_thread().ident` | + // | Ruby | `Thread.current.object_id` | + // | C++ | `std::this_thread::get_id()` | + // | Erlang | `erlang:self()` | ThreadIDKey = attribute.Key("thread.id") // ThreadNameKey is the attribute Key conforming to the "thread.name" semantic @@ -13448,6 +14484,16 @@ const ( // Stability: Development // // Examples: main + // Note: + // Examples of where the value can be extracted from: + // + // | Language or platform | Source | + // | --- | --- | + // | JVM | `Thread.currentThread().getName()` | + // | .NET | `Thread.CurrentThread.Name` | + // | Python | `threading.current_thread().name` | + // | Ruby | `Thread.current.name` | + // | Erlang | `erlang:process_info(self(), registered_name)` | ThreadNameKey = attribute.Key("thread.name") ) @@ -14515,7 +15561,7 @@ const ( // significant name SHOULD be selected. In such a scenario it should align with // `user_agent.version` // - // [Example]: https://www.whatsmyua.info + // [Example]: https://uaparser.dev/#demo UserAgentNameKey = attribute.Key("user_agent.name") // UserAgentOriginalKey is the attribute Key conforming to the @@ -14598,7 +15644,7 @@ const ( // significant version SHOULD be selected. In such a scenario it should align // with `user_agent.name` // - // [Example]: https://www.whatsmyua.info + // [Example]: https://uaparser.dev/#demo UserAgentVersionKey = attribute.Key("user_agent.version") ) @@ -14890,7 +15936,7 @@ const ( // Note: In Git Version Control Systems, the canonical URL SHOULD NOT include // the `.git` extension. // - // [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical. + // [canonical URL]: https://support.google.com/webmasters/answer/10347851 VCSRepositoryURLFullKey = attribute.Key("vcs.repository.url.full") // VCSRevisionDeltaDirectionKey is the attribute Key conforming to the @@ -14980,7 +16026,7 @@ func VCSRepositoryName(val string) attribute.KeyValue { // [canonical URL] of the repository providing the complete HTTP(S) address in // order to locate and identify the repository through a browser. // -// [canonical URL]: https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical. +// [canonical URL]: https://support.google.com/webmasters/answer/10347851 func VCSRepositoryURLFull(val string) attribute.KeyValue { return VCSRepositoryURLFullKey.String(val) } diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/doc.go similarity index 96% rename from vendor/go.opentelemetry.io/otel/semconv/v1.37.0/doc.go rename to vendor/go.opentelemetry.io/otel/semconv/v1.39.0/doc.go index 11101032..852362ef 100644 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/doc.go +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/doc.go @@ -4,6 +4,6 @@ // Package semconv implements OpenTelemetry semantic conventions. // // OpenTelemetry semantic conventions are agreed standardized naming -// patterns for OpenTelemetry things. This package represents the v1.37.0 +// patterns for OpenTelemetry things. This package represents the v1.39.0 // version of the OpenTelemetry semantic conventions. -package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0" +package semconv // import "go.opentelemetry.io/otel/semconv/v1.39.0" diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/error_type.go b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/error_type.go similarity index 99% rename from vendor/go.opentelemetry.io/otel/semconv/v1.37.0/error_type.go rename to vendor/go.opentelemetry.io/otel/semconv/v1.39.0/error_type.go index 267979c0..84cf636a 100644 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/error_type.go +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/error_type.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0" +package semconv // import "go.opentelemetry.io/otel/semconv/v1.39.0" import ( "reflect" diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/exception.go similarity index 98% rename from vendor/go.opentelemetry.io/otel/semconv/v1.37.0/exception.go rename to vendor/go.opentelemetry.io/otel/semconv/v1.39.0/exception.go index e67469a4..7b688ecc 100644 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/exception.go +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/exception.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0" +package semconv // import "go.opentelemetry.io/otel/semconv/v1.39.0" const ( // ExceptionEventName is the name of the Span event representing an exception. diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/schema.go similarity index 85% rename from vendor/go.opentelemetry.io/otel/semconv/v1.37.0/schema.go rename to vendor/go.opentelemetry.io/otel/semconv/v1.39.0/schema.go index f8a0b704..e1a199d8 100644 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.37.0/schema.go +++ b/vendor/go.opentelemetry.io/otel/semconv/v1.39.0/schema.go @@ -1,9 +1,9 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package semconv // import "go.opentelemetry.io/otel/semconv/v1.37.0" +package semconv // import "go.opentelemetry.io/otel/semconv/v1.39.0" // SchemaURL is the schema URL that matches the version of the semantic conventions // that this package defines. Semconv packages starting from v1.4.0 must declare // non-empty schema URL in the form https://opentelemetry.io/schemas/ -const SchemaURL = "https://opentelemetry.io/schemas/1.37.0" +const SchemaURL = "https://opentelemetry.io/schemas/1.39.0" diff --git a/vendor/go.opentelemetry.io/otel/trace/auto.go b/vendor/go.opentelemetry.io/otel/trace/auto.go index 8763936a..604fdab4 100644 --- a/vendor/go.opentelemetry.io/otel/trace/auto.go +++ b/vendor/go.opentelemetry.io/otel/trace/auto.go @@ -20,7 +20,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.37.0" + semconv "go.opentelemetry.io/otel/semconv/v1.39.0" "go.opentelemetry.io/otel/trace/embedded" "go.opentelemetry.io/otel/trace/internal/telemetry" ) diff --git a/vendor/golang.org/x/net/http2/writesched_priority_rfc9218.go b/vendor/golang.org/x/net/http2/writesched_priority_rfc9218.go index cb4cadc3..dfbfc1eb 100644 --- a/vendor/golang.org/x/net/http2/writesched_priority_rfc9218.go +++ b/vendor/golang.org/x/net/http2/writesched_priority_rfc9218.go @@ -37,6 +37,15 @@ type priorityWriteSchedulerRFC9218 struct { // incremental streams or not, when urgency is the same in a given Pop() // call. prioritizeIncremental bool + + // priorityUpdateBuf is used to buffer the most recent PRIORITY_UPDATE we + // receive per https://www.rfc-editor.org/rfc/rfc9218.html#name-the-priority_update-frame. + priorityUpdateBuf struct { + // streamID being 0 means that the buffer is empty. This is a safe + // assumption as PRIORITY_UPDATE for stream 0 is a PROTOCOL_ERROR. + streamID uint32 + priority PriorityParam + } } func newPriorityWriteSchedulerRFC9218() WriteScheduler { @@ -50,6 +59,10 @@ func (ws *priorityWriteSchedulerRFC9218) OpenStream(streamID uint32, opt OpenStr if ws.streams[streamID].location != nil { panic(fmt.Errorf("stream %d already opened", streamID)) } + if streamID == ws.priorityUpdateBuf.streamID { + ws.priorityUpdateBuf.streamID = 0 + opt.priority = ws.priorityUpdateBuf.priority + } q := ws.queuePool.get() ws.streams[streamID] = streamMetadata{ location: q, @@ -95,6 +108,8 @@ func (ws *priorityWriteSchedulerRFC9218) AdjustStream(streamID uint32, priority metadata := ws.streams[streamID] q, u, i := metadata.location, metadata.priority.urgency, metadata.priority.incremental if q == nil { + ws.priorityUpdateBuf.streamID = streamID + ws.priorityUpdateBuf.priority = priority return } diff --git a/vendor/golang.org/x/net/websocket/hybi.go b/vendor/golang.org/x/net/websocket/hybi.go index dda74346..c7e76cd9 100644 --- a/vendor/golang.org/x/net/websocket/hybi.go +++ b/vendor/golang.org/x/net/websocket/hybi.go @@ -440,6 +440,7 @@ func hybiClientHandshake(config *Config, br *bufio.Reader, bw *bufio.Writer) (er if err != nil { return err } + defer resp.Body.Close() if resp.StatusCode != 101 { return ErrBadStatus } diff --git a/vendor/golang.org/x/sys/unix/ioctl_signed.go b/vendor/golang.org/x/sys/unix/ioctl_signed.go index 5b0759bd..be0f3fba 100644 --- a/vendor/golang.org/x/sys/unix/ioctl_signed.go +++ b/vendor/golang.org/x/sys/unix/ioctl_signed.go @@ -6,9 +6,7 @@ package unix -import ( - "unsafe" -) +import "unsafe" // ioctl itself should not be exposed directly, but additional get/set // functions for specific types are permissible. @@ -28,6 +26,13 @@ func IoctlSetPointerInt(fd int, req int, value int) error { return ioctlPtr(fd, req, unsafe.Pointer(&v)) } +// IoctlSetString performs an ioctl operation which sets a string value +// on fd, using the specified request number. +func IoctlSetString(fd int, req int, value string) error { + bs := append([]byte(value), 0) + return ioctlPtr(fd, req, unsafe.Pointer(&bs[0])) +} + // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. // // To change fd's window size, the req argument should be TIOCSWINSZ. diff --git a/vendor/golang.org/x/sys/unix/ioctl_unsigned.go b/vendor/golang.org/x/sys/unix/ioctl_unsigned.go index 20f470b9..f0c28213 100644 --- a/vendor/golang.org/x/sys/unix/ioctl_unsigned.go +++ b/vendor/golang.org/x/sys/unix/ioctl_unsigned.go @@ -6,9 +6,7 @@ package unix -import ( - "unsafe" -) +import "unsafe" // ioctl itself should not be exposed directly, but additional get/set // functions for specific types are permissible. @@ -28,6 +26,13 @@ func IoctlSetPointerInt(fd int, req uint, value int) error { return ioctlPtr(fd, req, unsafe.Pointer(&v)) } +// IoctlSetString performs an ioctl operation which sets a string value +// on fd, using the specified request number. +func IoctlSetString(fd int, req uint, value string) error { + bs := append([]byte(value), 0) + return ioctlPtr(fd, req, unsafe.Pointer(&bs[0])) +} + // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. // // To change fd's window size, the req argument should be TIOCSWINSZ. diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go index 18a3d9bd..a6a2ea0c 100644 --- a/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -1052,14 +1052,6 @@ func IoctlSetIntRetInt(fd int, req int, arg int) (int, error) { return ioctlRet(fd, req, uintptr(arg)) } -func IoctlSetString(fd int, req int, val string) error { - bs := make([]byte, len(val)+1) - copy(bs[:len(bs)-1], val) - err := ioctlPtr(fd, req, unsafe.Pointer(&bs[0])) - runtime.KeepAlive(&bs[0]) - return err -} - // Lifreq Helpers func (l *Lifreq) SetName(name string) error { diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go index 4e92e5aa..de6fccf9 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -367,7 +367,9 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from iov[0].SetLen(len(p)) } var rsa RawSockaddrAny - n, oobn, recvflags, err = recvmsgRaw(fd, iov[:], oob, flags, &rsa) + if n, oobn, recvflags, err = recvmsgRaw(fd, iov[:], oob, flags, &rsa); err != nil { + return + } // source address is only specified if the socket is unconnected if rsa.Addr.Family != AF_UNSPEC { from, err = anyToSockaddr(fd, &rsa) @@ -389,8 +391,10 @@ func RecvmsgBuffers(fd int, buffers [][]byte, oob []byte, flags int) (n, oobn in } } var rsa RawSockaddrAny - n, oobn, recvflags, err = recvmsgRaw(fd, iov, oob, flags, &rsa) - if err == nil && rsa.Addr.Family != AF_UNSPEC { + if n, oobn, recvflags, err = recvmsgRaw(fd, iov, oob, flags, &rsa); err != nil { + return + } + if rsa.Addr.Family != AF_UNSPEC { from, err = anyToSockaddr(fd, &rsa) } return diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 69439df2..738a9f21 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -900,6 +900,7 @@ const socket_error = uintptr(^uint32(0)) //sys NotifyRouteChange2(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyRouteChange2 //sys NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyUnicastIpAddressChange //sys CancelMibChangeNotify2(notificationHandle Handle) (errcode error) = iphlpapi.CancelMibChangeNotify2 +//sys IsProcessorFeaturePresent(ProcessorFeature uint32) (ret bool) = kernel32.IsProcessorFeaturePresent // For testing: clients can set this flag to force // creation of IPv6 sockets to return EAFNOSUPPORT. diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index 6e4f50eb..d5658a13 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -3938,3 +3938,88 @@ const ( MOUSE_EVENT = 0x0002 WINDOW_BUFFER_SIZE_EVENT = 0x0004 ) + +// The processor features to be tested for IsProcessorFeaturePresent, see +// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent +const ( + PF_ARM_64BIT_LOADSTORE_ATOMIC = 25 + PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE = 24 + PF_ARM_EXTERNAL_CACHE_AVAILABLE = 26 + PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE = 27 + PF_ARM_VFP_32_REGISTERS_AVAILABLE = 18 + PF_3DNOW_INSTRUCTIONS_AVAILABLE = 7 + PF_CHANNELS_ENABLED = 16 + PF_COMPARE_EXCHANGE_DOUBLE = 2 + PF_COMPARE_EXCHANGE128 = 14 + PF_COMPARE64_EXCHANGE128 = 15 + PF_FASTFAIL_AVAILABLE = 23 + PF_FLOATING_POINT_EMULATED = 1 + PF_FLOATING_POINT_PRECISION_ERRATA = 0 + PF_MMX_INSTRUCTIONS_AVAILABLE = 3 + PF_NX_ENABLED = 12 + PF_PAE_ENABLED = 9 + PF_RDTSC_INSTRUCTION_AVAILABLE = 8 + PF_RDWRFSGSBASE_AVAILABLE = 22 + PF_SECOND_LEVEL_ADDRESS_TRANSLATION = 20 + PF_SSE3_INSTRUCTIONS_AVAILABLE = 13 + PF_SSSE3_INSTRUCTIONS_AVAILABLE = 36 + PF_SSE4_1_INSTRUCTIONS_AVAILABLE = 37 + PF_SSE4_2_INSTRUCTIONS_AVAILABLE = 38 + PF_AVX_INSTRUCTIONS_AVAILABLE = 39 + PF_AVX2_INSTRUCTIONS_AVAILABLE = 40 + PF_AVX512F_INSTRUCTIONS_AVAILABLE = 41 + PF_VIRT_FIRMWARE_ENABLED = 21 + PF_XMMI_INSTRUCTIONS_AVAILABLE = 6 + PF_XMMI64_INSTRUCTIONS_AVAILABLE = 10 + PF_XSAVE_ENABLED = 17 + PF_ARM_V8_INSTRUCTIONS_AVAILABLE = 29 + PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE = 30 + PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE = 31 + PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE = 34 + PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE = 43 + PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE = 44 + PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE = 45 + PF_ARM_SVE_INSTRUCTIONS_AVAILABLE = 46 + PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE = 47 + PF_ARM_SVE2_1_INSTRUCTIONS_AVAILABLE = 48 + PF_ARM_SVE_AES_INSTRUCTIONS_AVAILABLE = 49 + PF_ARM_SVE_PMULL128_INSTRUCTIONS_AVAILABLE = 50 + PF_ARM_SVE_BITPERM_INSTRUCTIONS_AVAILABLE = 51 + PF_ARM_SVE_BF16_INSTRUCTIONS_AVAILABLE = 52 + PF_ARM_SVE_EBF16_INSTRUCTIONS_AVAILABLE = 53 + PF_ARM_SVE_B16B16_INSTRUCTIONS_AVAILABLE = 54 + PF_ARM_SVE_SHA3_INSTRUCTIONS_AVAILABLE = 55 + PF_ARM_SVE_SM4_INSTRUCTIONS_AVAILABLE = 56 + PF_ARM_SVE_I8MM_INSTRUCTIONS_AVAILABLE = 57 + PF_ARM_SVE_F32MM_INSTRUCTIONS_AVAILABLE = 58 + PF_ARM_SVE_F64MM_INSTRUCTIONS_AVAILABLE = 59 + PF_BMI2_INSTRUCTIONS_AVAILABLE = 60 + PF_MOVDIR64B_INSTRUCTION_AVAILABLE = 61 + PF_ARM_LSE2_AVAILABLE = 62 + PF_ARM_SHA3_INSTRUCTIONS_AVAILABLE = 64 + PF_ARM_SHA512_INSTRUCTIONS_AVAILABLE = 65 + PF_ARM_V82_I8MM_INSTRUCTIONS_AVAILABLE = 66 + PF_ARM_V82_FP16_INSTRUCTIONS_AVAILABLE = 67 + PF_ARM_V86_BF16_INSTRUCTIONS_AVAILABLE = 68 + PF_ARM_V86_EBF16_INSTRUCTIONS_AVAILABLE = 69 + PF_ARM_SME_INSTRUCTIONS_AVAILABLE = 70 + PF_ARM_SME2_INSTRUCTIONS_AVAILABLE = 71 + PF_ARM_SME2_1_INSTRUCTIONS_AVAILABLE = 72 + PF_ARM_SME2_2_INSTRUCTIONS_AVAILABLE = 73 + PF_ARM_SME_AES_INSTRUCTIONS_AVAILABLE = 74 + PF_ARM_SME_SBITPERM_INSTRUCTIONS_AVAILABLE = 75 + PF_ARM_SME_SF8MM4_INSTRUCTIONS_AVAILABLE = 76 + PF_ARM_SME_SF8MM8_INSTRUCTIONS_AVAILABLE = 77 + PF_ARM_SME_SF8DP2_INSTRUCTIONS_AVAILABLE = 78 + PF_ARM_SME_SF8DP4_INSTRUCTIONS_AVAILABLE = 79 + PF_ARM_SME_SF8FMA_INSTRUCTIONS_AVAILABLE = 80 + PF_ARM_SME_F8F32_INSTRUCTIONS_AVAILABLE = 81 + PF_ARM_SME_F8F16_INSTRUCTIONS_AVAILABLE = 82 + PF_ARM_SME_F16F16_INSTRUCTIONS_AVAILABLE = 83 + PF_ARM_SME_B16B16_INSTRUCTIONS_AVAILABLE = 84 + PF_ARM_SME_F64F64_INSTRUCTIONS_AVAILABLE = 85 + PF_ARM_SME_I16I64_INSTRUCTIONS_AVAILABLE = 86 + PF_ARM_SME_LUTv2_INSTRUCTIONS_AVAILABLE = 87 + PF_ARM_SME_FA64_INSTRUCTIONS_AVAILABLE = 88 + PF_UMONITOR_INSTRUCTION_AVAILABLE = 89 +) diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index f25b7308..fe7a4ea1 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -320,6 +320,7 @@ var ( procGetVolumePathNamesForVolumeNameW = modkernel32.NewProc("GetVolumePathNamesForVolumeNameW") procGetWindowsDirectoryW = modkernel32.NewProc("GetWindowsDirectoryW") procInitializeProcThreadAttributeList = modkernel32.NewProc("InitializeProcThreadAttributeList") + procIsProcessorFeaturePresent = modkernel32.NewProc("IsProcessorFeaturePresent") procIsWow64Process = modkernel32.NewProc("IsWow64Process") procIsWow64Process2 = modkernel32.NewProc("IsWow64Process2") procLoadLibraryExW = modkernel32.NewProc("LoadLibraryExW") @@ -2786,6 +2787,12 @@ func initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrco return } +func IsProcessorFeaturePresent(ProcessorFeature uint32) (ret bool) { + r0, _, _ := syscall.SyscallN(procIsProcessorFeaturePresent.Addr(), uintptr(ProcessorFeature)) + ret = r0 != 0 + return +} + func IsWow64Process(handle Handle, isWow64 *bool) (err error) { var _p0 uint32 if *isWow64 { diff --git a/vendor/golang.org/x/term/terminal.go b/vendor/golang.org/x/term/terminal.go index 9255449b..6ec537cd 100644 --- a/vendor/golang.org/x/term/terminal.go +++ b/vendor/golang.org/x/term/terminal.go @@ -160,7 +160,9 @@ const ( keyEnd keyDeleteWord keyDeleteLine + keyDelete keyClearScreen + keyTranspose keyPasteStart keyPasteEnd ) @@ -194,6 +196,8 @@ func bytesToKey(b []byte, pasteActive bool) (rune, []byte) { return keyDeleteLine, b[1:] case 12: // ^L return keyClearScreen, b[1:] + case 20: // ^T + return keyTranspose, b[1:] case 23: // ^W return keyDeleteWord, b[1:] case 14: // ^N @@ -228,6 +232,10 @@ func bytesToKey(b []byte, pasteActive bool) (rune, []byte) { } } + if !pasteActive && len(b) >= 4 && b[0] == keyEscape && b[1] == '[' && b[2] == '3' && b[3] == '~' { + return keyDelete, b[4:] + } + if !pasteActive && len(b) >= 6 && b[0] == keyEscape && b[1] == '[' && b[2] == '1' && b[3] == ';' && b[4] == '3' { switch b[5] { case 'C': @@ -590,7 +598,7 @@ func (t *Terminal) handleKey(key rune) (line string, ok bool) { } t.line = t.line[:t.pos] t.moveCursorToPos(t.pos) - case keyCtrlD: + case keyCtrlD, keyDelete: // Erase the character under the current position. // The EOF case when the line is empty is handled in // readLine(). @@ -600,6 +608,24 @@ func (t *Terminal) handleKey(key rune) (line string, ok bool) { } case keyCtrlU: t.eraseNPreviousChars(t.pos) + case keyTranspose: + // This transposes the two characters around the cursor and advances the cursor. Best-effort. + if len(t.line) < 2 || t.pos < 1 { + return + } + swap := t.pos + if swap == len(t.line) { + swap-- // special: at end of line, swap previous two chars + } + t.line[swap-1], t.line[swap] = t.line[swap], t.line[swap-1] + if t.pos < len(t.line) { + t.pos++ + } + if t.echo { + t.moveCursorToPos(swap - 1) + t.writeLine(t.line[swap-1:]) + t.moveCursorToPos(t.pos) + } case keyClearScreen: // Erases the screen and moves the cursor to the home position. t.queue([]rune("\x1b[2J\x1b[H")) diff --git a/vendor/golang.org/x/tools/go/packages/packages.go b/vendor/golang.org/x/tools/go/packages/packages.go index 060ab08e..ff607389 100644 --- a/vendor/golang.org/x/tools/go/packages/packages.go +++ b/vendor/golang.org/x/tools/go/packages/packages.go @@ -1027,11 +1027,15 @@ func (ld *loader) refine(response *DriverResponse) ([]*Package, error) { // Precondition: ld.Mode&(NeedSyntax|NeedTypes|NeedTypesInfo) != 0. func (ld *loader) loadPackage(lpkg *loaderPackage) { if lpkg.PkgPath == "unsafe" { - // Fill in the blanks to avoid surprises. + // To avoid surprises, fill in the blanks consistent + // with other packages. (For example, some analyzers + // assert that each needed types.Info map is non-nil + // even when there is no syntax that would cause them + // to consult the map.) lpkg.Types = types.Unsafe lpkg.Fset = ld.Fset lpkg.Syntax = []*ast.File{} - lpkg.TypesInfo = new(types.Info) + lpkg.TypesInfo = ld.newTypesInfo() lpkg.TypesSizes = ld.sizes return } @@ -1180,20 +1184,7 @@ func (ld *loader) loadPackage(lpkg *loaderPackage) { return } - // Populate TypesInfo only if needed, as it - // causes the type checker to work much harder. - if ld.Config.Mode&NeedTypesInfo != 0 { - lpkg.TypesInfo = &types.Info{ - Types: make(map[ast.Expr]types.TypeAndValue), - Defs: make(map[*ast.Ident]types.Object), - Uses: make(map[*ast.Ident]types.Object), - Implicits: make(map[ast.Node]types.Object), - Instances: make(map[*ast.Ident]types.Instance), - Scopes: make(map[ast.Node]*types.Scope), - Selections: make(map[*ast.SelectorExpr]*types.Selection), - FileVersions: make(map[*ast.File]string), - } - } + lpkg.TypesInfo = ld.newTypesInfo() lpkg.TypesSizes = ld.sizes importer := importerFunc(func(path string) (*types.Package, error) { @@ -1307,6 +1298,24 @@ func (ld *loader) loadPackage(lpkg *loaderPackage) { lpkg.IllTyped = illTyped } +func (ld *loader) newTypesInfo() *types.Info { + // Populate TypesInfo only if needed, as it + // causes the type checker to work much harder. + if ld.Config.Mode&NeedTypesInfo == 0 { + return nil + } + return &types.Info{ + Types: make(map[ast.Expr]types.TypeAndValue), + Defs: make(map[*ast.Ident]types.Object), + Uses: make(map[*ast.Ident]types.Object), + Implicits: make(map[ast.Node]types.Object), + Instances: make(map[*ast.Ident]types.Instance), + Scopes: make(map[ast.Node]*types.Scope), + Selections: make(map[*ast.SelectorExpr]*types.Selection), + FileVersions: make(map[*ast.File]string), + } +} + // An importFunc is an implementation of the single-method // types.Importer interface based on a function value. type importerFunc func(path string) (*types.Package, error) diff --git a/vendor/golang.org/x/tools/go/types/typeutil/callee.go b/vendor/golang.org/x/tools/go/types/typeutil/callee.go index 5f10f56c..3d24a8c6 100644 --- a/vendor/golang.org/x/tools/go/types/typeutil/callee.go +++ b/vendor/golang.org/x/tools/go/types/typeutil/callee.go @@ -12,6 +12,7 @@ import ( // Callee returns the named target of a function call, if any: // a function, method, builtin, or variable. +// It returns nil for a T(x) conversion. // // Functions and methods may potentially have type parameters. // diff --git a/vendor/golang.org/x/tools/internal/event/core/export.go b/vendor/golang.org/x/tools/internal/event/core/export.go index 05f3a9a5..16ae6bb0 100644 --- a/vendor/golang.org/x/tools/internal/event/core/export.go +++ b/vendor/golang.org/x/tools/internal/event/core/export.go @@ -8,7 +8,6 @@ import ( "context" "sync/atomic" "time" - "unsafe" "golang.org/x/tools/internal/event/label" ) @@ -17,23 +16,21 @@ import ( // It may return a modified context and event. type Exporter func(context.Context, Event, label.Map) context.Context -var ( - exporter unsafe.Pointer -) +var exporter atomic.Pointer[Exporter] // SetExporter sets the global exporter function that handles all events. // The exporter is called synchronously from the event call site, so it should // return quickly so as not to hold up user code. func SetExporter(e Exporter) { - p := unsafe.Pointer(&e) if e == nil { // &e is always valid, and so p is always valid, but for the early abort // of ProcessEvent to be efficient it needs to make the nil check on the // pointer without having to dereference it, so we make the nil function // also a nil pointer - p = nil + exporter.Store(nil) + } else { + exporter.Store(&e) } - atomic.StorePointer(&exporter, p) } // deliver is called to deliver an event to the supplied exporter. @@ -48,7 +45,7 @@ func deliver(ctx context.Context, exporter Exporter, ev Event) context.Context { // Export is called to deliver an event to the global exporter if set. func Export(ctx context.Context, ev Event) context.Context { // get the global exporter and abort early if there is not one - exporterPtr := (*Exporter)(atomic.LoadPointer(&exporter)) + exporterPtr := exporter.Load() if exporterPtr == nil { return ctx } @@ -61,7 +58,7 @@ func Export(ctx context.Context, ev Event) context.Context { // It will fill in the time. func ExportPair(ctx context.Context, begin, end Event) (context.Context, func()) { // get the global exporter and abort early if there is not one - exporterPtr := (*Exporter)(atomic.LoadPointer(&exporter)) + exporterPtr := exporter.Load() if exporterPtr == nil { return ctx, func() {} } diff --git a/vendor/golang.org/x/tools/internal/event/label/label.go b/vendor/golang.org/x/tools/internal/event/label/label.go index 92a39105..c37584af 100644 --- a/vendor/golang.org/x/tools/internal/event/label/label.go +++ b/vendor/golang.org/x/tools/internal/event/label/label.go @@ -7,7 +7,6 @@ package label import ( "fmt" "io" - "reflect" "slices" "unsafe" ) @@ -103,11 +102,10 @@ type stringptr unsafe.Pointer // This method is for implementing new key types, label creation should // normally be done with the Of method of the key. func OfString(k Key, v string) Label { - hdr := (*reflect.StringHeader)(unsafe.Pointer(&v)) return Label{ key: k, - packed: uint64(hdr.Len), - untyped: stringptr(hdr.Data), + packed: uint64(len(v)), + untyped: stringptr(unsafe.StringData(v)), } } @@ -116,11 +114,7 @@ func OfString(k Key, v string) Label { // This method is for implementing new key types, for type safety normal // access should be done with the From method of the key. func (t Label) UnpackString() string { - var v string - hdr := (*reflect.StringHeader)(unsafe.Pointer(&v)) - hdr.Data = uintptr(t.untyped.(stringptr)) - hdr.Len = int(t.packed) - return v + return unsafe.String((*byte)(t.untyped.(stringptr)), int(t.packed)) } // Valid returns true if the Label is a valid one (it has a key). diff --git a/vendor/golang.org/x/tools/internal/stdlib/deps.go b/vendor/golang.org/x/tools/internal/stdlib/deps.go index 581784da..f7b9c128 100644 --- a/vendor/golang.org/x/tools/internal/stdlib/deps.go +++ b/vendor/golang.org/x/tools/internal/stdlib/deps.go @@ -12,360 +12,364 @@ type pkginfo struct { } var deps = [...]pkginfo{ - {"archive/tar", "\x03n\x03E<\x01\n\x01$\x01\x01\x02\x05\b\x02\x01\x02\x02\f"}, - {"archive/zip", "\x02\x04d\a\x03\x12\x021<\x01+\x05\x01\x0f\x03\x02\x0e\x04"}, - {"bufio", "\x03n\x84\x01D\x14"}, - {"bytes", "q*Z\x03\fG\x02\x02"}, + {"archive/tar", "\x03p\x03F=\x01\n\x01$\x01\x01\x02\x05\b\x02\x01\x02\x02\f"}, + {"archive/zip", "\x02\x04f\a\x03\x13\x021=\x01+\x05\x01\x0f\x03\x02\x0e\x04"}, + {"bufio", "\x03p\x86\x01D\x14"}, + {"bytes", "s+[\x03\fG\x02\x02"}, {"cmp", ""}, - {"compress/bzip2", "\x02\x02\xf1\x01A"}, - {"compress/flate", "\x02o\x03\x81\x01\f\x033\x01\x03"}, - {"compress/gzip", "\x02\x04d\a\x03\x14mT"}, - {"compress/lzw", "\x02o\x03\x81\x01"}, - {"compress/zlib", "\x02\x04d\a\x03\x12\x01n"}, - {"container/heap", "\xb7\x02"}, + {"compress/bzip2", "\x02\x02\xf5\x01A"}, + {"compress/flate", "\x02q\x03\x83\x01\f\x033\x01\x03"}, + {"compress/gzip", "\x02\x04f\a\x03\x15nT"}, + {"compress/lzw", "\x02q\x03\x83\x01"}, + {"compress/zlib", "\x02\x04f\a\x03\x13\x01o"}, + {"container/heap", "\xbb\x02"}, {"container/list", ""}, {"container/ring", ""}, - {"context", "q[o\x01\r"}, - {"crypto", "\x86\x01oC"}, - {"crypto/aes", "\x10\n\t\x95\x02"}, - {"crypto/cipher", "\x03 \x01\x01\x1f\x11\x1c+Y"}, - {"crypto/des", "\x10\x15\x1f-+\x9c\x01\x03"}, - {"crypto/dsa", "D\x04)\x84\x01\r"}, - {"crypto/ecdh", "\x03\v\f\x10\x04\x16\x04\r\x1c\x84\x01"}, - {"crypto/ecdsa", "\x0e\x05\x03\x04\x01\x10\a\v\x06\x01\x04\f\x01\x1c\x84\x01\r\x05K\x01"}, - {"crypto/ed25519", "\x0e\x1e\x11\a\n\a\x1c\x84\x01C"}, - {"crypto/elliptic", "2?\x84\x01\r9"}, + {"context", "s\\p\x01\r"}, + {"crypto", "\x89\x01pC"}, + {"crypto/aes", "\x10\n\t\x99\x02"}, + {"crypto/cipher", "\x03 \x01\x01 \x12\x1c,Z"}, + {"crypto/des", "\x10\x15 .,\x9d\x01\x03"}, + {"crypto/dsa", "E\x04*\x86\x01\r"}, + {"crypto/ecdh", "\x03\v\f\x10\x04\x17\x04\x0e\x1c\x86\x01"}, + {"crypto/ecdsa", "\x0e\x05\x03\x04\x01\x10\b\v\x06\x01\x04\r\x01\x1c\x86\x01\r\x05K\x01"}, + {"crypto/ed25519", "\x0e\x1e\x12\a\v\a\x1c\x86\x01C"}, + {"crypto/elliptic", "3@\x86\x01\r9"}, {"crypto/fips140", "\"\x05"}, - {"crypto/hkdf", "/\x14\x01-\x15"}, - {"crypto/hmac", "\x1a\x16\x13\x01\x111"}, - {"crypto/internal/boring", "\x0e\x02\ri"}, - {"crypto/internal/boring/bbig", "\x1a\xe8\x01M"}, - {"crypto/internal/boring/bcache", "\xbc\x02\x13"}, + {"crypto/hkdf", "/\x15\x01.\x16"}, + {"crypto/hmac", "\x1a\x16\x14\x01\x122"}, + {"crypto/internal/boring", "\x0e\x02\rl"}, + {"crypto/internal/boring/bbig", "\x1a\xec\x01M"}, + {"crypto/internal/boring/bcache", "\xc0\x02\x13"}, {"crypto/internal/boring/sig", ""}, {"crypto/internal/constanttime", ""}, - {"crypto/internal/cryptotest", "\x03\r\n\b%\x0e\x19\x06\x12\x12 \x04\x06\t\x18\x01\x11\x11\x1b\x01\a\x05\b\x03\x05\v"}, - {"crypto/internal/entropy", "I"}, - {"crypto/internal/entropy/v1.0.0", "B/\x93\x018\x13"}, - {"crypto/internal/fips140", "A0\xbd\x01\v\x16"}, - {"crypto/internal/fips140/aes", "\x03\x1f\x03\x02\x13\x05\x01\x01\x06*\x93\x014"}, - {"crypto/internal/fips140/aes/gcm", "\"\x01\x02\x02\x02\x11\x05\x01\a*\x90\x01"}, - {"crypto/internal/fips140/alias", "\xcf\x02"}, - {"crypto/internal/fips140/bigmod", "'\x18\x01\a*\x93\x01"}, - {"crypto/internal/fips140/check", "\"\x0e\x06\t\x02\xb4\x01Z"}, - {"crypto/internal/fips140/check/checktest", "'\x87\x02!"}, - {"crypto/internal/fips140/drbg", "\x03\x1e\x01\x01\x04\x13\x05\t\x01(\x84\x01\x0f7\x01"}, - {"crypto/internal/fips140/ecdh", "\x03\x1f\x05\x02\t\r2\x84\x01\x0f7"}, - {"crypto/internal/fips140/ecdsa", "\x03\x1f\x04\x01\x02\a\x02\x069\x15oF"}, - {"crypto/internal/fips140/ed25519", "\x03\x1f\x05\x02\x04\v9\xc7\x01\x03"}, - {"crypto/internal/fips140/edwards25519", "\x1e\t\a\x112\x93\x017"}, - {"crypto/internal/fips140/edwards25519/field", "'\x13\x052\x93\x01"}, - {"crypto/internal/fips140/hkdf", "\x03\x1f\x05\t\x06;\x15"}, - {"crypto/internal/fips140/hmac", "\x03\x1f\x14\x01\x019\x15"}, - {"crypto/internal/fips140/mlkem", "\x03\x1f\x05\x02\x0e\x03\x052\xca\x01"}, - {"crypto/internal/fips140/nistec", "\x1e\t\f\f2\x93\x01*\r\x14"}, - {"crypto/internal/fips140/nistec/fiat", "'\x137\x93\x01"}, - {"crypto/internal/fips140/pbkdf2", "\x03\x1f\x05\t\x06;\x15"}, - {"crypto/internal/fips140/rsa", "\x03\x1b\x04\x04\x01\x02\r\x01\x01\x027\x15oF"}, - {"crypto/internal/fips140/sha256", "\x03\x1f\x1d\x01\a*\x15~"}, - {"crypto/internal/fips140/sha3", "\x03\x1f\x18\x05\x011\x93\x01K"}, - {"crypto/internal/fips140/sha512", "\x03\x1f\x1d\x01\a*\x15~"}, - {"crypto/internal/fips140/ssh", "'_"}, - {"crypto/internal/fips140/subtle", "\x1e\a\x1a\xc5\x01"}, - {"crypto/internal/fips140/tls12", "\x03\x1f\x05\t\x06\x029\x15"}, - {"crypto/internal/fips140/tls13", "\x03\x1f\x05\b\a\t2\x15"}, - {"crypto/internal/fips140cache", "\xae\x02\r&"}, + {"crypto/internal/cryptotest", "\x03\r\n\b&\x0f\x19\x06\x13\x12 \x04\x06\t\x19\x01\x11\x11\x1b\x01\a\x05\b\x03\x05\v"}, + {"crypto/internal/entropy", "J"}, + {"crypto/internal/entropy/v1.0.0", "C0\x95\x018\x13"}, + {"crypto/internal/fips140", "B1\xbf\x01\v\x16"}, + {"crypto/internal/fips140/aes", "\x03\x1f\x03\x02\x14\x05\x01\x01\x06+\x95\x014"}, + {"crypto/internal/fips140/aes/gcm", "\"\x01\x02\x02\x02\x12\x05\x01\a+\x92\x01"}, + {"crypto/internal/fips140/alias", "\xd3\x02"}, + {"crypto/internal/fips140/bigmod", "'\x19\x01\a+\x95\x01"}, + {"crypto/internal/fips140/check", "\"\x0e\a\t\x02\xb7\x01Z"}, + {"crypto/internal/fips140/check/checktest", "'\x8b\x02!"}, + {"crypto/internal/fips140/drbg", "\x03\x1e\x01\x01\x04\x14\x05\t\x01)\x86\x01\x0f7\x01"}, + {"crypto/internal/fips140/ecdh", "\x03\x1f\x05\x02\n\r3\x86\x01\x0f7"}, + {"crypto/internal/fips140/ecdsa", "\x03\x1f\x04\x01\x02\a\x03\x06:\x16pF"}, + {"crypto/internal/fips140/ed25519", "\x03\x1f\x05\x02\x04\f:\xc9\x01\x03"}, + {"crypto/internal/fips140/edwards25519", "\x1e\t\a\x123\x95\x017"}, + {"crypto/internal/fips140/edwards25519/field", "'\x14\x053\x95\x01"}, + {"crypto/internal/fips140/hkdf", "\x03\x1f\x05\t\a<\x16"}, + {"crypto/internal/fips140/hmac", "\x03\x1f\x15\x01\x01:\x16"}, + {"crypto/internal/fips140/mldsa", "\x03\x1b\x04\x05\x02\x0e\x01\x03\x053\x95\x017"}, + {"crypto/internal/fips140/mlkem", "\x03\x1f\x05\x02\x0f\x03\x053\xcc\x01"}, + {"crypto/internal/fips140/nistec", "\x1e\t\r\f3\x95\x01*\r\x14"}, + {"crypto/internal/fips140/nistec/fiat", "'\x148\x95\x01"}, + {"crypto/internal/fips140/pbkdf2", "\x03\x1f\x05\t\a<\x16"}, + {"crypto/internal/fips140/rsa", "\x03\x1b\x04\x04\x01\x02\x0e\x01\x01\x028\x16pF"}, + {"crypto/internal/fips140/sha256", "\x03\x1f\x1e\x01\a+\x16\x7f"}, + {"crypto/internal/fips140/sha3", "\x03\x1f\x19\x05\x012\x95\x01K"}, + {"crypto/internal/fips140/sha512", "\x03\x1f\x1e\x01\a+\x16\x7f"}, + {"crypto/internal/fips140/ssh", "'b"}, + {"crypto/internal/fips140/subtle", "\x1e\a\x1b\xc8\x01"}, + {"crypto/internal/fips140/tls12", "\x03\x1f\x05\t\a\x02:\x16"}, + {"crypto/internal/fips140/tls13", "\x03\x1f\x05\b\b\t3\x16"}, + {"crypto/internal/fips140cache", "\xb2\x02\r&"}, {"crypto/internal/fips140deps", ""}, - {"crypto/internal/fips140deps/byteorder", "\x9c\x01"}, - {"crypto/internal/fips140deps/cpu", "\xb1\x01\a"}, - {"crypto/internal/fips140deps/godebug", "\xb9\x01"}, - {"crypto/internal/fips140deps/time", "\xc9\x02"}, - {"crypto/internal/fips140hash", "7\x1c3\xc9\x01"}, - {"crypto/internal/fips140only", ")\r\x01\x01N3<"}, + {"crypto/internal/fips140deps/byteorder", "\x9f\x01"}, + {"crypto/internal/fips140deps/cpu", "\xb4\x01\a"}, + {"crypto/internal/fips140deps/godebug", "\xbc\x01"}, + {"crypto/internal/fips140deps/time", "\xcd\x02"}, + {"crypto/internal/fips140hash", "8\x1d4\xca\x01"}, + {"crypto/internal/fips140only", ")\x0e\x01\x01P3="}, {"crypto/internal/fips140test", ""}, - {"crypto/internal/hpke", "\x0e\x01\x01\x03\x056#+hM"}, - {"crypto/internal/impl", "\xb9\x02"}, - {"crypto/internal/randutil", "\xf5\x01\x12"}, - {"crypto/internal/sysrand", "qo! \r\r\x01\x01\f\x06"}, - {"crypto/internal/sysrand/internal/seccomp", "q"}, - {"crypto/md5", "\x0e6-\x15\x16h"}, - {"crypto/mlkem", "1"}, - {"crypto/pbkdf2", "4\x0f\x01-\x15"}, - {"crypto/rand", "\x1a\b\a\x1b\x04\x01(\x84\x01\rM"}, - {"crypto/rc4", "%\x1f-\xc7\x01"}, - {"crypto/rsa", "\x0e\f\x01\v\x0f\x0e\x01\x04\x06\a\x1c\x03\x123<\f\x01"}, - {"crypto/sha1", "\x0e\f*\x03*\x15\x16\x15S"}, - {"crypto/sha256", "\x0e\f\x1cP"}, - {"crypto/sha3", "\x0e)O\xc9\x01"}, - {"crypto/sha512", "\x0e\f\x1eN"}, - {"crypto/subtle", "\x1e\x1c\x9c\x01X"}, - {"crypto/tls", "\x03\b\x02\x01\x01\x01\x01\x02\x01\x01\x01\x02\x01\x01\t\x01\r\n\x01\n\x05\x03\x01\x01\x01\x01\x02\x01\x02\x01\x17\x02\x03\x12\x16\x15\b<\x16\x16\r\b\x01\x01\x01\x02\x01\r\x06\x02\x01\x0f"}, - {"crypto/tls/internal/fips140tls", "\x17\xa5\x02"}, - {"crypto/x509", "\x03\v\x01\x01\x01\x01\x01\x01\x01\x015\x05\x01\x01\x02\x05\x0e\x06\x02\x02\x03E\x039\x01\x02\b\x01\x01\x02\a\x10\x05\x01\x06\x02\x05\b\x02\x01\x02\x0e\x02\x01\x01\x02\x03\x01"}, - {"crypto/x509/pkix", "g\x06\a\x8e\x01G"}, - {"database/sql", "\x03\nN\x16\x03\x81\x01\v\a\"\x05\b\x02\x03\x01\r\x02\x02\x02"}, - {"database/sql/driver", "\rd\x03\xb5\x01\x0f\x11"}, - {"debug/buildinfo", "\x03[\x02\x01\x01\b\a\x03e\x1a\x02\x01+\x0f\x1f"}, - {"debug/dwarf", "\x03g\a\x03\x81\x011\x11\x01\x01"}, - {"debug/elf", "\x03\x06T\r\a\x03e\x1b\x01\f \x17\x01\x16"}, - {"debug/gosym", "\x03g\n\xc3\x01\x01\x01\x02"}, - {"debug/macho", "\x03\x06T\r\ne\x1c,\x17\x01"}, - {"debug/pe", "\x03\x06T\r\a\x03e\x1c,\x17\x01\x16"}, - {"debug/plan9obj", "j\a\x03e\x1c,"}, - {"embed", "q*A\x19\x01S"}, + {"crypto/internal/hpke", "\x03\v\x01\x01\x03\x055\x03\x04\x01\x01\x16\a\x03\x13\xcc\x01"}, + {"crypto/internal/impl", "\xbd\x02"}, + {"crypto/internal/randutil", "\xf9\x01\x12"}, + {"crypto/internal/sysrand", "sq! \r\r\x01\x01\f\x06"}, + {"crypto/internal/sysrand/internal/seccomp", "s"}, + {"crypto/md5", "\x0e7.\x16\x16i"}, + {"crypto/mlkem", "\x0e$"}, + {"crypto/mlkem/mlkemtest", "2\x1b&"}, + {"crypto/pbkdf2", "5\x0f\x01.\x16"}, + {"crypto/rand", "\x1a\b\a\x1c\x04\x01)\x86\x01\rM"}, + {"crypto/rc4", "% .\xc9\x01"}, + {"crypto/rsa", "\x0e\f\x01\v\x10\x0e\x01\x04\a\a\x1c\x03\x133=\f\x01"}, + {"crypto/sha1", "\x0e\f+\x03+\x16\x16\x15T"}, + {"crypto/sha256", "\x0e\f\x1dR"}, + {"crypto/sha3", "\x0e*Q\xca\x01"}, + {"crypto/sha512", "\x0e\f\x1fP"}, + {"crypto/subtle", "\x1e\x1d\x9f\x01X"}, + {"crypto/tls", "\x03\b\x02\x01\x01\x01\x01\x02\x01\x01\x01\x02\x01\x01\t\x01\x0e\n\x01\n\x05\x04\x01\x01\x01\x01\x02\x01\x02\x01\x17\x02\x03\x13\x16\x15\b=\x16\x16\r\b\x01\x01\x01\x02\x01\r\x06\x02\x01\x0f"}, + {"crypto/tls/internal/fips140tls", "\x17\xa9\x02"}, + {"crypto/x509", "\x03\v\x01\x01\x01\x01\x01\x01\x01\x016\x06\x01\x01\x02\x05\x0e\x06\x02\x02\x03F\x03:\x01\x02\b\x01\x01\x02\a\x10\x05\x01\x06\a\b\x02\x01\x02\x0e\x02\x01\x01\x02\x03\x01"}, + {"crypto/x509/pkix", "i\x06\a\x90\x01G"}, + {"database/sql", "\x03\nP\x16\x03\x83\x01\v\a\"\x05\b\x02\x03\x01\r\x02\x02\x02"}, + {"database/sql/driver", "\rf\x03\xb7\x01\x0f\x11"}, + {"debug/buildinfo", "\x03]\x02\x01\x01\b\a\x03g\x1a\x02\x01+\x0f\x1f"}, + {"debug/dwarf", "\x03i\a\x03\x83\x011\x11\x01\x01"}, + {"debug/elf", "\x03\x06V\r\a\x03g\x1b\x01\f \x17\x01\x16"}, + {"debug/gosym", "\x03i\n\xc5\x01\x01\x01\x02"}, + {"debug/macho", "\x03\x06V\r\ng\x1c,\x17\x01"}, + {"debug/pe", "\x03\x06V\r\a\x03g\x1c,\x17\x01\x16"}, + {"debug/plan9obj", "l\a\x03g\x1c,"}, + {"embed", "s+B\x19\x01S"}, {"embed/internal/embedtest", ""}, {"encoding", ""}, - {"encoding/ascii85", "\xf5\x01C"}, - {"encoding/asn1", "\x03n\x03e(\x01'\r\x02\x01\x10\x03\x01"}, - {"encoding/base32", "\xf5\x01A\x02"}, - {"encoding/base64", "\x9c\x01YA\x02"}, - {"encoding/binary", "q\x84\x01\f(\r\x05"}, - {"encoding/csv", "\x02\x01n\x03\x81\x01D\x12\x02"}, - {"encoding/gob", "\x02c\x05\a\x03e\x1c\v\x01\x03\x1d\b\x12\x01\x0f\x02"}, - {"encoding/hex", "q\x03\x81\x01A\x03"}, - {"encoding/json", "\x03\x01a\x04\b\x03\x81\x01\f(\r\x02\x01\x02\x10\x01\x01\x02"}, - {"encoding/pem", "\x03f\b\x84\x01A\x03"}, - {"encoding/xml", "\x02\x01b\f\x03\x81\x014\x05\n\x01\x02\x10\x02"}, - {"errors", "\xcc\x01\x83\x01"}, - {"expvar", "nK@\b\v\x15\r\b\x02\x03\x01\x11"}, - {"flag", "e\f\x03\x81\x01,\b\x05\b\x02\x01\x10"}, - {"fmt", "qE&\x19\f \b\r\x02\x03\x12"}, - {"go/ast", "\x03\x01p\x0e\x01r\x03)\b\r\x02\x01\x12\x02"}, - {"go/build", "\x02\x01n\x03\x01\x02\x02\a\x02\x01\x17\x1f\x04\x02\b\x1b\x13\x01+\x01\x04\x01\a\b\x02\x01\x12\x02\x02"}, - {"go/build/constraint", "q\xc7\x01\x01\x12\x02"}, - {"go/constant", "t\x0f~\x01\x024\x01\x02\x12"}, - {"go/doc", "\x04p\x01\x05\t=51\x10\x02\x01\x12\x02"}, - {"go/doc/comment", "\x03q\xc2\x01\x01\x01\x01\x12\x02"}, - {"go/format", "\x03q\x01\v\x01\x02rD"}, - {"go/importer", "v\a\x01\x01\x04\x01q9"}, - {"go/internal/gccgoimporter", "\x02\x01[\x13\x03\x04\v\x01o\x02,\x01\x05\x11\x01\f\b"}, - {"go/internal/gcimporter", "\x02r\x0f\x010\x05\r/,\x15\x03\x02"}, - {"go/internal/srcimporter", "t\x01\x01\n\x03\x01q,\x01\x05\x12\x02\x14"}, - {"go/parser", "\x03n\x03\x01\x02\v\x01r\x01+\x06\x12"}, - {"go/printer", "t\x01\x02\x03\tr\f \x15\x02\x01\x02\v\x05\x02"}, - {"go/scanner", "\x03q\x0fr2\x10\x01\x13\x02"}, - {"go/token", "\x04p\x84\x01>\x02\x03\x01\x0f\x02"}, - {"go/types", "\x03\x01\x06g\x03\x01\x03\b\x03\x024\x062\x04\x03\t \x06\a\b\x01\x01\x01\x02\x01\x0f\x02\x02"}, - {"go/version", "\xbe\x01{"}, - {"hash", "\xf5\x01"}, - {"hash/adler32", "q\x15\x16"}, - {"hash/crc32", "q\x15\x16\x15\x8a\x01\x01\x13"}, - {"hash/crc64", "q\x15\x16\x9f\x01"}, - {"hash/fnv", "q\x15\x16h"}, - {"hash/maphash", "\x86\x01\x11<|"}, - {"html", "\xb9\x02\x02\x12"}, - {"html/template", "\x03k\x06\x18-<\x01\n!\x05\x01\x02\x03\f\x01\x02\f\x01\x03\x02"}, - {"image", "\x02o\x1ef\x0f4\x03\x01"}, + {"encoding/ascii85", "\xf9\x01C"}, + {"encoding/asn1", "\x03p\x03g(\x01'\r\x02\x01\x10\x03\x01"}, + {"encoding/base32", "\xf9\x01A\x02"}, + {"encoding/base64", "\x9f\x01ZA\x02"}, + {"encoding/binary", "s\x86\x01\f(\r\x05"}, + {"encoding/csv", "\x02\x01p\x03\x83\x01D\x12\x02"}, + {"encoding/gob", "\x02e\x05\a\x03g\x1c\v\x01\x03\x1d\b\x12\x01\x0f\x02"}, + {"encoding/hex", "s\x03\x83\x01A\x03"}, + {"encoding/json", "\x03\x01c\x04\b\x03\x83\x01\f(\r\x02\x01\x02\x10\x01\x01\x02"}, + {"encoding/pem", "\x03h\b\x86\x01A\x03"}, + {"encoding/xml", "\x02\x01d\f\x03\x83\x014\x05\n\x01\x02\x10\x02"}, + {"errors", "\xcf\x01\x84\x01"}, + {"expvar", "pLA\b\v\x15\r\b\x02\x03\x01\x11"}, + {"flag", "g\f\x03\x83\x01,\b\x05\b\x02\x01\x10"}, + {"fmt", "sF'\x19\f \b\r\x02\x03\x12"}, + {"go/ast", "\x03\x01r\x0f\x01s\x03)\b\r\x02\x01\x12\x02"}, + {"go/build", "\x02\x01p\x03\x01\x02\x02\b\x02\x01\x17\x1f\x04\x02\b\x1c\x13\x01+\x01\x04\x01\a\b\x02\x01\x12\x02\x02"}, + {"go/build/constraint", "s\xc9\x01\x01\x12\x02"}, + {"go/constant", "v\x10\x7f\x01\x024\x01\x02\x12"}, + {"go/doc", "\x04r\x01\x05\n=61\x10\x02\x01\x12\x02"}, + {"go/doc/comment", "\x03s\xc4\x01\x01\x01\x01\x12\x02"}, + {"go/format", "\x03s\x01\f\x01\x02sD"}, + {"go/importer", "x\a\x01\x02\x04\x01r9"}, + {"go/internal/gccgoimporter", "\x02\x01]\x13\x03\x04\f\x01p\x02,\x01\x05\x11\x01\f\b"}, + {"go/internal/gcimporter", "\x02t\x10\x010\x05\r0,\x15\x03\x02"}, + {"go/internal/scannerhooks", "\x86\x01"}, + {"go/internal/srcimporter", "v\x01\x01\v\x03\x01r,\x01\x05\x12\x02\x14"}, + {"go/parser", "\x03p\x03\x01\x02\b\x04\x01s\x01+\x06\x12"}, + {"go/printer", "v\x01\x02\x03\ns\f \x15\x02\x01\x02\v\x05\x02"}, + {"go/scanner", "\x03s\v\x05s2\x10\x01\x13\x02"}, + {"go/token", "\x04r\x86\x01>\x02\x03\x01\x0f\x02"}, + {"go/types", "\x03\x01\x06i\x03\x01\x03\t\x03\x024\x063\x04\x03\t \x06\a\b\x01\x01\x01\x02\x01\x0f\x02\x02"}, + {"go/version", "\xc1\x01|"}, + {"hash", "\xf9\x01"}, + {"hash/adler32", "s\x16\x16"}, + {"hash/crc32", "s\x16\x16\x15\x8b\x01\x01\x13"}, + {"hash/crc64", "s\x16\x16\xa0\x01"}, + {"hash/fnv", "s\x16\x16i"}, + {"hash/maphash", "\x89\x01\x11<}"}, + {"html", "\xbd\x02\x02\x12"}, + {"html/template", "\x03m\x06\x19-=\x01\n!\x05\x01\x02\x03\f\x01\x02\f\x01\x03\x02"}, + {"image", "\x02q\x1fg\x0f4\x03\x01"}, {"image/color", ""}, - {"image/color/palette", "\x8f\x01"}, - {"image/draw", "\x8e\x01\x01\x04"}, - {"image/gif", "\x02\x01\x05i\x03\x1a\x01\x01\x01\vY"}, - {"image/internal/imageutil", "\x8e\x01"}, - {"image/jpeg", "\x02o\x1d\x01\x04b"}, - {"image/png", "\x02\aa\n\x12\x02\x06\x01fC"}, - {"index/suffixarray", "\x03g\a\x84\x01\f+\n\x01"}, - {"internal/abi", "\xb8\x01\x97\x01"}, - {"internal/asan", "\xcf\x02"}, - {"internal/bisect", "\xae\x02\r\x01"}, - {"internal/buildcfg", "tGf\x06\x02\x05\n\x01"}, - {"internal/bytealg", "\xb1\x01\x9e\x01"}, + {"image/color/palette", "\x92\x01"}, + {"image/draw", "\x91\x01\x01\x04"}, + {"image/gif", "\x02\x01\x05k\x03\x1b\x01\x01\x01\vZ\x0f"}, + {"image/internal/imageutil", "\x91\x01"}, + {"image/jpeg", "\x02q\x1e\x01\x04c"}, + {"image/png", "\x02\ac\n\x13\x02\x06\x01gC"}, + {"index/suffixarray", "\x03i\a\x86\x01\f+\n\x01"}, + {"internal/abi", "\xbb\x01\x98\x01"}, + {"internal/asan", "\xd3\x02"}, + {"internal/bisect", "\xb2\x02\r\x01"}, + {"internal/buildcfg", "vHg\x06\x02\x05\n\x01"}, + {"internal/bytealg", "\xb4\x01\x9f\x01"}, {"internal/byteorder", ""}, {"internal/cfg", ""}, - {"internal/cgrouptest", "tZS\x06\x0f\x02\x01\x04\x01"}, - {"internal/chacha8rand", "\x9c\x01\x15\a\x97\x01"}, + {"internal/cgrouptest", "v[T\x06\x0f\x02\x01\x04\x01"}, + {"internal/chacha8rand", "\x9f\x01\x15\a\x98\x01"}, {"internal/copyright", ""}, {"internal/coverage", ""}, {"internal/coverage/calloc", ""}, - {"internal/coverage/cfile", "n\x06\x16\x17\x01\x02\x01\x01\x01\x01\x01\x01\x01\"\x02&,\x06\a\n\x01\x03\r\x06"}, - {"internal/coverage/cformat", "\x04p-\x04P\v6\x01\x02\r"}, - {"internal/coverage/cmerge", "t-`"}, - {"internal/coverage/decodecounter", "j\n-\v\x02G,\x17\x17"}, - {"internal/coverage/decodemeta", "\x02h\n\x16\x17\v\x02G,"}, - {"internal/coverage/encodecounter", "\x02h\n-\f\x01\x02E\v!\x15"}, - {"internal/coverage/encodemeta", "\x02\x01g\n\x12\x04\x17\r\x02E,."}, - {"internal/coverage/pods", "\x04p-\x80\x01\x06\x05\n\x02\x01"}, - {"internal/coverage/rtcov", "\xcf\x02"}, - {"internal/coverage/slicereader", "j\n\x81\x01Z"}, - {"internal/coverage/slicewriter", "t\x81\x01"}, - {"internal/coverage/stringtab", "t8\x04E"}, + {"internal/coverage/cfile", "p\x06\x17\x17\x01\x02\x01\x01\x01\x01\x01\x01\x01\"\x02',\x06\a\n\x01\x03\r\x06"}, + {"internal/coverage/cformat", "\x04r.\x04Q\v6\x01\x02\r"}, + {"internal/coverage/cmerge", "v.a"}, + {"internal/coverage/decodecounter", "l\n.\v\x02H,\x17\x17"}, + {"internal/coverage/decodemeta", "\x02j\n\x17\x17\v\x02H,"}, + {"internal/coverage/encodecounter", "\x02j\n.\f\x01\x02F\v!\x15"}, + {"internal/coverage/encodemeta", "\x02\x01i\n\x13\x04\x17\r\x02F,."}, + {"internal/coverage/pods", "\x04r.\x81\x01\x06\x05\n\x02\x01"}, + {"internal/coverage/rtcov", "\xd3\x02"}, + {"internal/coverage/slicereader", "l\n\x83\x01Z"}, + {"internal/coverage/slicewriter", "v\x83\x01"}, + {"internal/coverage/stringtab", "v9\x04F"}, {"internal/coverage/test", ""}, {"internal/coverage/uleb128", ""}, - {"internal/cpu", "\xcf\x02"}, - {"internal/dag", "\x04p\xc2\x01\x03"}, - {"internal/diff", "\x03q\xc3\x01\x02"}, - {"internal/exportdata", "\x02\x01n\x03\x02c\x1c,\x01\x05\x11\x01\x02"}, - {"internal/filepathlite", "q*A\x1a@"}, - {"internal/fmtsort", "\x04\xa5\x02\r"}, - {"internal/fuzz", "\x03\nE\x18\x04\x03\x03\x01\v\x036<\f\x03\x1d\x01\x05\x02\x05\n\x01\x02\x01\x01\f\x04\x02"}, + {"internal/cpu", "\xd3\x02"}, + {"internal/dag", "\x04r\xc4\x01\x03"}, + {"internal/diff", "\x03s\xc5\x01\x02"}, + {"internal/exportdata", "\x02\x01p\x03\x02e\x1c,\x01\x05\x11\x01\x02"}, + {"internal/filepathlite", "s+B\x1a@"}, + {"internal/fmtsort", "\x04\xa9\x02\r"}, + {"internal/fuzz", "\x03\nG\x18\x04\x03\x03\x01\f\x036=\f\x03\x1d\x01\x05\x02\x05\n\x01\x02\x01\x01\f\x04\x02"}, {"internal/goarch", ""}, - {"internal/godebug", "\x99\x01!\x81\x01\x01\x13"}, + {"internal/godebug", "\x9c\x01!\x82\x01\x01\x13"}, {"internal/godebugs", ""}, {"internal/goexperiment", ""}, {"internal/goos", ""}, - {"internal/goroot", "\xa1\x02\x01\x05\x12\x02"}, + {"internal/goroot", "\xa5\x02\x01\x05\x12\x02"}, {"internal/gover", "\x04"}, {"internal/goversion", ""}, - {"internal/lazyregexp", "\xa1\x02\v\r\x02"}, - {"internal/lazytemplate", "\xf5\x01,\x18\x02\f"}, - {"internal/msan", "\xcf\x02"}, + {"internal/lazyregexp", "\xa5\x02\v\r\x02"}, + {"internal/lazytemplate", "\xf9\x01,\x18\x02\f"}, + {"internal/msan", "\xd3\x02"}, {"internal/nettrace", ""}, - {"internal/obscuretestdata", "i\x8c\x01,"}, - {"internal/oserror", "q"}, - {"internal/pkgbits", "\x03O\x18\a\x03\x04\vr\r\x1f\r\n\x01"}, + {"internal/obscuretestdata", "k\x8e\x01,"}, + {"internal/oserror", "s"}, + {"internal/pkgbits", "\x03Q\x18\a\x03\x04\fs\r\x1f\r\n\x01"}, {"internal/platform", ""}, - {"internal/poll", "qj\x05\x159\r\x01\x01\f\x06"}, - {"internal/profile", "\x03\x04j\x03\x81\x017\n\x01\x01\x01\x10"}, + {"internal/poll", "sl\x05\x159\r\x01\x01\f\x06"}, + {"internal/profile", "\x03\x04l\x03\x83\x017\n\x01\x01\x01\x10"}, {"internal/profilerecord", ""}, - {"internal/race", "\x97\x01\xb8\x01"}, - {"internal/reflectlite", "\x97\x01!:\x16"}, - {"vendor/golang.org/x/text/unicode/norm", "j\n\x81\x01F\x12\x11"}, - {"weak", "\x97\x01\x97\x01!"}, + {"vendor/golang.org/x/crypto/internal/alias", "\xd3\x02"}, + {"vendor/golang.org/x/crypto/internal/poly1305", "W\x15\x9c\x01"}, + {"vendor/golang.org/x/net/dns/dnsmessage", "s\xc7\x01"}, + {"vendor/golang.org/x/net/http/httpguts", "\x8f\x02\x14\x1a\x14\r"}, + {"vendor/golang.org/x/net/http/httpproxy", "s\x03\x99\x01\x10\x05\x01\x18\x14\r"}, + {"vendor/golang.org/x/net/http2/hpack", "\x03p\x03\x83\x01F"}, + {"vendor/golang.org/x/net/idna", "v\x8f\x018\x14\x10\x02\x01"}, + {"vendor/golang.org/x/net/nettest", "\x03i\a\x03\x83\x01\x11\x05\x16\x01\f\n\x01\x02\x02\x01\v"}, + {"vendor/golang.org/x/sys/cpu", "\xa5\x02\r\n\x01\x16"}, + {"vendor/golang.org/x/text/secure/bidirule", "s\xde\x01\x11\x01"}, + {"vendor/golang.org/x/text/transform", "\x03p\x86\x01X"}, + {"vendor/golang.org/x/text/unicode/bidi", "\x03\bk\x87\x01>\x16"}, + {"vendor/golang.org/x/text/unicode/norm", "l\n\x83\x01F\x12\x11"}, + {"weak", "\x9a\x01\x98\x01!"}, } // bootstrap is the list of bootstrap packages extracted from cmd/dist. @@ -385,6 +389,7 @@ var bootstrap = map[string]bool{ "cmd/compile/internal/arm64": true, "cmd/compile/internal/base": true, "cmd/compile/internal/bitvec": true, + "cmd/compile/internal/bloop": true, "cmd/compile/internal/compare": true, "cmd/compile/internal/coverage": true, "cmd/compile/internal/deadlocals": true, @@ -413,6 +418,7 @@ var bootstrap = map[string]bool{ "cmd/compile/internal/riscv64": true, "cmd/compile/internal/rttype": true, "cmd/compile/internal/s390x": true, + "cmd/compile/internal/slice": true, "cmd/compile/internal/ssa": true, "cmd/compile/internal/ssagen": true, "cmd/compile/internal/staticdata": true, diff --git a/vendor/golang.org/x/tools/internal/stdlib/manifest.go b/vendor/golang.org/x/tools/internal/stdlib/manifest.go index 362f23c4..f1e24625 100644 --- a/vendor/golang.org/x/tools/internal/stdlib/manifest.go +++ b/vendor/golang.org/x/tools/internal/stdlib/manifest.go @@ -16,6 +16,14 @@ var PackageSymbols = map[string][]Symbol{ {"(*Writer).Flush", Method, 0, ""}, {"(*Writer).Write", Method, 0, ""}, {"(*Writer).WriteHeader", Method, 0, ""}, + {"(FileInfoNames).Gname", Method, 23, ""}, + {"(FileInfoNames).IsDir", Method, 23, ""}, + {"(FileInfoNames).ModTime", Method, 23, ""}, + {"(FileInfoNames).Mode", Method, 23, ""}, + {"(FileInfoNames).Name", Method, 23, ""}, + {"(FileInfoNames).Size", Method, 23, ""}, + {"(FileInfoNames).Sys", Method, 23, ""}, + {"(FileInfoNames).Uname", Method, 23, ""}, {"(Format).String", Method, 10, ""}, {"ErrFieldTooLong", Var, 0, ""}, {"ErrHeader", Var, 0, ""}, @@ -338,6 +346,9 @@ var PackageSymbols = map[string][]Symbol{ {"(*Writer).Write", Method, 0, ""}, {"(CorruptInputError).Error", Method, 0, ""}, {"(InternalError).Error", Method, 0, ""}, + {"(Reader).Read", Method, 0, ""}, + {"(Reader).ReadByte", Method, 0, ""}, + {"(Resetter).Reset", Method, 4, ""}, {"BestCompression", Const, 0, ""}, {"BestSpeed", Const, 0, ""}, {"CorruptInputError", Type, 0, ""}, @@ -409,6 +420,7 @@ var PackageSymbols = map[string][]Symbol{ {"(*Writer).Flush", Method, 0, ""}, {"(*Writer).Reset", Method, 2, ""}, {"(*Writer).Write", Method, 0, ""}, + {"(Resetter).Reset", Method, 4, ""}, {"BestCompression", Const, 0, ""}, {"BestSpeed", Const, 0, ""}, {"DefaultCompression", Const, 0, ""}, @@ -426,6 +438,11 @@ var PackageSymbols = map[string][]Symbol{ {"Writer", Type, 0, ""}, }, "container/heap": { + {"(Interface).Len", Method, 0, ""}, + {"(Interface).Less", Method, 0, ""}, + {"(Interface).Pop", Method, 0, ""}, + {"(Interface).Push", Method, 0, ""}, + {"(Interface).Swap", Method, 0, ""}, {"Fix", Func, 2, "func(h Interface, i int)"}, {"Init", Func, 0, "func(h Interface)"}, {"Interface", Type, 0, ""}, @@ -469,6 +486,10 @@ var PackageSymbols = map[string][]Symbol{ {"Ring.Value", Field, 0, ""}, }, "context": { + {"(Context).Deadline", Method, 7, ""}, + {"(Context).Done", Method, 7, ""}, + {"(Context).Err", Method, 7, ""}, + {"(Context).Value", Method, 7, ""}, {"AfterFunc", Func, 21, "func(ctx Context, f func()) (stop func() bool)"}, {"Background", Func, 7, "func() Context"}, {"CancelCauseFunc", Type, 20, ""}, @@ -488,17 +509,31 @@ var PackageSymbols = map[string][]Symbol{ {"WithoutCancel", Func, 21, "func(parent Context) Context"}, }, "crypto": { + {"(Decapsulator).Decapsulate", Method, 26, ""}, + {"(Decapsulator).Encapsulator", Method, 26, ""}, + {"(Decrypter).Decrypt", Method, 5, ""}, + {"(Decrypter).Public", Method, 5, ""}, + {"(Encapsulator).Bytes", Method, 26, ""}, + {"(Encapsulator).Encapsulate", Method, 26, ""}, {"(Hash).Available", Method, 0, ""}, {"(Hash).HashFunc", Method, 4, ""}, {"(Hash).New", Method, 0, ""}, {"(Hash).Size", Method, 0, ""}, {"(Hash).String", Method, 15, ""}, + {"(MessageSigner).Public", Method, 25, ""}, + {"(MessageSigner).Sign", Method, 25, ""}, + {"(MessageSigner).SignMessage", Method, 25, ""}, + {"(Signer).Public", Method, 4, ""}, + {"(Signer).Sign", Method, 4, ""}, + {"(SignerOpts).HashFunc", Method, 4, ""}, {"BLAKE2b_256", Const, 9, ""}, {"BLAKE2b_384", Const, 9, ""}, {"BLAKE2b_512", Const, 9, ""}, {"BLAKE2s_256", Const, 9, ""}, + {"Decapsulator", Type, 26, ""}, {"Decrypter", Type, 5, ""}, {"DecrypterOpts", Type, 5, ""}, + {"Encapsulator", Type, 26, ""}, {"Hash", Type, 0, ""}, {"MD4", Const, 0, ""}, {"MD5", Const, 0, ""}, @@ -530,6 +565,16 @@ var PackageSymbols = map[string][]Symbol{ {"NewCipher", Func, 0, "func(key []byte) (cipher.Block, error)"}, }, "crypto/cipher": { + {"(AEAD).NonceSize", Method, 2, ""}, + {"(AEAD).Open", Method, 2, ""}, + {"(AEAD).Overhead", Method, 2, ""}, + {"(AEAD).Seal", Method, 2, ""}, + {"(Block).BlockSize", Method, 0, ""}, + {"(Block).Decrypt", Method, 0, ""}, + {"(Block).Encrypt", Method, 0, ""}, + {"(BlockMode).BlockSize", Method, 0, ""}, + {"(BlockMode).CryptBlocks", Method, 0, ""}, + {"(Stream).XORKeyStream", Method, 0, ""}, {"(StreamReader).Read", Method, 0, ""}, {"(StreamWriter).Close", Method, 0, ""}, {"(StreamWriter).Write", Method, 0, ""}, @@ -594,7 +639,13 @@ var PackageSymbols = map[string][]Symbol{ {"(*PublicKey).Bytes", Method, 20, ""}, {"(*PublicKey).Curve", Method, 20, ""}, {"(*PublicKey).Equal", Method, 20, ""}, - {"Curve", Type, 20, ""}, + {"(Curve).GenerateKey", Method, 20, ""}, + {"(Curve).NewPrivateKey", Method, 20, ""}, + {"(Curve).NewPublicKey", Method, 20, ""}, + {"(KeyExchanger).Curve", Method, 26, ""}, + {"(KeyExchanger).ECDH", Method, 26, ""}, + {"(KeyExchanger).PublicKey", Method, 26, ""}, + {"KeyExchanger", Type, 26, ""}, {"P256", Func, 20, "func() Curve"}, {"P384", Func, 20, "func() Curve"}, {"P521", Func, 20, "func() Curve"}, @@ -667,6 +718,12 @@ var PackageSymbols = map[string][]Symbol{ {"(*CurveParams).Params", Method, 0, ""}, {"(*CurveParams).ScalarBaseMult", Method, 0, ""}, {"(*CurveParams).ScalarMult", Method, 0, ""}, + {"(Curve).Add", Method, 0, ""}, + {"(Curve).Double", Method, 0, ""}, + {"(Curve).IsOnCurve", Method, 0, ""}, + {"(Curve).Params", Method, 0, ""}, + {"(Curve).ScalarBaseMult", Method, 0, ""}, + {"(Curve).ScalarMult", Method, 0, ""}, {"Curve", Type, 0, ""}, {"CurveParams", Type, 0, ""}, {"CurveParams.B", Field, 0, ""}, @@ -688,6 +745,7 @@ var PackageSymbols = map[string][]Symbol{ }, "crypto/fips140": { {"Enabled", Func, 24, "func() bool"}, + {"Version", Func, 26, "func() string"}, }, "crypto/hkdf": { {"Expand", Func, 24, "func[H hash.Hash](h func() H, pseudorandomKey []byte, info string, keyLength int) ([]byte, error)"}, @@ -708,9 +766,11 @@ var PackageSymbols = map[string][]Symbol{ {"(*DecapsulationKey1024).Bytes", Method, 24, ""}, {"(*DecapsulationKey1024).Decapsulate", Method, 24, ""}, {"(*DecapsulationKey1024).EncapsulationKey", Method, 24, ""}, + {"(*DecapsulationKey1024).Encapsulator", Method, 26, ""}, {"(*DecapsulationKey768).Bytes", Method, 24, ""}, {"(*DecapsulationKey768).Decapsulate", Method, 24, ""}, {"(*DecapsulationKey768).EncapsulationKey", Method, 24, ""}, + {"(*DecapsulationKey768).Encapsulator", Method, 26, ""}, {"(*EncapsulationKey1024).Bytes", Method, 24, ""}, {"(*EncapsulationKey1024).Encapsulate", Method, 24, ""}, {"(*EncapsulationKey768).Bytes", Method, 24, ""}, @@ -732,6 +792,10 @@ var PackageSymbols = map[string][]Symbol{ {"SeedSize", Const, 24, ""}, {"SharedKeySize", Const, 24, ""}, }, + "crypto/mlkem/mlkemtest": { + {"Encapsulate1024", Func, 26, "func(ek *mlkem.EncapsulationKey1024, random []byte) (sharedKey []byte, ciphertext []byte, err error)"}, + {"Encapsulate768", Func, 26, "func(ek *mlkem.EncapsulationKey768, random []byte) (sharedKey []byte, ciphertext []byte, err error)"}, + }, "crypto/pbkdf2": { {"Key", Func, 24, "func[Hash hash.Hash](h func() Hash, password string, salt []byte, iter int, keyLength int) ([]byte, error)"}, }, @@ -769,6 +833,7 @@ var PackageSymbols = map[string][]Symbol{ {"DecryptPKCS1v15", Func, 0, "func(random io.Reader, priv *PrivateKey, ciphertext []byte) ([]byte, error)"}, {"DecryptPKCS1v15SessionKey", Func, 0, "func(random io.Reader, priv *PrivateKey, ciphertext []byte, key []byte) error"}, {"EncryptOAEP", Func, 0, "func(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, label []byte) ([]byte, error)"}, + {"EncryptOAEPWithOptions", Func, 26, "func(random io.Reader, pub *PublicKey, msg []byte, opts *OAEPOptions) ([]byte, error)"}, {"EncryptPKCS1v15", Func, 0, "func(random io.Reader, pub *PublicKey, msg []byte) ([]byte, error)"}, {"ErrDecryption", Var, 0, ""}, {"ErrMessageTooLong", Var, 0, ""}, @@ -921,6 +986,8 @@ var PackageSymbols = map[string][]Symbol{ {"(*SessionState).Bytes", Method, 21, ""}, {"(AlertError).Error", Method, 21, ""}, {"(ClientAuthType).String", Method, 15, ""}, + {"(ClientSessionCache).Get", Method, 3, ""}, + {"(ClientSessionCache).Put", Method, 3, ""}, {"(CurveID).String", Method, 15, ""}, {"(QUICEncryptionLevel).String", Method, 21, ""}, {"(RecordHeaderError).Error", Method, 6, ""}, @@ -953,6 +1020,7 @@ var PackageSymbols = map[string][]Symbol{ {"ClientHelloInfo.CipherSuites", Field, 4, ""}, {"ClientHelloInfo.Conn", Field, 8, ""}, {"ClientHelloInfo.Extensions", Field, 24, ""}, + {"ClientHelloInfo.HelloRetryRequest", Field, 26, ""}, {"ClientHelloInfo.ServerName", Field, 4, ""}, {"ClientHelloInfo.SignatureSchemes", Field, 8, ""}, {"ClientHelloInfo.SupportedCurves", Field, 4, ""}, @@ -1001,6 +1069,7 @@ var PackageSymbols = map[string][]Symbol{ {"ConnectionState.DidResume", Field, 1, ""}, {"ConnectionState.ECHAccepted", Field, 23, ""}, {"ConnectionState.HandshakeComplete", Field, 0, ""}, + {"ConnectionState.HelloRetryRequest", Field, 26, ""}, {"ConnectionState.NegotiatedProtocol", Field, 0, ""}, {"ConnectionState.NegotiatedProtocolIsMutual", Field, 0, ""}, {"ConnectionState.OCSPResponse", Field, 5, ""}, @@ -1055,8 +1124,10 @@ var PackageSymbols = map[string][]Symbol{ {"QUICEncryptionLevelEarly", Const, 21, ""}, {"QUICEncryptionLevelHandshake", Const, 21, ""}, {"QUICEncryptionLevelInitial", Const, 21, ""}, + {"QUICErrorEvent", Const, 26, ""}, {"QUICEvent", Type, 21, ""}, {"QUICEvent.Data", Field, 21, ""}, + {"QUICEvent.Err", Field, 26, ""}, {"QUICEvent.Kind", Field, 21, ""}, {"QUICEvent.Level", Field, 21, ""}, {"QUICEvent.SessionState", Field, 23, ""}, @@ -1151,8 +1222,10 @@ var PackageSymbols = map[string][]Symbol{ {"(*RevocationList).CheckSignatureFrom", Method, 19, ""}, {"(CertificateInvalidError).Error", Method, 0, ""}, {"(ConstraintViolationError).Error", Method, 0, ""}, + {"(ExtKeyUsage).String", Method, 26, ""}, {"(HostnameError).Error", Method, 0, ""}, {"(InsecureAlgorithmError).Error", Method, 6, ""}, + {"(KeyUsage).String", Method, 26, ""}, {"(OID).AppendBinary", Method, 24, ""}, {"(OID).AppendText", Method, 24, ""}, {"(OID).Equal", Method, 22, ""}, @@ -1516,6 +1589,9 @@ var PackageSymbols = map[string][]Symbol{ {"(NullInt64).Value", Method, 0, ""}, {"(NullString).Value", Method, 0, ""}, {"(NullTime).Value", Method, 13, ""}, + {"(Result).LastInsertId", Method, 0, ""}, + {"(Result).RowsAffected", Method, 0, ""}, + {"(Scanner).Scan", Method, 0, ""}, {"ColumnType", Type, 8, ""}, {"Conn", Type, 9, ""}, {"DB", Type, 0, ""}, @@ -1547,8 +1623,6 @@ var PackageSymbols = map[string][]Symbol{ {"NamedArg.Name", Field, 8, ""}, {"NamedArg.Value", Field, 8, ""}, {"Null", Type, 22, ""}, - {"Null.V", Field, 22, ""}, - {"Null.Valid", Field, 22, ""}, {"NullBool", Type, 0, ""}, {"NullBool.Bool", Field, 0, ""}, {"NullBool.Valid", Field, 0, ""}, @@ -1591,10 +1665,72 @@ var PackageSymbols = map[string][]Symbol{ {"TxOptions.ReadOnly", Field, 8, ""}, }, "database/sql/driver": { + {"(ColumnConverter).ColumnConverter", Method, 0, ""}, + {"(Conn).Begin", Method, 0, ""}, + {"(Conn).Close", Method, 0, ""}, + {"(Conn).Prepare", Method, 0, ""}, + {"(ConnBeginTx).BeginTx", Method, 8, ""}, + {"(ConnPrepareContext).PrepareContext", Method, 8, ""}, + {"(Connector).Connect", Method, 10, ""}, + {"(Connector).Driver", Method, 10, ""}, + {"(Driver).Open", Method, 0, ""}, + {"(DriverContext).OpenConnector", Method, 10, ""}, + {"(Execer).Exec", Method, 0, ""}, + {"(ExecerContext).ExecContext", Method, 8, ""}, + {"(NamedValueChecker).CheckNamedValue", Method, 9, ""}, {"(NotNull).ConvertValue", Method, 0, ""}, {"(Null).ConvertValue", Method, 0, ""}, + {"(Pinger).Ping", Method, 8, ""}, + {"(Queryer).Query", Method, 1, ""}, + {"(QueryerContext).QueryContext", Method, 8, ""}, + {"(Result).LastInsertId", Method, 0, ""}, + {"(Result).RowsAffected", Method, 0, ""}, + {"(Rows).Close", Method, 0, ""}, + {"(Rows).Columns", Method, 0, ""}, + {"(Rows).Next", Method, 0, ""}, {"(RowsAffected).LastInsertId", Method, 0, ""}, {"(RowsAffected).RowsAffected", Method, 0, ""}, + {"(RowsColumnScanner).Close", Method, 26, ""}, + {"(RowsColumnScanner).Columns", Method, 26, ""}, + {"(RowsColumnScanner).Next", Method, 26, ""}, + {"(RowsColumnScanner).ScanColumn", Method, 26, ""}, + {"(RowsColumnTypeDatabaseTypeName).Close", Method, 8, ""}, + {"(RowsColumnTypeDatabaseTypeName).ColumnTypeDatabaseTypeName", Method, 8, ""}, + {"(RowsColumnTypeDatabaseTypeName).Columns", Method, 8, ""}, + {"(RowsColumnTypeDatabaseTypeName).Next", Method, 8, ""}, + {"(RowsColumnTypeLength).Close", Method, 8, ""}, + {"(RowsColumnTypeLength).ColumnTypeLength", Method, 8, ""}, + {"(RowsColumnTypeLength).Columns", Method, 8, ""}, + {"(RowsColumnTypeLength).Next", Method, 8, ""}, + {"(RowsColumnTypeNullable).Close", Method, 8, ""}, + {"(RowsColumnTypeNullable).ColumnTypeNullable", Method, 8, ""}, + {"(RowsColumnTypeNullable).Columns", Method, 8, ""}, + {"(RowsColumnTypeNullable).Next", Method, 8, ""}, + {"(RowsColumnTypePrecisionScale).Close", Method, 8, ""}, + {"(RowsColumnTypePrecisionScale).ColumnTypePrecisionScale", Method, 8, ""}, + {"(RowsColumnTypePrecisionScale).Columns", Method, 8, ""}, + {"(RowsColumnTypePrecisionScale).Next", Method, 8, ""}, + {"(RowsColumnTypeScanType).Close", Method, 8, ""}, + {"(RowsColumnTypeScanType).ColumnTypeScanType", Method, 8, ""}, + {"(RowsColumnTypeScanType).Columns", Method, 8, ""}, + {"(RowsColumnTypeScanType).Next", Method, 8, ""}, + {"(RowsNextResultSet).Close", Method, 8, ""}, + {"(RowsNextResultSet).Columns", Method, 8, ""}, + {"(RowsNextResultSet).HasNextResultSet", Method, 8, ""}, + {"(RowsNextResultSet).Next", Method, 8, ""}, + {"(RowsNextResultSet).NextResultSet", Method, 8, ""}, + {"(SessionResetter).ResetSession", Method, 10, ""}, + {"(Stmt).Close", Method, 0, ""}, + {"(Stmt).Exec", Method, 0, ""}, + {"(Stmt).NumInput", Method, 0, ""}, + {"(Stmt).Query", Method, 0, ""}, + {"(StmtExecContext).ExecContext", Method, 8, ""}, + {"(StmtQueryContext).QueryContext", Method, 8, ""}, + {"(Tx).Commit", Method, 0, ""}, + {"(Tx).Rollback", Method, 0, ""}, + {"(Validator).IsValid", Method, 15, ""}, + {"(ValueConverter).ConvertValue", Method, 0, ""}, + {"(Valuer).Value", Method, 0, ""}, {"Bool", Var, 0, ""}, {"ColumnConverter", Type, 0, ""}, {"Conn", Type, 0, ""}, @@ -1756,6 +1892,9 @@ var PackageSymbols = map[string][]Symbol{ {"(DecodeError).Error", Method, 0, ""}, {"(Tag).GoString", Method, 0, ""}, {"(Tag).String", Method, 0, ""}, + {"(Type).Common", Method, 0, ""}, + {"(Type).Size", Method, 0, ""}, + {"(Type).String", Method, 0, ""}, {"AddrType", Type, 0, ""}, {"AddrType.BasicType", Field, 0, ""}, {"ArrayType", Type, 0, ""}, @@ -3163,6 +3302,7 @@ var PackageSymbols = map[string][]Symbol{ {"R_LARCH_B16", Const, 20, ""}, {"R_LARCH_B21", Const, 20, ""}, {"R_LARCH_B26", Const, 20, ""}, + {"R_LARCH_CALL36", Const, 26, ""}, {"R_LARCH_CFA", Const, 22, ""}, {"R_LARCH_COPY", Const, 19, ""}, {"R_LARCH_DELETE", Const, 22, ""}, @@ -3220,11 +3360,25 @@ var PackageSymbols = map[string][]Symbol{ {"R_LARCH_SUB64", Const, 19, ""}, {"R_LARCH_SUB8", Const, 19, ""}, {"R_LARCH_SUB_ULEB128", Const, 22, ""}, + {"R_LARCH_TLS_DESC32", Const, 26, ""}, + {"R_LARCH_TLS_DESC64", Const, 26, ""}, + {"R_LARCH_TLS_DESC64_HI12", Const, 26, ""}, + {"R_LARCH_TLS_DESC64_LO20", Const, 26, ""}, + {"R_LARCH_TLS_DESC64_PC_HI12", Const, 26, ""}, + {"R_LARCH_TLS_DESC64_PC_LO20", Const, 26, ""}, + {"R_LARCH_TLS_DESC_CALL", Const, 26, ""}, + {"R_LARCH_TLS_DESC_HI20", Const, 26, ""}, + {"R_LARCH_TLS_DESC_LD", Const, 26, ""}, + {"R_LARCH_TLS_DESC_LO12", Const, 26, ""}, + {"R_LARCH_TLS_DESC_PCREL20_S2", Const, 26, ""}, + {"R_LARCH_TLS_DESC_PC_HI20", Const, 26, ""}, + {"R_LARCH_TLS_DESC_PC_LO12", Const, 26, ""}, {"R_LARCH_TLS_DTPMOD32", Const, 19, ""}, {"R_LARCH_TLS_DTPMOD64", Const, 19, ""}, {"R_LARCH_TLS_DTPREL32", Const, 19, ""}, {"R_LARCH_TLS_DTPREL64", Const, 19, ""}, {"R_LARCH_TLS_GD_HI20", Const, 20, ""}, + {"R_LARCH_TLS_GD_PCREL20_S2", Const, 26, ""}, {"R_LARCH_TLS_GD_PC_HI20", Const, 20, ""}, {"R_LARCH_TLS_IE64_HI12", Const, 20, ""}, {"R_LARCH_TLS_IE64_LO20", Const, 20, ""}, @@ -3235,11 +3389,15 @@ var PackageSymbols = map[string][]Symbol{ {"R_LARCH_TLS_IE_PC_HI20", Const, 20, ""}, {"R_LARCH_TLS_IE_PC_LO12", Const, 20, ""}, {"R_LARCH_TLS_LD_HI20", Const, 20, ""}, + {"R_LARCH_TLS_LD_PCREL20_S2", Const, 26, ""}, {"R_LARCH_TLS_LD_PC_HI20", Const, 20, ""}, {"R_LARCH_TLS_LE64_HI12", Const, 20, ""}, {"R_LARCH_TLS_LE64_LO20", Const, 20, ""}, + {"R_LARCH_TLS_LE_ADD_R", Const, 26, ""}, {"R_LARCH_TLS_LE_HI20", Const, 20, ""}, + {"R_LARCH_TLS_LE_HI20_R", Const, 26, ""}, {"R_LARCH_TLS_LE_LO12", Const, 20, ""}, + {"R_LARCH_TLS_LE_LO12_R", Const, 26, ""}, {"R_LARCH_TLS_TPREL32", Const, 19, ""}, {"R_LARCH_TLS_TPREL64", Const, 19, ""}, {"R_MIPS", Type, 6, ""}, @@ -3944,6 +4102,7 @@ var PackageSymbols = map[string][]Symbol{ {"(FatArch).ImportedSymbols", Method, 3, ""}, {"(FatArch).Section", Method, 3, ""}, {"(FatArch).Segment", Method, 3, ""}, + {"(Load).Raw", Method, 0, ""}, {"(LoadBytes).Raw", Method, 0, ""}, {"(LoadCmd).GoString", Method, 0, ""}, {"(LoadCmd).String", Method, 0, ""}, @@ -4590,6 +4749,12 @@ var PackageSymbols = map[string][]Symbol{ {"FS", Type, 16, ""}, }, "encoding": { + {"(BinaryAppender).AppendBinary", Method, 24, ""}, + {"(BinaryMarshaler).MarshalBinary", Method, 2, ""}, + {"(BinaryUnmarshaler).UnmarshalBinary", Method, 2, ""}, + {"(TextAppender).AppendText", Method, 24, ""}, + {"(TextMarshaler).MarshalText", Method, 2, ""}, + {"(TextUnmarshaler).UnmarshalText", Method, 2, ""}, {"BinaryAppender", Type, 24, ""}, {"BinaryMarshaler", Type, 2, ""}, {"BinaryUnmarshaler", Type, 2, ""}, @@ -4705,6 +4870,17 @@ var PackageSymbols = map[string][]Symbol{ {"URLEncoding", Var, 0, ""}, }, "encoding/binary": { + {"(AppendByteOrder).AppendUint16", Method, 19, ""}, + {"(AppendByteOrder).AppendUint32", Method, 19, ""}, + {"(AppendByteOrder).AppendUint64", Method, 19, ""}, + {"(AppendByteOrder).String", Method, 19, ""}, + {"(ByteOrder).PutUint16", Method, 0, ""}, + {"(ByteOrder).PutUint32", Method, 0, ""}, + {"(ByteOrder).PutUint64", Method, 0, ""}, + {"(ByteOrder).String", Method, 0, ""}, + {"(ByteOrder).Uint16", Method, 0, ""}, + {"(ByteOrder).Uint32", Method, 0, ""}, + {"(ByteOrder).Uint64", Method, 0, ""}, {"Append", Func, 23, "func(buf []byte, order ByteOrder, data any) ([]byte, error)"}, {"AppendByteOrder", Type, 19, ""}, {"AppendUvarint", Func, 19, "func(buf []byte, x uint64) []byte"}, @@ -4767,6 +4943,8 @@ var PackageSymbols = map[string][]Symbol{ {"(*Decoder).DecodeValue", Method, 0, ""}, {"(*Encoder).Encode", Method, 0, ""}, {"(*Encoder).EncodeValue", Method, 0, ""}, + {"(GobDecoder).GobDecode", Method, 0, ""}, + {"(GobEncoder).GobEncode", Method, 0, ""}, {"CommonType", Type, 0, ""}, {"CommonType.Id", Field, 0, ""}, {"CommonType.Name", Field, 0, ""}, @@ -4819,10 +4997,12 @@ var PackageSymbols = map[string][]Symbol{ {"(*UnsupportedTypeError).Error", Method, 0, ""}, {"(*UnsupportedValueError).Error", Method, 0, ""}, {"(Delim).String", Method, 5, ""}, + {"(Marshaler).MarshalJSON", Method, 0, ""}, {"(Number).Float64", Method, 1, ""}, {"(Number).Int64", Method, 1, ""}, {"(Number).String", Method, 1, ""}, {"(RawMessage).MarshalJSON", Method, 8, ""}, + {"(Unmarshaler).UnmarshalJSON", Method, 0, ""}, {"Compact", Func, 0, "func(dst *bytes.Buffer, src []byte) error"}, {"Decoder", Type, 0, ""}, {"Delim", Type, 5, ""}, @@ -4894,10 +5074,15 @@ var PackageSymbols = map[string][]Symbol{ {"(CharData).Copy", Method, 0, ""}, {"(Comment).Copy", Method, 0, ""}, {"(Directive).Copy", Method, 0, ""}, + {"(Marshaler).MarshalXML", Method, 2, ""}, + {"(MarshalerAttr).MarshalXMLAttr", Method, 2, ""}, {"(ProcInst).Copy", Method, 0, ""}, {"(StartElement).Copy", Method, 0, ""}, {"(StartElement).End", Method, 2, ""}, + {"(TokenReader).Token", Method, 10, ""}, {"(UnmarshalError).Error", Method, 0, ""}, + {"(Unmarshaler).UnmarshalXML", Method, 2, ""}, + {"(UnmarshalerAttr).UnmarshalXMLAttr", Method, 2, ""}, {"Attr", Type, 0, ""}, {"Attr.Name", Field, 0, ""}, {"Attr.Value", Field, 0, ""}, @@ -4984,6 +5169,7 @@ var PackageSymbols = map[string][]Symbol{ {"(*String).Value", Method, 8, ""}, {"(Func).String", Method, 0, ""}, {"(Func).Value", Method, 8, ""}, + {"(Var).String", Method, 0, ""}, {"Do", Func, 0, "func(f func(KeyValue))"}, {"Float", Type, 0, ""}, {"Func", Type, 0, ""}, @@ -5039,6 +5225,11 @@ var PackageSymbols = map[string][]Symbol{ {"(*FlagSet).Var", Method, 0, ""}, {"(*FlagSet).Visit", Method, 0, ""}, {"(*FlagSet).VisitAll", Method, 0, ""}, + {"(Getter).Get", Method, 2, ""}, + {"(Getter).Set", Method, 2, ""}, + {"(Getter).String", Method, 2, ""}, + {"(Value).Set", Method, 0, ""}, + {"(Value).String", Method, 0, ""}, {"Arg", Func, 0, "func(i int) string"}, {"Args", Func, 0, "func() []string"}, {"Bool", Func, 0, "func(name string, value bool, usage string) *bool"}, @@ -5090,6 +5281,20 @@ var PackageSymbols = map[string][]Symbol{ {"VisitAll", Func, 0, "func(fn func(*Flag))"}, }, "fmt": { + {"(Formatter).Format", Method, 0, ""}, + {"(GoStringer).GoString", Method, 0, ""}, + {"(ScanState).Read", Method, 0, ""}, + {"(ScanState).ReadRune", Method, 0, ""}, + {"(ScanState).SkipSpace", Method, 0, ""}, + {"(ScanState).Token", Method, 0, ""}, + {"(ScanState).UnreadRune", Method, 0, ""}, + {"(ScanState).Width", Method, 0, ""}, + {"(Scanner).Scan", Method, 0, ""}, + {"(State).Flag", Method, 0, ""}, + {"(State).Precision", Method, 0, ""}, + {"(State).Width", Method, 0, ""}, + {"(State).Write", Method, 0, ""}, + {"(Stringer).String", Method, 0, ""}, {"Append", Func, 19, "func(b []byte, a ...any) []byte"}, {"Appendf", Func, 19, "func(b []byte, format string, a ...any) []byte"}, {"Appendln", Func, 19, "func(b []byte, a ...any) []byte"}, @@ -5248,7 +5453,18 @@ var PackageSymbols = map[string][]Symbol{ {"(CommentMap).Filter", Method, 1, ""}, {"(CommentMap).String", Method, 1, ""}, {"(CommentMap).Update", Method, 1, ""}, + {"(Decl).End", Method, 0, ""}, + {"(Decl).Pos", Method, 0, ""}, + {"(Expr).End", Method, 0, ""}, + {"(Expr).Pos", Method, 0, ""}, + {"(Node).End", Method, 0, ""}, + {"(Node).Pos", Method, 0, ""}, {"(ObjKind).String", Method, 0, ""}, + {"(Spec).End", Method, 0, ""}, + {"(Spec).Pos", Method, 0, ""}, + {"(Stmt).End", Method, 0, ""}, + {"(Stmt).Pos", Method, 0, ""}, + {"(Visitor).Visit", Method, 0, ""}, {"ArrayType", Type, 0, ""}, {"ArrayType.Elt", Field, 0, ""}, {"ArrayType.Lbrack", Field, 0, ""}, @@ -5271,6 +5487,7 @@ var PackageSymbols = map[string][]Symbol{ {"BasicLit", Type, 0, ""}, {"BasicLit.Kind", Field, 0, ""}, {"BasicLit.Value", Field, 0, ""}, + {"BasicLit.ValueEnd", Field, 26, ""}, {"BasicLit.ValuePos", Field, 0, ""}, {"BinaryExpr", Type, 0, ""}, {"BinaryExpr.Op", Field, 0, ""}, @@ -5320,7 +5537,6 @@ var PackageSymbols = map[string][]Symbol{ {"CompositeLit.Rbrace", Field, 0, ""}, {"CompositeLit.Type", Field, 0, ""}, {"Con", Const, 0, ""}, - {"Decl", Type, 0, ""}, {"DeclStmt", Type, 0, ""}, {"DeclStmt.Decl", Field, 0, ""}, {"DeferStmt", Type, 0, ""}, @@ -5341,7 +5557,6 @@ var PackageSymbols = map[string][]Symbol{ {"EmptyStmt", Type, 0, ""}, {"EmptyStmt.Implicit", Field, 5, ""}, {"EmptyStmt.Semicolon", Field, 0, ""}, - {"Expr", Type, 0, ""}, {"ExprStmt", Type, 0, ""}, {"ExprStmt.X", Field, 0, ""}, {"Field", Type, 0, ""}, @@ -5525,11 +5740,9 @@ var PackageSymbols = map[string][]Symbol{ {"SliceExpr.Slice3", Field, 2, ""}, {"SliceExpr.X", Field, 0, ""}, {"SortImports", Func, 0, "func(fset *token.FileSet, f *File)"}, - {"Spec", Type, 0, ""}, {"StarExpr", Type, 0, ""}, {"StarExpr.Star", Field, 0, ""}, {"StarExpr.X", Field, 0, ""}, - {"Stmt", Type, 0, ""}, {"StructType", Type, 0, ""}, {"StructType.Fields", Field, 0, ""}, {"StructType.Incomplete", Field, 0, ""}, @@ -5684,10 +5897,11 @@ var PackageSymbols = map[string][]Symbol{ {"(*SyntaxError).Error", Method, 16, ""}, {"(*TagExpr).Eval", Method, 16, ""}, {"(*TagExpr).String", Method, 16, ""}, + {"(Expr).Eval", Method, 16, ""}, + {"(Expr).String", Method, 16, ""}, {"AndExpr", Type, 16, ""}, {"AndExpr.X", Field, 16, ""}, {"AndExpr.Y", Field, 16, ""}, - {"Expr", Type, 16, ""}, {"GoVersion", Func, 21, "func(x Expr) string"}, {"IsGoBuild", Func, 16, "func(line string) bool"}, {"IsPlusBuild", Func, 16, "func(line string) bool"}, @@ -5706,6 +5920,9 @@ var PackageSymbols = map[string][]Symbol{ }, "go/constant": { {"(Kind).String", Method, 18, ""}, + {"(Value).ExactString", Method, 6, ""}, + {"(Value).Kind", Method, 5, ""}, + {"(Value).String", Method, 5, ""}, {"BinaryOp", Func, 5, "func(x_ Value, op token.Token, y_ Value) Value"}, {"BitLen", Func, 5, "func(x Value) int"}, {"Bool", Const, 5, ""}, @@ -5744,7 +5961,6 @@ var PackageSymbols = map[string][]Symbol{ {"UnaryOp", Func, 5, "func(op token.Token, y Value, prec uint) Value"}, {"Unknown", Const, 5, ""}, {"Val", Func, 13, "func(x Value) any"}, - {"Value", Type, 5, ""}, }, "go/doc": { {"(*Package).Filter", Method, 0, ""}, @@ -5828,7 +6044,6 @@ var PackageSymbols = map[string][]Symbol{ {"(*Printer).HTML", Method, 19, ""}, {"(*Printer).Markdown", Method, 19, ""}, {"(*Printer).Text", Method, 19, ""}, - {"Block", Type, 19, ""}, {"Code", Type, 19, ""}, {"Code.Text", Field, 19, ""}, {"DefaultLookupPackage", Func, 19, "func(name string) (importPath string, ok bool)"}, @@ -5873,7 +6088,6 @@ var PackageSymbols = map[string][]Symbol{ {"Printer.TextCodePrefix", Field, 19, ""}, {"Printer.TextPrefix", Field, 19, ""}, {"Printer.TextWidth", Field, 19, ""}, - {"Text", Type, 19, ""}, }, "go/format": { {"Node", Func, 1, "func(dst io.Writer, fset *token.FileSet, node any) error"}, @@ -5945,6 +6159,7 @@ var PackageSymbols = map[string][]Symbol{ {"(*File).AddLineColumnInfo", Method, 11, ""}, {"(*File).AddLineInfo", Method, 0, ""}, {"(*File).Base", Method, 0, ""}, + {"(*File).End", Method, 26, ""}, {"(*File).Line", Method, 0, ""}, {"(*File).LineCount", Method, 0, ""}, {"(*File).LineStart", Method, 12, ""}, @@ -6307,6 +6522,22 @@ var PackageSymbols = map[string][]Symbol{ {"(Checker).PkgNameOf", Method, 22, ""}, {"(Checker).TypeOf", Method, 5, ""}, {"(Error).Error", Method, 5, ""}, + {"(Importer).Import", Method, 5, ""}, + {"(ImporterFrom).Import", Method, 6, ""}, + {"(ImporterFrom).ImportFrom", Method, 6, ""}, + {"(Object).Exported", Method, 5, ""}, + {"(Object).Id", Method, 5, ""}, + {"(Object).Name", Method, 5, ""}, + {"(Object).Parent", Method, 5, ""}, + {"(Object).Pkg", Method, 5, ""}, + {"(Object).Pos", Method, 5, ""}, + {"(Object).String", Method, 5, ""}, + {"(Object).Type", Method, 5, ""}, + {"(Sizes).Alignof", Method, 5, ""}, + {"(Sizes).Offsetsof", Method, 5, ""}, + {"(Sizes).Sizeof", Method, 5, ""}, + {"(Type).String", Method, 5, ""}, + {"(Type).Underlying", Method, 5, ""}, {"(TypeAndValue).Addressable", Method, 5, ""}, {"(TypeAndValue).Assignable", Method, 5, ""}, {"(TypeAndValue).HasOk", Method, 5, ""}, @@ -6445,7 +6676,6 @@ var PackageSymbols = map[string][]Symbol{ {"NewUnion", Func, 18, "func(terms []*Term) *Union"}, {"NewVar", Func, 5, "func(pos token.Pos, pkg *Package, name string, typ Type) *Var"}, {"Nil", Type, 5, ""}, - {"Object", Type, 5, ""}, {"ObjectString", Func, 5, "func(obj Object, qf Qualifier) string"}, {"Package", Type, 5, ""}, {"PackageVar", Const, 25, ""}, @@ -6516,6 +6746,33 @@ var PackageSymbols = map[string][]Symbol{ {"Lang", Func, 22, "func(x string) string"}, }, "hash": { + {"(Cloner).BlockSize", Method, 25, ""}, + {"(Cloner).Clone", Method, 25, ""}, + {"(Cloner).Reset", Method, 25, ""}, + {"(Cloner).Size", Method, 25, ""}, + {"(Cloner).Sum", Method, 25, ""}, + {"(Cloner).Write", Method, 25, ""}, + {"(Hash).BlockSize", Method, 0, ""}, + {"(Hash).Reset", Method, 0, ""}, + {"(Hash).Size", Method, 0, ""}, + {"(Hash).Sum", Method, 0, ""}, + {"(Hash).Write", Method, 0, ""}, + {"(Hash32).BlockSize", Method, 0, ""}, + {"(Hash32).Reset", Method, 0, ""}, + {"(Hash32).Size", Method, 0, ""}, + {"(Hash32).Sum", Method, 0, ""}, + {"(Hash32).Sum32", Method, 0, ""}, + {"(Hash32).Write", Method, 0, ""}, + {"(Hash64).BlockSize", Method, 0, ""}, + {"(Hash64).Reset", Method, 0, ""}, + {"(Hash64).Size", Method, 0, ""}, + {"(Hash64).Sum", Method, 0, ""}, + {"(Hash64).Sum64", Method, 0, ""}, + {"(Hash64).Write", Method, 0, ""}, + {"(XOF).BlockSize", Method, 25, ""}, + {"(XOF).Read", Method, 25, ""}, + {"(XOF).Reset", Method, 25, ""}, + {"(XOF).Write", Method, 25, ""}, {"Cloner", Type, 25, ""}, {"Hash", Type, 0, ""}, {"Hash32", Type, 0, ""}, @@ -6781,6 +7038,13 @@ var PackageSymbols = map[string][]Symbol{ {"(*YCbCr).SubImage", Method, 0, ""}, {"(*YCbCr).YCbCrAt", Method, 4, ""}, {"(*YCbCr).YOffset", Method, 0, ""}, + {"(Image).At", Method, 0, ""}, + {"(Image).Bounds", Method, 0, ""}, + {"(Image).ColorModel", Method, 0, ""}, + {"(PalettedImage).At", Method, 0, ""}, + {"(PalettedImage).Bounds", Method, 0, ""}, + {"(PalettedImage).ColorIndexAt", Method, 0, ""}, + {"(PalettedImage).ColorModel", Method, 0, ""}, {"(Point).Add", Method, 0, ""}, {"(Point).Div", Method, 0, ""}, {"(Point).Eq", Method, 0, ""}, @@ -6789,6 +7053,10 @@ var PackageSymbols = map[string][]Symbol{ {"(Point).Mul", Method, 0, ""}, {"(Point).String", Method, 0, ""}, {"(Point).Sub", Method, 0, ""}, + {"(RGBA64Image).At", Method, 17, ""}, + {"(RGBA64Image).Bounds", Method, 17, ""}, + {"(RGBA64Image).ColorModel", Method, 17, ""}, + {"(RGBA64Image).RGBA64At", Method, 17, ""}, {"(Rectangle).Add", Method, 0, ""}, {"(Rectangle).At", Method, 5, ""}, {"(Rectangle).Bounds", Method, 5, ""}, @@ -6913,8 +7181,10 @@ var PackageSymbols = map[string][]Symbol{ {"(Alpha).RGBA", Method, 0, ""}, {"(Alpha16).RGBA", Method, 0, ""}, {"(CMYK).RGBA", Method, 5, ""}, + {"(Color).RGBA", Method, 0, ""}, {"(Gray).RGBA", Method, 0, ""}, {"(Gray16).RGBA", Method, 0, ""}, + {"(Model).Convert", Method, 0, ""}, {"(NRGBA).RGBA", Method, 0, ""}, {"(NRGBA64).RGBA", Method, 0, ""}, {"(NYCbCrA).RGBA", Method, 6, ""}, @@ -6992,7 +7262,19 @@ var PackageSymbols = map[string][]Symbol{ {"WebSafe", Var, 2, ""}, }, "image/draw": { + {"(Drawer).Draw", Method, 2, ""}, + {"(Image).At", Method, 0, ""}, + {"(Image).Bounds", Method, 0, ""}, + {"(Image).ColorModel", Method, 0, ""}, + {"(Image).Set", Method, 0, ""}, {"(Op).Draw", Method, 2, ""}, + {"(Quantizer).Quantize", Method, 2, ""}, + {"(RGBA64Image).At", Method, 17, ""}, + {"(RGBA64Image).Bounds", Method, 17, ""}, + {"(RGBA64Image).ColorModel", Method, 17, ""}, + {"(RGBA64Image).RGBA64At", Method, 17, ""}, + {"(RGBA64Image).Set", Method, 17, ""}, + {"(RGBA64Image).SetRGBA64", Method, 17, ""}, {"Draw", Func, 0, "func(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op)"}, {"DrawMask", Func, 0, "func(dst Image, r image.Rectangle, src image.Image, sp image.Point, mask image.Image, mp image.Point, op Op)"}, {"Drawer", Type, 2, ""}, @@ -7027,6 +7309,8 @@ var PackageSymbols = map[string][]Symbol{ }, "image/jpeg": { {"(FormatError).Error", Method, 0, ""}, + {"(Reader).Read", Method, 0, ""}, + {"(Reader).ReadByte", Method, 0, ""}, {"(UnsupportedError).Error", Method, 0, ""}, {"Decode", Func, 0, "func(r io.Reader) (image.Image, error)"}, {"DecodeConfig", Func, 0, "func(r io.Reader) (image.Config, error)"}, @@ -7040,6 +7324,8 @@ var PackageSymbols = map[string][]Symbol{ }, "image/png": { {"(*Encoder).Encode", Method, 4, ""}, + {"(EncoderBufferPool).Get", Method, 9, ""}, + {"(EncoderBufferPool).Put", Method, 9, ""}, {"(FormatError).Error", Method, 0, ""}, {"(UnsupportedError).Error", Method, 0, ""}, {"BestCompression", Const, 4, ""}, @@ -7083,6 +7369,41 @@ var PackageSymbols = map[string][]Symbol{ {"(*SectionReader).ReadAt", Method, 0, ""}, {"(*SectionReader).Seek", Method, 0, ""}, {"(*SectionReader).Size", Method, 0, ""}, + {"(ByteReader).ReadByte", Method, 0, ""}, + {"(ByteScanner).ReadByte", Method, 0, ""}, + {"(ByteScanner).UnreadByte", Method, 0, ""}, + {"(ByteWriter).WriteByte", Method, 1, ""}, + {"(Closer).Close", Method, 0, ""}, + {"(ReadCloser).Close", Method, 0, ""}, + {"(ReadCloser).Read", Method, 0, ""}, + {"(ReadSeekCloser).Close", Method, 16, ""}, + {"(ReadSeekCloser).Read", Method, 16, ""}, + {"(ReadSeekCloser).Seek", Method, 16, ""}, + {"(ReadSeeker).Read", Method, 0, ""}, + {"(ReadSeeker).Seek", Method, 0, ""}, + {"(ReadWriteCloser).Close", Method, 0, ""}, + {"(ReadWriteCloser).Read", Method, 0, ""}, + {"(ReadWriteCloser).Write", Method, 0, ""}, + {"(ReadWriteSeeker).Read", Method, 0, ""}, + {"(ReadWriteSeeker).Seek", Method, 0, ""}, + {"(ReadWriteSeeker).Write", Method, 0, ""}, + {"(ReadWriter).Read", Method, 0, ""}, + {"(ReadWriter).Write", Method, 0, ""}, + {"(Reader).Read", Method, 0, ""}, + {"(ReaderAt).ReadAt", Method, 0, ""}, + {"(ReaderFrom).ReadFrom", Method, 0, ""}, + {"(RuneReader).ReadRune", Method, 0, ""}, + {"(RuneScanner).ReadRune", Method, 0, ""}, + {"(RuneScanner).UnreadRune", Method, 0, ""}, + {"(Seeker).Seek", Method, 0, ""}, + {"(StringWriter).WriteString", Method, 12, ""}, + {"(WriteCloser).Close", Method, 0, ""}, + {"(WriteCloser).Write", Method, 0, ""}, + {"(WriteSeeker).Seek", Method, 0, ""}, + {"(WriteSeeker).Write", Method, 0, ""}, + {"(Writer).Write", Method, 0, ""}, + {"(WriterAt).WriteAt", Method, 0, ""}, + {"(WriterTo).WriteTo", Method, 0, ""}, {"ByteReader", Type, 0, ""}, {"ByteScanner", Type, 0, ""}, {"ByteWriter", Type, 1, ""}, @@ -7142,11 +7463,42 @@ var PackageSymbols = map[string][]Symbol{ {"(*PathError).Error", Method, 16, ""}, {"(*PathError).Timeout", Method, 16, ""}, {"(*PathError).Unwrap", Method, 16, ""}, + {"(DirEntry).Info", Method, 16, ""}, + {"(DirEntry).IsDir", Method, 16, ""}, + {"(DirEntry).Name", Method, 16, ""}, + {"(DirEntry).Type", Method, 16, ""}, + {"(FS).Open", Method, 16, ""}, + {"(File).Close", Method, 16, ""}, + {"(File).Read", Method, 16, ""}, + {"(File).Stat", Method, 16, ""}, + {"(FileInfo).IsDir", Method, 16, ""}, + {"(FileInfo).ModTime", Method, 16, ""}, + {"(FileInfo).Mode", Method, 16, ""}, + {"(FileInfo).Name", Method, 16, ""}, + {"(FileInfo).Size", Method, 16, ""}, + {"(FileInfo).Sys", Method, 16, ""}, {"(FileMode).IsDir", Method, 16, ""}, {"(FileMode).IsRegular", Method, 16, ""}, {"(FileMode).Perm", Method, 16, ""}, {"(FileMode).String", Method, 16, ""}, {"(FileMode).Type", Method, 16, ""}, + {"(GlobFS).Glob", Method, 16, ""}, + {"(GlobFS).Open", Method, 16, ""}, + {"(ReadDirFS).Open", Method, 16, ""}, + {"(ReadDirFS).ReadDir", Method, 16, ""}, + {"(ReadDirFile).Close", Method, 16, ""}, + {"(ReadDirFile).Read", Method, 16, ""}, + {"(ReadDirFile).ReadDir", Method, 16, ""}, + {"(ReadDirFile).Stat", Method, 16, ""}, + {"(ReadFileFS).Open", Method, 16, ""}, + {"(ReadFileFS).ReadFile", Method, 16, ""}, + {"(ReadLinkFS).Lstat", Method, 25, ""}, + {"(ReadLinkFS).Open", Method, 25, ""}, + {"(ReadLinkFS).ReadLink", Method, 25, ""}, + {"(StatFS).Open", Method, 16, ""}, + {"(StatFS).Stat", Method, 16, ""}, + {"(SubFS).Open", Method, 16, ""}, + {"(SubFS).Sub", Method, 16, ""}, {"DirEntry", Type, 16, ""}, {"ErrClosed", Var, 16, ""}, {"ErrExist", Var, 16, ""}, @@ -7299,12 +7651,18 @@ var PackageSymbols = map[string][]Symbol{ {"(*TextHandler).WithGroup", Method, 21, ""}, {"(Attr).Equal", Method, 21, ""}, {"(Attr).String", Method, 21, ""}, + {"(Handler).Enabled", Method, 21, ""}, + {"(Handler).Handle", Method, 21, ""}, + {"(Handler).WithAttrs", Method, 21, ""}, + {"(Handler).WithGroup", Method, 21, ""}, {"(Kind).String", Method, 21, ""}, {"(Level).AppendText", Method, 24, ""}, {"(Level).Level", Method, 21, ""}, {"(Level).MarshalJSON", Method, 21, ""}, {"(Level).MarshalText", Method, 21, ""}, {"(Level).String", Method, 21, ""}, + {"(Leveler).Level", Method, 21, ""}, + {"(LogValuer).LogValue", Method, 21, ""}, {"(Record).Attrs", Method, 21, ""}, {"(Record).Clone", Method, 21, ""}, {"(Record).NumAttrs", Method, 21, ""}, @@ -7833,6 +8191,11 @@ var PackageSymbols = map[string][]Symbol{ {"(*Rand).Uint32", Method, 0, ""}, {"(*Rand).Uint64", Method, 8, ""}, {"(*Zipf).Uint64", Method, 0, ""}, + {"(Source).Int63", Method, 0, ""}, + {"(Source).Seed", Method, 0, ""}, + {"(Source64).Int63", Method, 8, ""}, + {"(Source64).Seed", Method, 8, ""}, + {"(Source64).Uint64", Method, 8, ""}, {"ExpFloat64", Func, 0, "func() float64"}, {"Float32", Func, 0, "func() float32"}, {"Float64", Func, 0, "func() float64"}, @@ -7888,6 +8251,7 @@ var PackageSymbols = map[string][]Symbol{ {"(*Rand).Uint64N", Method, 22, ""}, {"(*Rand).UintN", Method, 22, ""}, {"(*Zipf).Uint64", Method, 22, ""}, + {"(Source).Uint64", Method, 22, ""}, {"ChaCha8", Type, 22, ""}, {"ExpFloat64", Func, 22, "func() float64"}, {"Float32", Func, 22, "func() float32"}, @@ -7951,6 +8315,10 @@ var PackageSymbols = map[string][]Symbol{ {"(*Writer).FormDataContentType", Method, 0, ""}, {"(*Writer).SetBoundary", Method, 1, ""}, {"(*Writer).WriteField", Method, 0, ""}, + {"(File).Close", Method, 0, ""}, + {"(File).Read", Method, 0, ""}, + {"(File).ReadAt", Method, 0, ""}, + {"(File).Seek", Method, 0, ""}, {"ErrMessageTooLarge", Var, 9, ""}, {"File", Type, 0, ""}, {"FileContentDisposition", Func, 25, "func(fieldname string, filename string) string"}, @@ -8135,6 +8503,19 @@ var PackageSymbols = map[string][]Symbol{ {"(*UnixListener).SetDeadline", Method, 0, ""}, {"(*UnixListener).SetUnlinkOnClose", Method, 8, ""}, {"(*UnixListener).SyscallConn", Method, 10, ""}, + {"(Addr).Network", Method, 0, ""}, + {"(Addr).String", Method, 0, ""}, + {"(Conn).Close", Method, 0, ""}, + {"(Conn).LocalAddr", Method, 0, ""}, + {"(Conn).Read", Method, 0, ""}, + {"(Conn).RemoteAddr", Method, 0, ""}, + {"(Conn).SetDeadline", Method, 0, ""}, + {"(Conn).SetReadDeadline", Method, 0, ""}, + {"(Conn).SetWriteDeadline", Method, 0, ""}, + {"(Conn).Write", Method, 0, ""}, + {"(Error).Error", Method, 0, ""}, + {"(Error).Temporary", Method, 0, ""}, + {"(Error).Timeout", Method, 0, ""}, {"(Flags).String", Method, 0, ""}, {"(HardwareAddr).String", Method, 0, ""}, {"(IP).AppendText", Method, 24, ""}, @@ -8158,6 +8539,16 @@ var PackageSymbols = map[string][]Symbol{ {"(InvalidAddrError).Error", Method, 0, ""}, {"(InvalidAddrError).Temporary", Method, 0, ""}, {"(InvalidAddrError).Timeout", Method, 0, ""}, + {"(Listener).Accept", Method, 0, ""}, + {"(Listener).Addr", Method, 0, ""}, + {"(Listener).Close", Method, 0, ""}, + {"(PacketConn).Close", Method, 0, ""}, + {"(PacketConn).LocalAddr", Method, 0, ""}, + {"(PacketConn).ReadFrom", Method, 0, ""}, + {"(PacketConn).SetDeadline", Method, 0, ""}, + {"(PacketConn).SetReadDeadline", Method, 0, ""}, + {"(PacketConn).SetWriteDeadline", Method, 0, ""}, + {"(PacketConn).WriteTo", Method, 0, ""}, {"(UnknownNetworkError).Error", Method, 0, ""}, {"(UnknownNetworkError).Temporary", Method, 0, ""}, {"(UnknownNetworkError).Timeout", Method, 0, ""}, @@ -8333,6 +8724,14 @@ var PackageSymbols = map[string][]Symbol{ {"(*Client).Head", Method, 0, ""}, {"(*Client).Post", Method, 0, ""}, {"(*Client).PostForm", Method, 0, ""}, + {"(*ClientConn).Available", Method, 26, ""}, + {"(*ClientConn).Close", Method, 26, ""}, + {"(*ClientConn).Err", Method, 26, ""}, + {"(*ClientConn).InFlight", Method, 26, ""}, + {"(*ClientConn).Release", Method, 26, ""}, + {"(*ClientConn).Reserve", Method, 26, ""}, + {"(*ClientConn).RoundTrip", Method, 26, ""}, + {"(*ClientConn).SetStateHook", Method, 26, ""}, {"(*Cookie).String", Method, 0, ""}, {"(*Cookie).Valid", Method, 18, ""}, {"(*CrossOriginProtection).AddInsecureBypassPattern", Method, 25, ""}, @@ -8392,10 +8791,22 @@ var PackageSymbols = map[string][]Symbol{ {"(*Transport).CancelRequest", Method, 1, ""}, {"(*Transport).Clone", Method, 13, ""}, {"(*Transport).CloseIdleConnections", Method, 0, ""}, + {"(*Transport).NewClientConn", Method, 26, ""}, {"(*Transport).RegisterProtocol", Method, 0, ""}, {"(*Transport).RoundTrip", Method, 0, ""}, + {"(CloseNotifier).CloseNotify", Method, 1, ""}, {"(ConnState).String", Method, 3, ""}, + {"(CookieJar).Cookies", Method, 0, ""}, + {"(CookieJar).SetCookies", Method, 0, ""}, {"(Dir).Open", Method, 0, ""}, + {"(File).Close", Method, 0, ""}, + {"(File).Read", Method, 0, ""}, + {"(File).Readdir", Method, 0, ""}, + {"(File).Seek", Method, 0, ""}, + {"(File).Stat", Method, 0, ""}, + {"(FileSystem).Open", Method, 0, ""}, + {"(Flusher).Flush", Method, 0, ""}, + {"(Handler).ServeHTTP", Method, 0, ""}, {"(HandlerFunc).ServeHTTP", Method, 0, ""}, {"(Header).Add", Method, 0, ""}, {"(Header).Clone", Method, 13, ""}, @@ -8405,10 +8816,16 @@ var PackageSymbols = map[string][]Symbol{ {"(Header).Values", Method, 14, ""}, {"(Header).Write", Method, 0, ""}, {"(Header).WriteSubset", Method, 0, ""}, + {"(Hijacker).Hijack", Method, 0, ""}, {"(Protocols).HTTP1", Method, 24, ""}, {"(Protocols).HTTP2", Method, 24, ""}, {"(Protocols).String", Method, 24, ""}, {"(Protocols).UnencryptedHTTP2", Method, 24, ""}, + {"(Pusher).Push", Method, 8, ""}, + {"(ResponseWriter).Header", Method, 0, ""}, + {"(ResponseWriter).Write", Method, 0, ""}, + {"(ResponseWriter).WriteHeader", Method, 0, ""}, + {"(RoundTripper).RoundTrip", Method, 0, ""}, {"AllowQuerySemicolons", Func, 17, "func(h Handler) Handler"}, {"CanonicalHeaderKey", Func, 0, "func(s string) string"}, {"Client", Type, 0, ""}, @@ -8416,6 +8833,7 @@ var PackageSymbols = map[string][]Symbol{ {"Client.Jar", Field, 0, ""}, {"Client.Timeout", Field, 3, ""}, {"Client.Transport", Field, 0, ""}, + {"ClientConn", Type, 26, ""}, {"CloseNotifier", Type, 1, ""}, {"ConnState", Type, 3, ""}, {"Cookie", Type, 0, ""}, @@ -8726,6 +9144,8 @@ var PackageSymbols = map[string][]Symbol{ "net/http/cookiejar": { {"(*Jar).Cookies", Method, 1, ""}, {"(*Jar).SetCookies", Method, 1, ""}, + {"(PublicSuffixList).PublicSuffix", Method, 1, ""}, + {"(PublicSuffixList).String", Method, 1, ""}, {"Jar", Type, 1, ""}, {"New", Func, 1, "func(o *Options) (*Jar, error)"}, {"Options", Type, 1, ""}, @@ -8819,6 +9239,8 @@ var PackageSymbols = map[string][]Symbol{ {"(*ServerConn).Pending", Method, 0, ""}, {"(*ServerConn).Read", Method, 0, ""}, {"(*ServerConn).Write", Method, 0, ""}, + {"(BufferPool).Get", Method, 6, ""}, + {"(BufferPool).Put", Method, 6, ""}, {"BufferPool", Type, 6, ""}, {"ClientConn", Type, 0, ""}, {"DumpRequest", Func, 0, "func(req *http.Request, body bool) ([]byte, error)"}, @@ -8972,6 +9394,14 @@ var PackageSymbols = map[string][]Symbol{ {"(*Server).ServeConn", Method, 0, ""}, {"(*Server).ServeHTTP", Method, 0, ""}, {"(*Server).ServeRequest", Method, 0, ""}, + {"(ClientCodec).Close", Method, 0, ""}, + {"(ClientCodec).ReadResponseBody", Method, 0, ""}, + {"(ClientCodec).ReadResponseHeader", Method, 0, ""}, + {"(ClientCodec).WriteRequest", Method, 0, ""}, + {"(ServerCodec).Close", Method, 0, ""}, + {"(ServerCodec).ReadRequestBody", Method, 0, ""}, + {"(ServerCodec).ReadRequestHeader", Method, 0, ""}, + {"(ServerCodec).WriteResponse", Method, 0, ""}, {"(ServerError).Error", Method, 0, ""}, {"Accept", Func, 0, "func(lis net.Listener)"}, {"Call", Type, 0, ""}, @@ -9030,6 +9460,8 @@ var PackageSymbols = map[string][]Symbol{ {"(*Client).StartTLS", Method, 0, ""}, {"(*Client).TLSConnectionState", Method, 5, ""}, {"(*Client).Verify", Method, 0, ""}, + {"(Auth).Next", Method, 0, ""}, + {"(Auth).Start", Method, 0, ""}, {"Auth", Type, 0, ""}, {"CRAMMD5Auth", Func, 0, "func(username string, secret string) Auth"}, {"Client", Type, 0, ""}, @@ -9241,10 +9673,18 @@ var PackageSymbols = map[string][]Symbol{ {"(*SyscallError).Error", Method, 0, ""}, {"(*SyscallError).Timeout", Method, 10, ""}, {"(*SyscallError).Unwrap", Method, 13, ""}, + {"(FileInfo).IsDir", Method, 0, ""}, + {"(FileInfo).ModTime", Method, 0, ""}, + {"(FileInfo).Mode", Method, 0, ""}, + {"(FileInfo).Name", Method, 0, ""}, + {"(FileInfo).Size", Method, 0, ""}, + {"(FileInfo).Sys", Method, 0, ""}, {"(FileMode).IsDir", Method, 0, ""}, {"(FileMode).IsRegular", Method, 1, ""}, {"(FileMode).Perm", Method, 0, ""}, {"(FileMode).String", Method, 0, ""}, + {"(Signal).Signal", Method, 0, ""}, + {"(Signal).String", Method, 0, ""}, {"Args", Var, 0, ""}, {"Chdir", Func, 0, "func(dir string) error"}, {"Chmod", Func, 0, "func(name string, mode FileMode) error"}, @@ -9521,6 +9961,45 @@ var PackageSymbols = map[string][]Symbol{ {"(StructField).IsExported", Method, 17, ""}, {"(StructTag).Get", Method, 0, ""}, {"(StructTag).Lookup", Method, 7, ""}, + {"(Type).Align", Method, 0, ""}, + {"(Type).AssignableTo", Method, 0, ""}, + {"(Type).Bits", Method, 0, ""}, + {"(Type).CanSeq", Method, 23, ""}, + {"(Type).CanSeq2", Method, 23, ""}, + {"(Type).ChanDir", Method, 0, ""}, + {"(Type).Comparable", Method, 4, ""}, + {"(Type).ConvertibleTo", Method, 1, ""}, + {"(Type).Elem", Method, 0, ""}, + {"(Type).Field", Method, 0, ""}, + {"(Type).FieldAlign", Method, 0, ""}, + {"(Type).FieldByIndex", Method, 0, ""}, + {"(Type).FieldByName", Method, 0, ""}, + {"(Type).FieldByNameFunc", Method, 0, ""}, + {"(Type).Fields", Method, 26, ""}, + {"(Type).Implements", Method, 0, ""}, + {"(Type).In", Method, 0, ""}, + {"(Type).Ins", Method, 26, ""}, + {"(Type).IsVariadic", Method, 0, ""}, + {"(Type).Key", Method, 0, ""}, + {"(Type).Kind", Method, 0, ""}, + {"(Type).Len", Method, 0, ""}, + {"(Type).Method", Method, 0, ""}, + {"(Type).MethodByName", Method, 0, ""}, + {"(Type).Methods", Method, 26, ""}, + {"(Type).Name", Method, 0, ""}, + {"(Type).NumField", Method, 0, ""}, + {"(Type).NumIn", Method, 0, ""}, + {"(Type).NumMethod", Method, 0, ""}, + {"(Type).NumOut", Method, 0, ""}, + {"(Type).Out", Method, 0, ""}, + {"(Type).Outs", Method, 26, ""}, + {"(Type).OverflowComplex", Method, 23, ""}, + {"(Type).OverflowFloat", Method, 23, ""}, + {"(Type).OverflowInt", Method, 23, ""}, + {"(Type).OverflowUint", Method, 23, ""}, + {"(Type).PkgPath", Method, 0, ""}, + {"(Type).Size", Method, 0, ""}, + {"(Type).String", Method, 0, ""}, {"(Value).Addr", Method, 0, ""}, {"(Value).Bool", Method, 0, ""}, {"(Value).Bytes", Method, 0, ""}, @@ -9547,6 +10026,7 @@ var PackageSymbols = map[string][]Symbol{ {"(Value).FieldByIndexErr", Method, 18, ""}, {"(Value).FieldByName", Method, 0, ""}, {"(Value).FieldByNameFunc", Method, 0, ""}, + {"(Value).Fields", Method, 26, ""}, {"(Value).Float", Method, 0, ""}, {"(Value).Grow", Method, 20, ""}, {"(Value).Index", Method, 0, ""}, @@ -9563,6 +10043,7 @@ var PackageSymbols = map[string][]Symbol{ {"(Value).MapRange", Method, 12, ""}, {"(Value).Method", Method, 0, ""}, {"(Value).MethodByName", Method, 0, ""}, + {"(Value).Methods", Method, 26, ""}, {"(Value).NumField", Method, 0, ""}, {"(Value).NumMethod", Method, 0, ""}, {"(Value).OverflowComplex", Method, 0, ""}, @@ -9678,7 +10159,6 @@ var PackageSymbols = map[string][]Symbol{ {"StructOf", Func, 7, "func(fields []StructField) Type"}, {"StructTag", Type, 0, ""}, {"Swapper", Func, 8, "func(slice any) func(i int, j int)"}, - {"Type", Type, 0, ""}, {"TypeAssert", Func, 25, "func[T any](v Value) (T, bool)"}, {"TypeFor", Func, 22, "func[T any]() Type"}, {"TypeOf", Func, 0, "func(i any) Type"}, @@ -9880,6 +10360,8 @@ var PackageSymbols = map[string][]Symbol{ {"(*TypeAssertionError).Error", Method, 0, ""}, {"(*TypeAssertionError).RuntimeError", Method, 0, ""}, {"(Cleanup).Stop", Method, 24, ""}, + {"(Error).Error", Method, 0, ""}, + {"(Error).RuntimeError", Method, 0, ""}, {"AddCleanup", Func, 24, "func[T, S any](ptr *T, cleanup func(S), arg S) Cleanup"}, {"BlockProfile", Func, 1, "func(p []BlockProfileRecord) (n int, ok bool)"}, {"BlockProfileRecord", Type, 1, ""}, @@ -10154,6 +10636,9 @@ var PackageSymbols = map[string][]Symbol{ {"(IntSlice).Search", Method, 0, ""}, {"(IntSlice).Sort", Method, 0, ""}, {"(IntSlice).Swap", Method, 0, ""}, + {"(Interface).Len", Method, 0, ""}, + {"(Interface).Less", Method, 0, ""}, + {"(Interface).Swap", Method, 0, ""}, {"(StringSlice).Len", Method, 0, ""}, {"(StringSlice).Less", Method, 0, ""}, {"(StringSlice).Search", Method, 0, ""}, @@ -10345,6 +10830,8 @@ var PackageSymbols = map[string][]Symbol{ {"(*WaitGroup).Done", Method, 0, ""}, {"(*WaitGroup).Go", Method, 25, ""}, {"(*WaitGroup).Wait", Method, 0, ""}, + {"(Locker).Lock", Method, 0, ""}, + {"(Locker).Unlock", Method, 0, ""}, {"Cond", Type, 0, ""}, {"Cond.L", Field, 0, ""}, {"Locker", Type, 0, ""}, @@ -10486,10 +10973,14 @@ var PackageSymbols = map[string][]Symbol{ {"(*Timeval).Nano", Method, 0, ""}, {"(*Timeval).Nanoseconds", Method, 0, ""}, {"(*Timeval).Unix", Method, 0, ""}, + {"(Conn).SyscallConn", Method, 9, ""}, {"(Errno).Error", Method, 0, ""}, {"(Errno).Is", Method, 13, ""}, {"(Errno).Temporary", Method, 0, ""}, {"(Errno).Timeout", Method, 0, ""}, + {"(RawConn).Control", Method, 9, ""}, + {"(RawConn).Read", Method, 9, ""}, + {"(RawConn).Write", Method, 9, ""}, {"(Signal).Signal", Method, 0, ""}, {"(Signal).String", Method, 0, ""}, {"(Token).Close", Method, 0, ""}, @@ -14409,7 +14900,7 @@ var PackageSymbols = map[string][]Symbol{ {"RouteMessage.Data", Field, 0, ""}, {"RouteMessage.Header", Field, 0, ""}, {"RouteRIB", Func, 0, ""}, - {"RoutingMessage", Type, 0, ""}, + {"RoutingMessage", Type, 14, ""}, {"RtAttr", Type, 0, ""}, {"RtAttr.Len", Field, 0, ""}, {"RtAttr.Type", Field, 0, ""}, @@ -15895,7 +16386,6 @@ var PackageSymbols = map[string][]Symbol{ {"SockFprog.Filter", Field, 0, ""}, {"SockFprog.Len", Field, 0, ""}, {"SockFprog.Pad_cgo_0", Field, 0, ""}, - {"Sockaddr", Type, 0, ""}, {"SockaddrDatalink", Type, 0, ""}, {"SockaddrDatalink.Alen", Field, 0, ""}, {"SockaddrDatalink.Data", Field, 0, ""}, @@ -16801,6 +17291,29 @@ var PackageSymbols = map[string][]Symbol{ {"(BenchmarkResult).MemString", Method, 1, ""}, {"(BenchmarkResult).NsPerOp", Method, 0, ""}, {"(BenchmarkResult).String", Method, 0, ""}, + {"(TB).ArtifactDir", Method, 26, ""}, + {"(TB).Attr", Method, 25, ""}, + {"(TB).Chdir", Method, 24, ""}, + {"(TB).Cleanup", Method, 14, ""}, + {"(TB).Context", Method, 24, ""}, + {"(TB).Error", Method, 2, ""}, + {"(TB).Errorf", Method, 2, ""}, + {"(TB).Fail", Method, 2, ""}, + {"(TB).FailNow", Method, 2, ""}, + {"(TB).Failed", Method, 2, ""}, + {"(TB).Fatal", Method, 2, ""}, + {"(TB).Fatalf", Method, 2, ""}, + {"(TB).Helper", Method, 9, ""}, + {"(TB).Log", Method, 2, ""}, + {"(TB).Logf", Method, 2, ""}, + {"(TB).Name", Method, 8, ""}, + {"(TB).Output", Method, 25, ""}, + {"(TB).Setenv", Method, 17, ""}, + {"(TB).Skip", Method, 2, ""}, + {"(TB).SkipNow", Method, 2, ""}, + {"(TB).Skipf", Method, 2, ""}, + {"(TB).Skipped", Method, 2, ""}, + {"(TB).TempDir", Method, 15, ""}, {"AllocsPerRun", Func, 1, "func(runs int, f func()) (avg float64)"}, {"B", Type, 0, ""}, {"B.N", Field, 0, ""}, @@ -16851,7 +17364,6 @@ var PackageSymbols = map[string][]Symbol{ {"RunTests", Func, 0, "func(matchString func(pat string, str string) (bool, error), tests []InternalTest) (ok bool)"}, {"Short", Func, 0, "func() bool"}, {"T", Type, 0, ""}, - {"TB", Type, 2, ""}, {"Testing", Func, 21, "func() bool"}, {"Verbose", Func, 1, "func() bool"}, }, @@ -16887,6 +17399,7 @@ var PackageSymbols = map[string][]Symbol{ "testing/quick": { {"(*CheckEqualError).Error", Method, 0, ""}, {"(*CheckError).Error", Method, 0, ""}, + {"(Generator).Generate", Method, 0, ""}, {"(SetupError).Error", Method, 0, ""}, {"Check", Func, 0, "func(f any, config *Config) error"}, {"CheckEqual", Func, 0, "func(f any, g any, config *Config) error"}, @@ -17093,6 +17606,10 @@ var PackageSymbols = map[string][]Symbol{ {"(ListNode).Position", Method, 1, ""}, {"(ListNode).Type", Method, 0, ""}, {"(NilNode).Position", Method, 1, ""}, + {"(Node).Copy", Method, 0, ""}, + {"(Node).Position", Method, 1, ""}, + {"(Node).String", Method, 0, ""}, + {"(Node).Type", Method, 0, ""}, {"(NodeType).Type", Method, 0, ""}, {"(NumberNode).Position", Method, 1, ""}, {"(NumberNode).Type", Method, 0, ""}, diff --git a/vendor/golang.org/x/tools/internal/stdlib/stdlib.go b/vendor/golang.org/x/tools/internal/stdlib/stdlib.go index e223e0f3..59a5de36 100644 --- a/vendor/golang.org/x/tools/internal/stdlib/stdlib.go +++ b/vendor/golang.org/x/tools/internal/stdlib/stdlib.go @@ -39,7 +39,7 @@ const ( Var // "EOF" Const // "Pi" Field // "Point.X" - Method // "(*Buffer).Grow" + Method // "(*Buffer).Grow" or "(Reader).Read" ) func (kind Kind) String() string { diff --git a/vendor/golang.org/x/tools/internal/typesinternal/classify_call.go b/vendor/golang.org/x/tools/internal/typesinternal/classify_call.go index 3db2a135..7ebe9768 100644 --- a/vendor/golang.org/x/tools/internal/typesinternal/classify_call.go +++ b/vendor/golang.org/x/tools/internal/typesinternal/classify_call.go @@ -8,7 +8,7 @@ import ( "fmt" "go/ast" "go/types" - _ "unsafe" + _ "unsafe" // for go:linkname hack ) // CallKind describes the function position of an [*ast.CallExpr]. diff --git a/vendor/golang.org/x/tools/internal/typesinternal/types.go b/vendor/golang.org/x/tools/internal/typesinternal/types.go index fef74a78..51001666 100644 --- a/vendor/golang.org/x/tools/internal/typesinternal/types.go +++ b/vendor/golang.org/x/tools/internal/typesinternal/types.go @@ -23,7 +23,6 @@ import ( "go/token" "go/types" "reflect" - "unsafe" "golang.org/x/tools/go/ast/inspector" "golang.org/x/tools/internal/aliases" @@ -40,8 +39,7 @@ func SetUsesCgo(conf *types.Config) bool { } } - addr := unsafe.Pointer(f.UnsafeAddr()) - *(*bool)(addr) = true + *(*bool)(f.Addr().UnsafePointer()) = true return true } diff --git a/vendor/golang.org/x/tools/internal/versions/features.go b/vendor/golang.org/x/tools/internal/versions/features.go index a5f4e325..cdd36c38 100644 --- a/vendor/golang.org/x/tools/internal/versions/features.go +++ b/vendor/golang.org/x/tools/internal/versions/features.go @@ -9,6 +9,7 @@ package versions // named constants, to avoid misspelling const ( + Go1_17 = "go1.17" Go1_18 = "go1.18" Go1_19 = "go1.19" Go1_20 = "go1.20" diff --git a/vendor/google.golang.org/grpc/balancer/balancer.go b/vendor/google.golang.org/grpc/balancer/balancer.go index b1264017..d08b7ad6 100644 --- a/vendor/google.golang.org/grpc/balancer/balancer.go +++ b/vendor/google.golang.org/grpc/balancer/balancer.go @@ -75,8 +75,6 @@ func unregisterForTesting(name string) { func init() { internal.BalancerUnregister = unregisterForTesting - internal.ConnectedAddress = connectedAddress - internal.SetConnectedAddress = setConnectedAddress } // Get returns the resolver builder registered with the given name. diff --git a/vendor/google.golang.org/grpc/balancer/pickfirst/internal/internal.go b/vendor/google.golang.org/grpc/balancer/pickfirst/internal/internal.go index 7d66cb49..cc902a4d 100644 --- a/vendor/google.golang.org/grpc/balancer/pickfirst/internal/internal.go +++ b/vendor/google.golang.org/grpc/balancer/pickfirst/internal/internal.go @@ -26,6 +26,8 @@ import ( var ( // RandShuffle pseudo-randomizes the order of addresses. RandShuffle = rand.Shuffle + // RandFloat64 returns, as a float64, a pseudo-random number in [0.0,1.0). + RandFloat64 = rand.Float64 // TimeAfterFunc allows mocking the timer for testing connection delay // related functionality. TimeAfterFunc = func(d time.Duration, f func()) func() { diff --git a/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go b/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go index b4bc3a2b..dccd9f0b 100644 --- a/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go +++ b/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go @@ -21,11 +21,14 @@ package pickfirst import ( + "cmp" "encoding/json" "errors" "fmt" + "math" "net" "net/netip" + "slices" "sync" "time" @@ -34,6 +37,8 @@ import ( "google.golang.org/grpc/connectivity" expstats "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal/balancer/weight" + "google.golang.org/grpc/internal/envconfig" internalgrpclog "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/pretty" "google.golang.org/grpc/resolver" @@ -258,8 +263,42 @@ func (b *pickfirstBalancer) UpdateClientConnState(state balancer.ClientConnState // will change the order of endpoints but not touch the order of the // addresses within each endpoint. - A61 if cfg.ShuffleAddressList { - endpoints = append([]resolver.Endpoint{}, endpoints...) - internal.RandShuffle(len(endpoints), func(i, j int) { endpoints[i], endpoints[j] = endpoints[j], endpoints[i] }) + if envconfig.PickFirstWeightedShuffling { + type weightedEndpoint struct { + endpoint resolver.Endpoint + weight float64 + } + + // For each endpoint, compute a key as described in A113 and + // https://utopia.duth.gr/~pefraimi/research/data/2007EncOfAlg.pdf: + var weightedEndpoints []weightedEndpoint + for _, endpoint := range endpoints { + u := internal.RandFloat64() // Random number in [0.0, 1.0) + weight := weightAttribute(endpoint) + weightedEndpoints = append(weightedEndpoints, weightedEndpoint{ + endpoint: endpoint, + weight: math.Pow(u, 1.0/float64(weight)), + }) + } + // Sort endpoints by key in descending order and reconstruct the + // endpoints slice. + slices.SortFunc(weightedEndpoints, func(a, b weightedEndpoint) int { + return cmp.Compare(b.weight, a.weight) + }) + + // Here, and in the "else" block below, we clone the endpoints + // slice to avoid mutating the resolver state. Doing the latter + // would lead to data races if the caller is accessing the same + // slice concurrently. + sortedEndpoints := make([]resolver.Endpoint, len(endpoints)) + for i, we := range weightedEndpoints { + sortedEndpoints[i] = we.endpoint + } + endpoints = sortedEndpoints + } else { + endpoints = slices.Clone(endpoints) + internal.RandShuffle(len(endpoints), func(i, j int) { endpoints[i], endpoints[j] = endpoints[j], endpoints[i] }) + } } // "Flatten the list by concatenating the ordered list of addresses for @@ -906,3 +945,17 @@ func equalAddressIgnoringBalAttributes(a, b *resolver.Address) bool { return a.Addr == b.Addr && a.ServerName == b.ServerName && a.Attributes.Equal(b.Attributes) } + +// weightAttribute is a convenience function which returns the value of the +// weight endpoint Attribute. +// +// When used in the xDS context, the weight attribute is guaranteed to be +// non-zero. But, when used in a non-xDS context, the weight attribute could be +// unset. A Default of 1 is used in the latter case. +func weightAttribute(e resolver.Endpoint) uint32 { + w := weight.FromEndpoint(e).Weight + if w == 0 { + return 1 + } + return w +} diff --git a/vendor/google.golang.org/grpc/balancer/subconn.go b/vendor/google.golang.org/grpc/balancer/subconn.go index 9ee44d4a..c1ca7c92 100644 --- a/vendor/google.golang.org/grpc/balancer/subconn.go +++ b/vendor/google.golang.org/grpc/balancer/subconn.go @@ -111,20 +111,6 @@ type SubConnState struct { // ConnectionError is set if the ConnectivityState is TransientFailure, // describing the reason the SubConn failed. Otherwise, it is nil. ConnectionError error - // connectedAddr contains the connected address when ConnectivityState is - // Ready. Otherwise, it is indeterminate. - connectedAddress resolver.Address -} - -// connectedAddress returns the connected address for a SubConnState. The -// address is only valid if the state is READY. -func connectedAddress(scs SubConnState) resolver.Address { - return scs.connectedAddress -} - -// setConnectedAddress sets the connected address for a SubConnState. -func setConnectedAddress(scs *SubConnState, addr resolver.Address) { - scs.connectedAddress = addr } // A Producer is a type shared among potentially many consumers. It is diff --git a/vendor/google.golang.org/grpc/balancer_wrapper.go b/vendor/google.golang.org/grpc/balancer_wrapper.go index 2c760e62..a1e56a38 100644 --- a/vendor/google.golang.org/grpc/balancer_wrapper.go +++ b/vendor/google.golang.org/grpc/balancer_wrapper.go @@ -36,7 +36,6 @@ import ( ) var ( - setConnectedAddress = internal.SetConnectedAddress.(func(*balancer.SubConnState, resolver.Address)) // noOpRegisterHealthListenerFn is used when client side health checking is // disabled. It sends a single READY update on the registered listener. noOpRegisterHealthListenerFn = func(_ context.Context, listener func(balancer.SubConnState)) func() { @@ -305,7 +304,7 @@ func newHealthData(s connectivity.State) *healthData { // updateState is invoked by grpc to push a subConn state update to the // underlying balancer. -func (acbw *acBalancerWrapper) updateState(s connectivity.State, curAddr resolver.Address, err error) { +func (acbw *acBalancerWrapper) updateState(s connectivity.State, err error) { acbw.ccb.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil || acbw.ccb.balancer == nil { return @@ -317,9 +316,6 @@ func (acbw *acBalancerWrapper) updateState(s connectivity.State, curAddr resolve // opts.StateListener is set, so this cannot ever be nil. // TODO: delete this comment when UpdateSubConnState is removed. scs := balancer.SubConnState{ConnectivityState: s, ConnectionError: err} - if s == connectivity.Ready { - setConnectedAddress(&scs, curAddr) - } // Invalidate the health listener by updating the healthData. acbw.healthMu.Lock() // A race may occur if a health listener is registered soon after the diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index b767d3e3..5dec2dac 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -977,25 +977,24 @@ func (cc *ClientConn) incrCallsFailed() { // connect starts creating a transport. // It does nothing if the ac is not IDLE. // TODO(bar) Move this to the addrConn section. -func (ac *addrConn) connect() error { +func (ac *addrConn) connect() { ac.mu.Lock() if ac.state == connectivity.Shutdown { if logger.V(2) { logger.Infof("connect called on shutdown addrConn; ignoring.") } ac.mu.Unlock() - return errConnClosing + return } if ac.state != connectivity.Idle { if logger.V(2) { logger.Infof("connect called on addrConn in non-idle state (%v); ignoring.", ac.state) } ac.mu.Unlock() - return nil + return } ac.resetTransportAndUnlock() - return nil } // equalAddressIgnoringBalAttributes returns true is a and b are considered equal. @@ -1297,7 +1296,7 @@ func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error) } else { channelz.Infof(logger, ac.channelz, "Subchannel Connectivity change to %v, last error: %s", s, lastErr) } - ac.acbw.updateState(s, ac.curAddr, lastErr) + ac.acbw.updateState(s, lastErr) } // adjustParams updates parameters used to create transports upon @@ -1528,25 +1527,26 @@ func (ac *addrConn) createTransport(ctx context.Context, addr resolver.Address, } ac.mu.Lock() - defer ac.mu.Unlock() if ctx.Err() != nil { // This can happen if the subConn was removed while in `Connecting` // state. tearDown() would have set the state to `Shutdown`, but // would not have closed the transport since ac.transport would not // have been set at that point. - // - // We run this in a goroutine because newTr.Close() calls onClose() + + // We unlock ac.mu because newTr.Close() calls onClose() // inline, which requires locking ac.mu. - // + ac.mu.Unlock() + // The error we pass to Close() is immaterial since there are no open // streams at this point, so no trailers with error details will be sent // out. We just need to pass a non-nil error. // // This can also happen when updateAddrs is called during a connection // attempt. - go newTr.Close(transport.ErrConnClosing) + newTr.Close(transport.ErrConnClosing) return nil } + defer ac.mu.Unlock() if hctx.Err() != nil { // onClose was already called for this connection, but the connection // was successfully established first. Consider it a success and set diff --git a/vendor/google.golang.org/grpc/credentials/tls.go b/vendor/google.golang.org/grpc/credentials/tls.go index 8277be7d..0bcd16db 100644 --- a/vendor/google.golang.org/grpc/credentials/tls.go +++ b/vendor/google.golang.org/grpc/credentials/tls.go @@ -56,9 +56,13 @@ func (t TLSInfo) AuthType() string { // non-nil error if the validation fails. func (t TLSInfo) ValidateAuthority(authority string) error { var errs []error + host, _, err := net.SplitHostPort(authority) + if err != nil { + host = authority + } for _, cert := range t.State.PeerCertificates { var err error - if err = cert.VerifyHostname(authority); err == nil { + if err = cert.VerifyHostname(host); err == nil { return nil } errs = append(errs, err) diff --git a/vendor/google.golang.org/grpc/encoding/encoding.go b/vendor/google.golang.org/grpc/encoding/encoding.go index dadd21e4..296f38c3 100644 --- a/vendor/google.golang.org/grpc/encoding/encoding.go +++ b/vendor/google.golang.org/grpc/encoding/encoding.go @@ -58,10 +58,6 @@ func init() { // Compressor is used for compressing and decompressing when sending or // receiving messages. -// -// If a Compressor implements `DecompressedSize(compressedBytes []byte) int`, -// gRPC will invoke it to determine the size of the buffer allocated for the -// result of decompression. A return value of -1 indicates unknown size. type Compressor interface { // Compress writes the data written to wc to w after compressing it. If an // error occurs while initializing the compressor, that error is returned diff --git a/vendor/google.golang.org/grpc/experimental/stats/metrics.go b/vendor/google.golang.org/grpc/experimental/stats/metrics.go index d7d404cb..88742724 100644 --- a/vendor/google.golang.org/grpc/experimental/stats/metrics.go +++ b/vendor/google.golang.org/grpc/experimental/stats/metrics.go @@ -19,9 +19,13 @@ // Package stats contains experimental metrics/stats API's. package stats -import "google.golang.org/grpc/stats" +import ( + "google.golang.org/grpc/internal" + "google.golang.org/grpc/stats" +) // MetricsRecorder records on metrics derived from metric registry. +// Implementors must embed UnimplementedMetricsRecorder. type MetricsRecorder interface { // RecordInt64Count records the measurement alongside labels on the int // count associated with the provided handle. @@ -41,6 +45,39 @@ type MetricsRecorder interface { // RecordInt64UpDownCounter records the measurement alongside labels on the int // count associated with the provided handle. RecordInt64UpDownCount(handle *Int64UpDownCountHandle, incr int64, labels ...string) + // RegisterAsyncReporter registers a reporter to produce metric values for + // only the listed descriptors. The returned function must be called when + // the metrics are no longer needed, which will remove the reporter. The + // returned method needs to be idempotent and concurrent safe. + RegisterAsyncReporter(reporter AsyncMetricReporter, descriptors ...AsyncMetric) func() + + // EnforceMetricsRecorderEmbedding is included to force implementers to embed + // another implementation of this interface, allowing gRPC to add methods + // without breaking users. + internal.EnforceMetricsRecorderEmbedding +} + +// AsyncMetricReporter is an interface for types that record metrics asynchronously +// for the set of descriptors they are registered with. The AsyncMetricsRecorder +// parameter is used to record values for these metrics. +// +// Implementations must make unique recordings across all registered +// AsyncMetricReporters. Meaning, they should not report values for a metric with +// the same attributes as another AsyncMetricReporter will report. +// +// Implementations must be concurrent-safe. +type AsyncMetricReporter interface { + // Report records metric values using the provided recorder. + Report(AsyncMetricsRecorder) error +} + +// AsyncMetricReporterFunc is an adapter to allow the use of ordinary functions as +// AsyncMetricReporters. +type AsyncMetricReporterFunc func(AsyncMetricsRecorder) error + +// Report calls f(r). +func (f AsyncMetricReporterFunc) Report(r AsyncMetricsRecorder) error { + return f(r) } // AsyncMetricsRecorder records on asynchronous metrics derived from metric registry. @@ -62,3 +99,33 @@ type Metric = string func NewMetrics(metrics ...Metric) *Metrics { return stats.NewMetricSet(metrics...) } + +// UnimplementedMetricsRecorder must be embedded to have forward compatible implementations. +type UnimplementedMetricsRecorder struct { + internal.EnforceMetricsRecorderEmbedding +} + +// RecordInt64Count provides a no-op implementation. +func (UnimplementedMetricsRecorder) RecordInt64Count(*Int64CountHandle, int64, ...string) {} + +// RecordFloat64Count provides a no-op implementation. +func (UnimplementedMetricsRecorder) RecordFloat64Count(*Float64CountHandle, float64, ...string) {} + +// RecordInt64Histo provides a no-op implementation. +func (UnimplementedMetricsRecorder) RecordInt64Histo(*Int64HistoHandle, int64, ...string) {} + +// RecordFloat64Histo provides a no-op implementation. +func (UnimplementedMetricsRecorder) RecordFloat64Histo(*Float64HistoHandle, float64, ...string) {} + +// RecordInt64Gauge provides a no-op implementation. +func (UnimplementedMetricsRecorder) RecordInt64Gauge(*Int64GaugeHandle, int64, ...string) {} + +// RecordInt64UpDownCount provides a no-op implementation. +func (UnimplementedMetricsRecorder) RecordInt64UpDownCount(*Int64UpDownCountHandle, int64, ...string) { +} + +// RegisterAsyncReporter provides a no-op implementation. +func (UnimplementedMetricsRecorder) RegisterAsyncReporter(AsyncMetricReporter, ...AsyncMetric) func() { + // No-op: Return an empty function to ensure caller doesn't panic on nil function call + return func() {} +} diff --git a/vendor/google.golang.org/grpc/interceptor.go b/vendor/google.golang.org/grpc/interceptor.go index 877d78fc..099e3d09 100644 --- a/vendor/google.golang.org/grpc/interceptor.go +++ b/vendor/google.golang.org/grpc/interceptor.go @@ -97,8 +97,12 @@ type StreamServerInfo struct { IsServerStream bool } -// StreamServerInterceptor provides a hook to intercept the execution of a streaming RPC on the server. -// info contains all the information of this RPC the interceptor can operate on. And handler is the -// service method implementation. It is the responsibility of the interceptor to invoke handler to -// complete the RPC. +// StreamServerInterceptor provides a hook to intercept the execution of a +// streaming RPC on the server. +// +// srv is the service implementation on which the RPC was invoked, and needs to +// be passed to handler, and not used otherwise. ss is the server side of the +// stream. info contains all the information of this RPC the interceptor can +// operate on. And handler is the service method implementation. It is the +// responsibility of the interceptor to invoke handler to complete the RPC. type StreamServerInterceptor func(srv any, ss ServerStream, info *StreamServerInfo, handler StreamHandler) error diff --git a/vendor/google.golang.org/grpc/internal/balancer/weight/weight.go b/vendor/google.golang.org/grpc/internal/balancer/weight/weight.go new file mode 100644 index 00000000..11beb07d --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/balancer/weight/weight.go @@ -0,0 +1,66 @@ +/* + * + * Copyright 2025 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package weight contains utilities to manage endpoint weights. Weights are +// used by LB policies such as ringhash to distribute load across multiple +// endpoints. +package weight + +import ( + "fmt" + + "google.golang.org/grpc/resolver" +) + +// attributeKey is the type used as the key to store EndpointInfo in the +// Attributes field of resolver.Endpoint. +type attributeKey struct{} + +// EndpointInfo will be stored in the Attributes field of Endpoints in order to +// use the ringhash balancer. +type EndpointInfo struct { + Weight uint32 +} + +// Equal allows the values to be compared by Attributes.Equal. +func (a EndpointInfo) Equal(o any) bool { + oa, ok := o.(EndpointInfo) + return ok && oa.Weight == a.Weight +} + +// Set returns a copy of endpoint in which the Attributes field is updated with +// EndpointInfo. +func Set(endpoint resolver.Endpoint, epInfo EndpointInfo) resolver.Endpoint { + endpoint.Attributes = endpoint.Attributes.WithValue(attributeKey{}, epInfo) + return endpoint +} + +// String returns a human-readable representation of EndpointInfo. +// This method is intended for logging, testing, and debugging purposes only. +// Do not rely on the output format, as it is not guaranteed to remain stable. +func (a EndpointInfo) String() string { + return fmt.Sprintf("Weight: %d", a.Weight) +} + +// FromEndpoint returns the EndpointInfo stored in the Attributes field of an +// endpoint. It returns an empty EndpointInfo if attribute is not found. +func FromEndpoint(endpoint resolver.Endpoint) EndpointInfo { + v := endpoint.Attributes.Value(attributeKey{}) + ei, _ := v.(EndpointInfo) + return ei +} diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index 6414ee4b..e8dc7912 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -82,6 +82,12 @@ var ( // This feature is defined in gRFC A81 and is enabled by setting the // environment variable GRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE to "true". XDSAuthorityRewrite = boolFromEnv("GRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE", false) + + // PickFirstWeightedShuffling indicates whether weighted endpoint shuffling + // is enabled in the pick_first LB policy, as defined in gRFC A113. This + // feature can be disabled by setting the environment variable + // GRPC_EXPERIMENTAL_PF_WEIGHTED_SHUFFLING to "false". + PickFirstWeightedShuffling = boolFromEnv("GRPC_EXPERIMENTAL_PF_WEIGHTED_SHUFFLING", true) ) func boolFromEnv(envVar string, def bool) bool { diff --git a/vendor/google.golang.org/grpc/internal/experimental.go b/vendor/google.golang.org/grpc/internal/experimental.go index c90cc51b..8a999917 100644 --- a/vendor/google.golang.org/grpc/internal/experimental.go +++ b/vendor/google.golang.org/grpc/internal/experimental.go @@ -26,6 +26,9 @@ var ( // option to configure a shared buffer pool for a grpc.Server. BufferPool any // func (grpc.SharedBufferPool) grpc.ServerOption + // SetDefaultBufferPool updates the default buffer pool. + SetDefaultBufferPool any // func(mem.BufferPool) + // AcceptCompressors is implemented by the grpc package and returns // a call option that restricts the grpc-accept-encoding header for a call. AcceptCompressors any // func(...string) grpc.CallOption diff --git a/vendor/google.golang.org/grpc/internal/internal.go b/vendor/google.golang.org/grpc/internal/internal.go index 27bef83d..4b3d563f 100644 --- a/vendor/google.golang.org/grpc/internal/internal.go +++ b/vendor/google.golang.org/grpc/internal/internal.go @@ -211,22 +211,11 @@ var ( // default resolver scheme. UserSetDefaultScheme = false - // ConnectedAddress returns the connected address for a SubConnState. The - // address is only valid if the state is READY. - ConnectedAddress any // func (scs SubConnState) resolver.Address - - // SetConnectedAddress sets the connected address for a SubConnState. - SetConnectedAddress any // func(scs *SubConnState, addr resolver.Address) - // SnapshotMetricRegistryForTesting snapshots the global data of the metric // registry. Returns a cleanup function that sets the metric registry to its // original state. Only called in testing functions. SnapshotMetricRegistryForTesting func() func() - // SetDefaultBufferPoolForTesting updates the default buffer pool, for - // testing purposes. - SetDefaultBufferPoolForTesting any // func(mem.BufferPool) - // SetBufferPoolingThresholdForTesting updates the buffer pooling threshold, for // testing purposes. SetBufferPoolingThresholdForTesting any // func(int) @@ -248,6 +237,14 @@ var ( // AddressToTelemetryLabels is an xDS-provided function to extract telemetry // labels from a resolver.Address. Callers must assert its type before calling. AddressToTelemetryLabels any // func(addr resolver.Address) map[string]string + + // AsyncReporterCleanupDelegate is initialized to a pass-through function by + // default (production behavior), allowing tests to swap it with an + // implementation which tracks registration of async reporter and its + // corresponding cleanup. + AsyncReporterCleanupDelegate = func(cleanup func()) func() { + return cleanup + } ) // HealthChecker defines the signature of the client-side LB channel health @@ -295,3 +292,9 @@ type EnforceClientConnEmbedding interface { type Timer interface { Stop() bool } + +// EnforceMetricsRecorderEmbedding is used to enforce proper MetricsRecorder +// implementation embedding. +type EnforceMetricsRecorderEmbedding interface { + enforceMetricsRecorderEmbedding() +} diff --git a/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go index ada5251c..70b89e4d 100644 --- a/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go +++ b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go @@ -125,7 +125,10 @@ func (b *dnsBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts // IP address. if ipAddr, err := formatIP(host); err == nil { addr := []resolver.Address{{Addr: ipAddr + ":" + port}} - cc.UpdateState(resolver.State{Addresses: addr}) + cc.UpdateState(resolver.State{ + Addresses: addr, + Endpoints: []resolver.Endpoint{{Addresses: addr}}, + }) return deadResolver{}, nil } @@ -342,7 +345,15 @@ func (d *dnsResolver) lookup() (*resolver.State, error) { return nil, hostErr } - state := resolver.State{Addresses: addrs} + eps := make([]resolver.Endpoint, 0, len(addrs)) + for _, addr := range addrs { + eps = append(eps, resolver.Endpoint{Addresses: []resolver.Address{addr}}) + } + + state := resolver.State{ + Addresses: addrs, + Endpoints: eps, + } if len(srv) > 0 { state = grpclbstate.Set(state, &grpclbstate.State{BalancerAddresses: srv}) } diff --git a/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go b/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go index d5f7e4d6..1c8c2ab3 100644 --- a/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go +++ b/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go @@ -20,6 +20,7 @@ import ( "fmt" estats "google.golang.org/grpc/experimental/stats" + "google.golang.org/grpc/internal" "google.golang.org/grpc/stats" ) @@ -28,6 +29,7 @@ import ( // It eats any record calls where the label values provided do not match the // number of label keys. type MetricsRecorderList struct { + internal.EnforceMetricsRecorderEmbedding // metricsRecorders are the metrics recorders this list will forward to. metricsRecorders []estats.MetricsRecorder } @@ -113,3 +115,61 @@ func (l *MetricsRecorderList) RecordInt64Gauge(handle *estats.Int64GaugeHandle, metricRecorder.RecordInt64Gauge(handle, incr, labels...) } } + +// RegisterAsyncReporter forwards the registration to all underlying metrics +// recorders. +// +// It returns a cleanup function that, when called, invokes the cleanup function +// returned by each underlying recorder, ensuring the reporter is unregistered +// from all of them. +func (l *MetricsRecorderList) RegisterAsyncReporter(reporter estats.AsyncMetricReporter, metrics ...estats.AsyncMetric) func() { + descriptorsMap := make(map[*estats.MetricDescriptor]bool, len(metrics)) + for _, m := range metrics { + descriptorsMap[m.Descriptor()] = true + } + unregisterFns := make([]func(), 0, len(l.metricsRecorders)) + for _, mr := range l.metricsRecorders { + // Wrap the AsyncMetricsRecorder to intercept calls to RecordInt64Gauge + // and validate the labels. + wrappedCallback := func(recorder estats.AsyncMetricsRecorder) error { + wrappedRecorder := &asyncRecorderWrapper{ + delegate: recorder, + descriptors: descriptorsMap, + } + return reporter.Report(wrappedRecorder) + } + unregisterFns = append(unregisterFns, mr.RegisterAsyncReporter(estats.AsyncMetricReporterFunc(wrappedCallback), metrics...)) + } + + // Wrap the cleanup function using the internal delegate. + // In production, this returns realCleanup as-is. + // In tests, the leak checker can swap this to track the registration lifetime. + return internal.AsyncReporterCleanupDelegate(defaultCleanUp(unregisterFns)) +} + +func defaultCleanUp(unregisterFns []func()) func() { + return func() { + for _, unregister := range unregisterFns { + unregister() + } + } +} + +type asyncRecorderWrapper struct { + delegate estats.AsyncMetricsRecorder + descriptors map[*estats.MetricDescriptor]bool +} + +// RecordIntAsync64Gauge records the measurement alongside labels on the int +// gauge associated with the provided handle. +func (w *asyncRecorderWrapper) RecordInt64AsyncGauge(handle *estats.Int64AsyncGaugeHandle, value int64, labels ...string) { + // Ensure only metrics for descriptors passed during callback registration + // are emitted. + d := handle.Descriptor() + if _, ok := w.descriptors[d]; !ok { + return + } + // Validate labels and delegate. + verifyLabels(d, labels...) + w.delegate.RecordInt64AsyncGauge(handle, value, labels...) +} diff --git a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go index 2dcd1e63..7efa5247 100644 --- a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go +++ b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go @@ -24,16 +24,13 @@ import ( "fmt" "net" "runtime" - "strconv" "sync" "sync/atomic" "golang.org/x/net/http2" "golang.org/x/net/http2/hpack" "google.golang.org/grpc/internal/grpclog" - "google.golang.org/grpc/internal/grpcutil" "google.golang.org/grpc/mem" - "google.golang.org/grpc/status" ) var updateHeaderTblSize = func(e *hpack.Encoder, v uint32) { @@ -147,11 +144,9 @@ type cleanupStream struct { func (c *cleanupStream) isTransportResponseFrame() bool { return c.rst } // Results in a RST_STREAM type earlyAbortStream struct { - httpStatus uint32 - streamID uint32 - contentSubtype string - status *status.Status - rst bool + streamID uint32 + rst bool + hf []hpack.HeaderField // Pre-built header fields } func (*earlyAbortStream) isTransportResponseFrame() bool { return false } @@ -843,18 +838,7 @@ func (l *loopyWriter) earlyAbortStreamHandler(eas *earlyAbortStream) error { if l.side == clientSide { return errors.New("earlyAbortStream not handled on client") } - // In case the caller forgets to set the http status, default to 200. - if eas.httpStatus == 0 { - eas.httpStatus = 200 - } - headerFields := []hpack.HeaderField{ - {Name: ":status", Value: strconv.Itoa(int(eas.httpStatus))}, - {Name: "content-type", Value: grpcutil.ContentType(eas.contentSubtype)}, - {Name: "grpc-status", Value: strconv.Itoa(int(eas.status.Code()))}, - {Name: "grpc-message", Value: encodeGrpcMessage(eas.status.Message())}, - } - - if err := l.writeHeader(eas.streamID, true, headerFields, nil); err != nil { + if err := l.writeHeader(eas.streamID, true, eas.hf, nil); err != nil { return err } if eas.rst { diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index 6f78a6b0..a1a14e14 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -479,13 +479,7 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade if t.logger.V(logLevel) { t.logger.Infof("Aborting the stream early: %v", errMsg) } - t.controlBuf.put(&earlyAbortStream{ - httpStatus: http.StatusBadRequest, - streamID: streamID, - contentSubtype: s.contentSubtype, - status: status.New(codes.Internal, errMsg), - rst: !frame.StreamEnded(), - }) + t.writeEarlyAbort(streamID, s.contentSubtype, status.New(codes.Internal, errMsg), http.StatusBadRequest, !frame.StreamEnded()) return nil } @@ -499,23 +493,11 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade return nil } if !isGRPC { - t.controlBuf.put(&earlyAbortStream{ - httpStatus: http.StatusUnsupportedMediaType, - streamID: streamID, - contentSubtype: s.contentSubtype, - status: status.Newf(codes.InvalidArgument, "invalid gRPC request content-type %q", contentType), - rst: !frame.StreamEnded(), - }) + t.writeEarlyAbort(streamID, s.contentSubtype, status.Newf(codes.InvalidArgument, "invalid gRPC request content-type %q", contentType), http.StatusUnsupportedMediaType, !frame.StreamEnded()) return nil } if headerError != nil { - t.controlBuf.put(&earlyAbortStream{ - httpStatus: http.StatusBadRequest, - streamID: streamID, - contentSubtype: s.contentSubtype, - status: headerError, - rst: !frame.StreamEnded(), - }) + t.writeEarlyAbort(streamID, s.contentSubtype, headerError, http.StatusBadRequest, !frame.StreamEnded()) return nil } @@ -569,13 +551,7 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade if t.logger.V(logLevel) { t.logger.Infof("Aborting the stream early: %v", errMsg) } - t.controlBuf.put(&earlyAbortStream{ - httpStatus: http.StatusMethodNotAllowed, - streamID: streamID, - contentSubtype: s.contentSubtype, - status: status.New(codes.Internal, errMsg), - rst: !frame.StreamEnded(), - }) + t.writeEarlyAbort(streamID, s.contentSubtype, status.New(codes.Internal, errMsg), http.StatusMethodNotAllowed, !frame.StreamEnded()) s.cancel() return nil } @@ -590,27 +566,16 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade if !ok { stat = status.New(codes.PermissionDenied, err.Error()) } - t.controlBuf.put(&earlyAbortStream{ - httpStatus: http.StatusOK, - streamID: s.id, - contentSubtype: s.contentSubtype, - status: stat, - rst: !frame.StreamEnded(), - }) + t.writeEarlyAbort(s.id, s.contentSubtype, stat, http.StatusOK, !frame.StreamEnded()) return nil } } if s.ctx.Err() != nil { t.mu.Unlock() + st := status.New(codes.DeadlineExceeded, context.DeadlineExceeded.Error()) // Early abort in case the timeout was zero or so low it already fired. - t.controlBuf.put(&earlyAbortStream{ - httpStatus: http.StatusOK, - streamID: s.id, - contentSubtype: s.contentSubtype, - status: status.New(codes.DeadlineExceeded, context.DeadlineExceeded.Error()), - rst: !frame.StreamEnded(), - }) + t.writeEarlyAbort(s.id, s.contentSubtype, st, http.StatusOK, !frame.StreamEnded()) return nil } @@ -969,13 +934,12 @@ func appendHeaderFieldsFromMD(headerFields []hpack.HeaderField, md metadata.MD) return headerFields } -func (t *http2Server) checkForHeaderListSize(it any) bool { +func (t *http2Server) checkForHeaderListSize(hf []hpack.HeaderField) bool { if t.maxSendHeaderListSize == nil { return true } - hdrFrame := it.(*headerFrame) var sz int64 - for _, f := range hdrFrame.hf { + for _, f := range hf { if sz += int64(f.Size()); sz > int64(*t.maxSendHeaderListSize) { if t.logger.V(logLevel) { t.logger.Infof("Header list size to send violates the maximum size (%d bytes) set by client", *t.maxSendHeaderListSize) @@ -986,6 +950,42 @@ func (t *http2Server) checkForHeaderListSize(it any) bool { return true } +// writeEarlyAbort sends an early abort response with the given HTTP status and +// gRPC status. If the header list size exceeds the peer's limit, it sends a +// RST_STREAM instead. +func (t *http2Server) writeEarlyAbort(streamID uint32, contentSubtype string, stat *status.Status, httpStatus uint32, rst bool) { + hf := []hpack.HeaderField{ + {Name: ":status", Value: strconv.Itoa(int(httpStatus))}, + {Name: "content-type", Value: grpcutil.ContentType(contentSubtype)}, + {Name: "grpc-status", Value: strconv.Itoa(int(stat.Code()))}, + {Name: "grpc-message", Value: encodeGrpcMessage(stat.Message())}, + } + if p := istatus.RawStatusProto(stat); len(p.GetDetails()) > 0 { + stBytes, err := proto.Marshal(p) + if err != nil { + t.logger.Errorf("Failed to marshal rpc status: %s, error: %v", pretty.ToJSON(p), err) + } + if err == nil { + hf = append(hf, hpack.HeaderField{Name: grpcStatusDetailsBinHeader, Value: encodeBinHeader(stBytes)}) + } + } + success, _ := t.controlBuf.executeAndPut(func() bool { + return t.checkForHeaderListSize(hf) + }, &earlyAbortStream{ + streamID: streamID, + rst: rst, + hf: hf, + }) + if !success { + t.controlBuf.put(&cleanupStream{ + streamID: streamID, + rst: true, + rstCode: http2.ErrCodeInternal, + onWrite: func() {}, + }) + } +} + func (t *http2Server) streamContextErr(s *ServerStream) error { select { case <-t.done: @@ -1041,7 +1041,7 @@ func (t *http2Server) writeHeaderLocked(s *ServerStream) error { endStream: false, onWrite: t.setResetPingStrikes, } - success, err := t.controlBuf.executeAndPut(func() bool { return t.checkForHeaderListSize(hf) }, hf) + success, err := t.controlBuf.executeAndPut(func() bool { return t.checkForHeaderListSize(hf.hf) }, hf) if !success { if err != nil { return err @@ -1111,7 +1111,7 @@ func (t *http2Server) writeStatus(s *ServerStream, st *status.Status) error { } success, err := t.controlBuf.executeAndPut(func() bool { - return t.checkForHeaderListSize(trailingHeader) + return t.checkForHeaderListSize(trailingHeader.hf) }, nil) if !success { if err != nil { diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go index 6daf1e00..10b9155f 100644 --- a/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -378,12 +378,28 @@ func (s *Stream) ReadMessageHeader(header []byte) (err error) { return nil } +// ceil returns the ceil after dividing the numerator and denominator while +// avoiding integer overflows. +func ceil(numerator, denominator int) int { + if numerator == 0 { + return 0 + } + return (numerator-1)/denominator + 1 +} + // Read reads n bytes from the wire for this stream. func (s *Stream) read(n int) (data mem.BufferSlice, err error) { // Don't request a read if there was an error earlier if er := s.trReader.er; er != nil { return nil, er } + // gRPC Go accepts data frames with a maximum length of 16KB. Larger + // messages must be split into multiple frames. We pre-allocate the + // buffer to avoid resizing during the read loop, but cap the initial + // capacity to 128 frames (2MB) to prevent over-allocation or panics + // when reading extremely large streams. + allocCap := min(ceil(n, http2MaxFrameLen), 128) + data = make(mem.BufferSlice, 0, allocCap) s.readRequester.requestRead(n) for n != 0 { buf, err := s.trReader.Read(n) @@ -574,9 +590,14 @@ type CallHdr struct { DoneFunc func() // called when the stream is finished - // Authority is used to explicitly override the `:authority` header. If set, - // this value takes precedence over the Host field and will be used as the - // value for the `:authority` header. + // Authority is used to explicitly override the `:authority` header. + // + // This value comes from one of two sources: + // 1. The `CallAuthority` call option, if specified by the user. + // 2. An override provided by the LB picker (e.g. xDS authority rewriting). + // + // The `CallAuthority` call option always takes precedence over the LB + // picker override. Authority string } diff --git a/vendor/google.golang.org/grpc/mem/buffer_pool.go b/vendor/google.golang.org/grpc/mem/buffer_pool.go index e37afdd1..2ea763a4 100644 --- a/vendor/google.golang.org/grpc/mem/buffer_pool.go +++ b/vendor/google.golang.org/grpc/mem/buffer_pool.go @@ -53,7 +53,7 @@ var defaultBufferPool BufferPool func init() { defaultBufferPool = NewTieredBufferPool(defaultBufferPoolSizes...) - internal.SetDefaultBufferPoolForTesting = func(pool BufferPool) { + internal.SetDefaultBufferPool = func(pool BufferPool) { defaultBufferPool = pool } diff --git a/vendor/google.golang.org/grpc/mem/buffers.go b/vendor/google.golang.org/grpc/mem/buffers.go index ecbf0b9a..db1620e6 100644 --- a/vendor/google.golang.org/grpc/mem/buffers.go +++ b/vendor/google.golang.org/grpc/mem/buffers.go @@ -62,7 +62,6 @@ var ( bufferPoolingThreshold = 1 << 10 bufferObjectPool = sync.Pool{New: func() any { return new(buffer) }} - refObjectPool = sync.Pool{New: func() any { return new(atomic.Int32) }} ) // IsBelowBufferPoolingThreshold returns true if the given size is less than or @@ -73,9 +72,19 @@ func IsBelowBufferPoolingThreshold(size int) bool { } type buffer struct { + refs atomic.Int32 + data []byte + + // rootBuf is the buffer responsible for returning origData to the pool + // once the reference count drops to 0. + // + // When a buffer is split, the new buffer inherits the rootBuf of the + // original and increments the root's reference count. For the + // initial buffer (the root), this field points to itself. + rootBuf *buffer + + // The following fields are only set for root buffers. origData *[]byte - data []byte - refs *atomic.Int32 pool BufferPool } @@ -103,8 +112,8 @@ func NewBuffer(data *[]byte, pool BufferPool) Buffer { b.origData = data b.data = *data b.pool = pool - b.refs = refObjectPool.Get().(*atomic.Int32) - b.refs.Add(1) + b.rootBuf = b + b.refs.Store(1) return b } @@ -127,42 +136,44 @@ func Copy(data []byte, pool BufferPool) Buffer { } func (b *buffer) ReadOnlyData() []byte { - if b.refs == nil { + if b.rootBuf == nil { panic("Cannot read freed buffer") } return b.data } func (b *buffer) Ref() { - if b.refs == nil { + if b.refs.Add(1) <= 1 { panic("Cannot ref freed buffer") } - b.refs.Add(1) } func (b *buffer) Free() { - if b.refs == nil { + refs := b.refs.Add(-1) + if refs < 0 { panic("Cannot free freed buffer") } - - refs := b.refs.Add(-1) - switch { - case refs > 0: + if refs > 0 { return - case refs == 0: + } + + b.data = nil + if b.rootBuf == b { + // This buffer is the owner of the data slice and its ref count reached + // 0, free the slice. if b.pool != nil { b.pool.Put(b.origData) + b.pool = nil } - - refObjectPool.Put(b.refs) b.origData = nil - b.data = nil - b.refs = nil - b.pool = nil - bufferObjectPool.Put(b) - default: - panic("Cannot free freed buffer") + } else { + // This buffer doesn't own the data slice, decrement a ref on the root + // buffer. + b.rootBuf.Free() } + + b.rootBuf = nil + bufferObjectPool.Put(b) } func (b *buffer) Len() int { @@ -170,16 +181,14 @@ func (b *buffer) Len() int { } func (b *buffer) split(n int) (Buffer, Buffer) { - if b.refs == nil { + if b.rootBuf == nil || b.rootBuf.refs.Add(1) <= 1 { panic("Cannot split freed buffer") } - b.refs.Add(1) split := newBuffer() - split.origData = b.origData split.data = b.data[n:] - split.refs = b.refs - split.pool = b.pool + split.rootBuf = b.rootBuf + split.refs.Store(1) b.data = b.data[:n] @@ -187,7 +196,7 @@ func (b *buffer) split(n int) (Buffer, Buffer) { } func (b *buffer) read(buf []byte) (int, Buffer) { - if b.refs == nil { + if b.rootBuf == nil { panic("Cannot read freed buffer") } diff --git a/vendor/google.golang.org/grpc/resolver/resolver.go b/vendor/google.golang.org/grpc/resolver/resolver.go index 8e6af951..598ed21a 100644 --- a/vendor/google.golang.org/grpc/resolver/resolver.go +++ b/vendor/google.golang.org/grpc/resolver/resolver.go @@ -182,6 +182,7 @@ type BuildOptions struct { // An Endpoint is one network endpoint, or server, which may have multiple // addresses with which it can be accessed. +// TODO(i/8773) : make resolver.Endpoint and resolver.Address immutable type Endpoint struct { // Addresses contains a list of addresses used to access this endpoint. Addresses []Address diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index ddd37734..1b5cefe8 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -923,9 +923,7 @@ func (s *Server) Serve(lis net.Listener) error { tempDelay = 5 * time.Millisecond } else { tempDelay *= 2 - } - if max := 1 * time.Second; tempDelay > max { - tempDelay = max + tempDelay = min(tempDelay, 1*time.Second) } s.mu.Lock() s.printf("Accept error: %v; retrying in %v", err, tempDelay) diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index ec9577b2..f92102fb 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -52,7 +52,8 @@ import ( var metadataFromOutgoingContextRaw = internal.FromOutgoingContextRaw.(func(context.Context) (metadata.MD, [][]string, bool)) // StreamHandler defines the handler called by gRPC server to complete the -// execution of a streaming RPC. +// execution of a streaming RPC. srv is the service implementation on which the +// RPC was invoked. // // If a StreamHandler returns an error, it should either be produced by the // status package, or be one of the context errors. Otherwise, gRPC will use @@ -537,8 +538,16 @@ func (a *csAttempt) newStream() error { md, _ := metadata.FromOutgoingContext(a.ctx) md = metadata.Join(md, a.pickResult.Metadata) a.ctx = metadata.NewOutgoingContext(a.ctx, md) - } + // If the `CallAuthority` CallOption is not set, check if the LB picker + // has provided an authority override in the PickResult metadata and + // apply it, as specified in gRFC A81. + if cs.callInfo.authority == "" { + if authMD := a.pickResult.Metadata.Get(":authority"); len(authMD) > 0 { + cs.callHdr.Authority = authMD[0] + } + } + } s, err := a.transport.NewStream(a.ctx, cs.callHdr) if err != nil { nse, ok := err.(*transport.NewStreamError) @@ -1341,6 +1350,7 @@ func newNonRetryClientStream(ctx context.Context, desc *StreamDesc, method strin codec: c.codec, sendCompressorV0: cp, sendCompressorV1: comp, + decompressorV0: ac.cc.dopts.dc, transport: t, } diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index ff7840fd..c1225b91 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.78.0" +const Version = "1.79.1" diff --git a/vendor/modules.txt b/vendor/modules.txt index 845768e2..825a46dd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -164,7 +164,7 @@ github.com/mxk/go-flowrate/flowrate # github.com/navidys/tvxwidgets v0.11.1 ## explicit; go 1.23.3 github.com/navidys/tvxwidgets -# github.com/netobserv/flowlogs-pipeline v1.11.0-community +# github.com/netobserv/flowlogs-pipeline v1.11.2-community ## explicit; go 1.25.0 github.com/netobserv/flowlogs-pipeline/pkg/api github.com/netobserv/flowlogs-pipeline/pkg/config @@ -172,18 +172,9 @@ github.com/netobserv/flowlogs-pipeline/pkg/pipeline/utils github.com/netobserv/flowlogs-pipeline/pkg/pipeline/write/grpc github.com/netobserv/flowlogs-pipeline/pkg/pipeline/write/grpc/genericmap github.com/netobserv/flowlogs-pipeline/pkg/utils -# github.com/netobserv/netobserv-ebpf-agent v1.10.1-community -## explicit; go 1.24.0 +# github.com/netobserv/netobserv-ebpf-agent v1.11.1-community +## explicit; go 1.25.0 github.com/netobserv/netobserv-ebpf-agent/pkg/utils -# github.com/netsampler/goflow2 v1.3.7 -## explicit; go 1.18 -github.com/netsampler/goflow2/decoders/netflow -github.com/netsampler/goflow2/decoders/netflow/templates -github.com/netsampler/goflow2/decoders/netflowlegacy -github.com/netsampler/goflow2/decoders/sflow -github.com/netsampler/goflow2/decoders/utils -github.com/netsampler/goflow2/pb -github.com/netsampler/goflow2/producer # github.com/onsi/ginkgo/v2 v2.27.3 ## explicit; go 1.23.0 github.com/onsi/ginkgo/v2 @@ -297,14 +288,14 @@ github.com/xdg-go/scram # github.com/xdg-go/stringprep v1.0.4 ## explicit; go 1.11 github.com/xdg-go/stringprep -# go.opentelemetry.io/otel v1.39.0 +# go.opentelemetry.io/otel v1.40.0 ## explicit; go 1.24.0 go.opentelemetry.io/otel/attribute go.opentelemetry.io/otel/attribute/internal go.opentelemetry.io/otel/attribute/internal/xxhash go.opentelemetry.io/otel/codes -go.opentelemetry.io/otel/semconv/v1.37.0 -# go.opentelemetry.io/otel/trace v1.39.0 +go.opentelemetry.io/otel/semconv/v1.39.0 +# go.opentelemetry.io/otel/trace v1.40.0 ## explicit; go 1.24.0 go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded @@ -315,10 +306,10 @@ go.yaml.in/yaml/v2 # go.yaml.in/yaml/v3 v3.0.4 ## explicit; go 1.16 go.yaml.in/yaml/v3 -# golang.org/x/mod v0.30.0 +# golang.org/x/mod v0.31.0 ## explicit; go 1.24.0 golang.org/x/mod/semver -# golang.org/x/net v0.48.0 +# golang.org/x/net v0.49.0 ## explicit; go 1.24.0 golang.org/x/net/bpf golang.org/x/net/html @@ -343,15 +334,15 @@ golang.org/x/oauth2/internal # golang.org/x/sync v0.19.0 ## explicit; go 1.24.0 golang.org/x/sync/errgroup -# golang.org/x/sys v0.40.0 +# golang.org/x/sys v0.41.0 ## explicit; go 1.24.0 golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/term v0.38.0 +# golang.org/x/term v0.39.0 ## explicit; go 1.24.0 golang.org/x/term -# golang.org/x/text v0.32.0 +# golang.org/x/text v0.33.0 ## explicit; go 1.24.0 golang.org/x/text/encoding golang.org/x/text/encoding/charmap @@ -376,7 +367,7 @@ golang.org/x/text/unicode/norm # golang.org/x/time v0.11.0 ## explicit; go 1.23.0 golang.org/x/time/rate -# golang.org/x/tools v0.39.0 +# golang.org/x/tools v0.40.0 ## explicit; go 1.24.0 golang.org/x/tools/cover golang.org/x/tools/go/ast/edge @@ -398,10 +389,10 @@ golang.org/x/tools/internal/stdlib golang.org/x/tools/internal/typeparams golang.org/x/tools/internal/typesinternal golang.org/x/tools/internal/versions -# google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 ## explicit; go 1.24.0 google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.78.0 +# google.golang.org/grpc v1.79.1 ## explicit; go 1.24.0 google.golang.org/grpc google.golang.org/grpc/attributes @@ -428,6 +419,7 @@ google.golang.org/grpc/grpclog/internal google.golang.org/grpc/internal google.golang.org/grpc/internal/backoff google.golang.org/grpc/internal/balancer/gracefulswitch +google.golang.org/grpc/internal/balancer/weight google.golang.org/grpc/internal/balancerload google.golang.org/grpc/internal/binarylog google.golang.org/grpc/internal/buffer