diff --git a/CHANGELOG.md b/CHANGELOG.md index 55aa9f232..78b4c9b7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ ### Breaking +- **Listeners: no TCP port by default, auth on by default.** xtcp2 now serves health, metrics and the link monitor's detail paths on one Unix socket, `/run/xtcp2/metrics.sock` (mode `0600`), with a raw bearer token from `LISTENER_RAW_TOKEN_FILE`, and exits 64 without one. It no longer listens on `:9088` or `:8889`: gRPC, pprof and `/ip` are served only by a listener that names them. `-listener` (repeatable) / `LISTENERS` describes each listener, its credentials (files only) and the classes it serves: `health`, `metrics`, `metrics-detail`, `ip`, `debug`, `grpc-read`, `grpc-admin` ([listeners](docs/security.md#listeners)). TCP must be typed (`network=tcp`) and needs a credential unless it is loopback or serves health alone; `debug` and `grpc-admin` need an admin credential; pprof never serves `cmdline`. A `grpc-read` listener answers admin RPCs `Unimplemented`. Bad listener config, a missing token or token file exits 64; `ConfigService.Set` refuses the same. +- **The per-listener flags are deprecated.** `-promListen*`, `-grpcPort`, `-grpcListen*`, `-grpc*UnixSocket*`, `-linkMonitorIPListen` and their variables still work, expanded to listeners with a `DEPRECATED` line naming the `-listener` equivalent; the Prometheus listener they describe no longer serves pprof, and as TCP it now needs a token. Giving them with `-listener` exits 64. An empty `-listenerAuthMode` / `LISTENER_AUTH_MODE=` now means unset (raw), not disabled. +- **Clients dial the gRPC socket.** `xtcp2ctl` and `xtcp2client` default to `unix:/run/xtcp2/grpc.sock`; pass `-network tcp` for a TCP listener. The OCI images expose no ports, and `-healthcheck` probes the listener serving `health` from the same settings as the daemon. The NixOS module gains `listeners` and `listenerTokenFile` (null generates a token once, at `/var/lib/xtcp2/listener-token`); `linkMonitor.ipListen` becomes a loopback `ip` listener. New gauge `xtcp2_listener_active{name,network,class}`. - **S3 uses TLS unless told otherwise.** A bare `host:port` S3 endpoint now uses TLS (it was plaintext), and `http://` is refused at startup (exit 64) unless `-s3AllowInsecure` / `S3_ALLOW_INSECURE=true`, which logs a warning and sets `xtcp2_s3_insecure 1`. TLS 1.2 is the minimum; `-s3CAFile` / `S3_CA_FILE` adds a private CA. `ConfigService.Set` refuses a plaintext endpoint without the opt-in. - **Credentials on the command line.** The production (slim) flavors refuse `-s3AccessKey`, `-s3SecretKey` and the four `-listener*` secret flags with exit 64; development builds warn, now for the S3 flags too and even when the env var is also set. Use the `_FILE` variables. - **`_FILE` secrets are checked.** A missing or unreadable `*_FILE` path, a non-regular file, or one readable by group or others stops startup with exit 64. It used to be ignored silently (listener tokens) or logged (S3 keys), leaving the credential empty. Mount secrets mode `0400`. diff --git a/README.md b/README.md index a5d2b33b1..ecbef5741 100644 --- a/README.md +++ b/README.md @@ -28,29 +28,33 @@ cd xtcp2 # 2. Build the main daemon (or `nix develop` for a full dev shell) nix build .#xtcp2 -# 3. Run it against the local host, discarding output, with verbose logging -sudo ./result/bin/xtcp2 -dest null -d 333 +# 3. A bearer token for its listeners, readable only by root +sudo install -d -m 0700 /etc/xtcp2 +sudo sh -c 'umask 077; head -c 32 /dev/urandom | base64 > /etc/xtcp2/token' + +# 4. Run it against the local host, discarding output, with verbose logging. +# Metrics on /run/xtcp2/metrics.sock (the default), gRPC on /run/xtcp2/grpc.sock. +sudo LISTENER_RAW_TOKEN_FILE=/etc/xtcp2/token ./result/bin/xtcp2 -dest null -d 333 \ + -listener name=metrics,serves=health+metrics+metrics-detail,address=/run/xtcp2/metrics.sock \ + -listener name=grpc,serves=grpc-admin,address=/run/xtcp2/grpc.sock ``` -Stream to Kafka/Redpanda instead: - -```sh -sudo ./result/bin/xtcp2 -dest kafka:127.0.0.1:9092 -topic xtcp -``` +xtcp2 opens no TCP port unless a listener asks for one, and refuses to start without a token; see [listeners](docs/security.md#listeners). Stream to Kafka/Redpanda instead with `-dest kafka:127.0.0.1:9092 -topic xtcp`. Inspect TCP records live over gRPC, in a second terminal: ```sh nix build .#xtcp2client -o result-client -./result-client/bin/xtcp2client # streams XtcpFlatRecord from the running daemon +sudo XTCP2_GRPC_AUTH_TOKEN_FILE=/etc/xtcp2/token ./result-client/bin/xtcp2client # streams XtcpFlatRecord ``` The daemon also enables its embedded link monitor by default. Inspect it from another terminal: ```sh -curl -fsS http://localhost:9088/metrics # daemon metrics and link-health summary -curl -fsS http://localhost:9088/metrics/link # link detail -curl -fsS http://localhost:9088/metrics/driver # detailed driver/PHY counters +xc() { sudo curl -fsS --unix-socket /run/xtcp2/metrics.sock -H "Authorization: Bearer $(sudo cat /etc/xtcp2/token)" "http://xtcp2$1"; } +xc /metrics # daemon metrics and link-health summary +xc /metrics/link # link detail +xc /metrics/driver # detailed driver/PHY counters ``` For link monitoring alone, run the standalone exporter: @@ -79,8 +83,7 @@ Run `./result/bin/xtcp2 -help` for the full flag list. Common flags: | `-marshal` | `protobufList` | Wire format (`protobufList`, `protoJson`, `protoText`, `msgpack`, `jsonl`, `csv`, `tsv`) | | `-netlinkers` | `2` | Parallel decoders per socket (one receiver reads each socket) | | `-deserializers` | `all` | Which inet_diag attributes to decode | -| `-promListen` | `:9088` | Prometheus metrics listener | -| `-grpcPort` | `8889` | gRPC API port | +| `-listener` | `/run/xtcp2/metrics.sock` | A listener, repeatable: socket or TCP address, credentials, and what it serves ([listeners](docs/security.md#listeners)) | | `-linkMonitor` | `true` | Embedded Ethernet/RDMA link monitor | | `-d` | `111` | Debug verbosity (higher = more) | @@ -102,7 +105,7 @@ The `goip` tool and its supporting Go code implement an expanding subset of ipro Optional `/ip/...` HTTP paths expose supported read-only goip commands for remote investigation, including forms such as `/ip/addr/show/dev/eth0` and `/ip/link`. Enable them with `-linkMonitorIPPaths` in xtcp2 or `-ip.paths` in the standalone monitor. `goip-parity` checks requests and output against iproute2; coverage is evolving, so goip is not yet a complete replacement. Its implemented write verbs currently produce **dry-run request files only**, not kernel changes. -xtcp2 can instead move `/ip` and `/i` to a dedicated loopback listener with `-linkMonitorIPListen 127.0.0.1:9089`. That listener deliberately has no bearer authentication and rejects non-loopback peers; see the [security tradeoffs](docs/security.md#optional-loopback-inspection-listener) before enabling it. +xtcp2 can serve `/ip` and `/i` on a dedicated loopback listener, `-listener name=ip,serves=ip,address=127.0.0.1:9089,network=tcp,auth=disabled`. That listener deliberately has no bearer authentication and rejects non-loopback peers; see the [security tradeoffs](docs/security.md#optional-loopback-inspection-listener) before enabling it. Details: [netlink and goip overview](docs/netlink/README.md), [coverage and parity status](docs/netlink/coverage-status.md), [HTTP command paths](cmd/go-link-monitor/IP-ARGV-PATHS-DESIGN.md). diff --git a/cmd/xtcp2/exit.go b/cmd/xtcp2/exit.go index 1bb94ddaf..5f3b271ab 100644 --- a/cmd/xtcp2/exit.go +++ b/cmd/xtcp2/exit.go @@ -3,6 +3,8 @@ package main import ( "errors" + "github.com/randomizedcoder/xtcp2/pkg/listeners" + "github.com/randomizedcoder/xtcp2/pkg/secretfile" "github.com/randomizedcoder/xtcp2/pkg/xtcp" ) @@ -22,7 +24,9 @@ func exitCodeFor(err error) int { return exitOK case errors.Is(err, errUsage), errors.Is(err, xtcp.ErrNotCompiledIn), - errors.Is(err, xtcp.ErrInsecureTransport): + errors.Is(err, xtcp.ErrInsecureTransport), + errors.Is(err, listeners.ErrConfig), + errors.Is(err, secretfile.ErrSecretFile): return exitUsage default: return exitFailure diff --git a/cmd/xtcp2/exit_test.go b/cmd/xtcp2/exit_test.go index 132595eb2..6bd3bbcd4 100644 --- a/cmd/xtcp2/exit_test.go +++ b/cmd/xtcp2/exit_test.go @@ -7,7 +7,6 @@ import ( "os" "path/filepath" "strings" - "sync" "testing" "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" @@ -73,13 +72,13 @@ func TestRunMain_debugWritersNotCompiledIn(t *testing.T) { os.Args = append([]string{"xtcp2"}, tc.args...) t.Cleanup(func() { os.Args = prevArgs }) - prevProm := promHandlerStarter - promHandlerStarter = func(context.Context, *sync.WaitGroup, promParams) error { return nil } - t.Cleanup(func() { promHandlerStarter = prevProm }) + stubListeners(t) prevDaemon := daemonRunner started := false - daemonRunner = func(context.Context, context.CancelFunc, *xtcp_config.XtcpConfig) { started = true } + daemonRunner = func(context.Context, context.CancelFunc, *xtcp_config.XtcpConfig, []xtcp.GRPCListener) { + started = true + } t.Cleanup(func() { daemonRunner = prevDaemon }) wantRC, wantStarted := exitUsage, false diff --git a/cmd/xtcp2/http_server.go b/cmd/xtcp2/http_server.go new file mode 100644 index 000000000..f73f53313 --- /dev/null +++ b/cmd/xtcp2/http_server.go @@ -0,0 +1,59 @@ +package main + +import ( + "context" + "errors" + "log" + "net" + "net/http" + "sync" + "time" +) + +// httpShutdownGrace bounds the drain of in-flight requests at shutdown. It is +// under cancelSleepTimeCst, so the drain finishes before the signal handler +// gives up and exits. +const httpShutdownGrace = 3 * time.Second + +// fatalf is the package-level abort handler. Defaults to log.Fatalf; +// tests swap this in for a capture so the serve error branch is +// exercisable without exiting. +var fatalf = log.Fatalf + +func newHTTPServer(handler http.Handler) *http.Server { + return &http.Server{ + Handler: handler, + ReadHeaderTimeout: 5 * time.Second, + ReadTimeout: 10 * time.Second, + // The link monitor's detail paths answer within their own 10s + // timeout; the write deadline leaves room to send the body. + WriteTimeout: 15 * time.Second, + IdleTimeout: 30 * time.Second, + } +} + +// serveHTTP serves ln until ctx ends, then drains in-flight requests for at +// most grace before closing what remains. A serve failure while ctx is live +// calls failed. name prefixes the shutdown logs. +func serveHTTP(ctx context.Context, wg *sync.WaitGroup, name string, srv *http.Server, ln net.Listener, grace time.Duration, failed func(error)) { + defer wg.Done() + served := make(chan error, 1) + go func() { served <- srv.Serve(ln) }() + select { + case err := <-served: + failed(err) + return + case <-ctx.Done(): + } + shutdownCtx, cancel := context.WithTimeout(context.WithoutCancel(ctx), grace) + defer cancel() + if err := srv.Shutdown(shutdownCtx); err != nil { + log.Printf("%s shutdown: %v; closing", name, err) + if err := srv.Close(); err != nil { + log.Printf("%s close: %v", name, err) + } + } + if err := <-served; !errors.Is(err, http.ErrServerClosed) { + log.Printf("%s serve: %v", name, err) + } +} diff --git a/cmd/xtcp2/http_server_test.go b/cmd/xtcp2/http_server_test.go new file mode 100644 index 000000000..31e941908 --- /dev/null +++ b/cmd/xtcp2/http_server_test.go @@ -0,0 +1,420 @@ +package main + +import ( + "context" + "fmt" + "net" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "sync" + "sync/atomic" + "syscall" + "testing" + "time" + + "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" + "github.com/randomizedcoder/xtcp2/pkg/listeners" + "github.com/randomizedcoder/xtcp2/pkg/xtcp" +) + +// unixClient is an HTTP client for the listener on sock. +func unixClient(sock string) *http.Client { + return &http.Client{ + Timeout: 5 * time.Second, + Transport: &http.Transport{DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) { + return (&net.Dialer{}).DialContext(ctx, "unix", sock) + }}, + } +} + +// getStatus GETs path, with a bearer token unless token is empty. +func getStatus(t *testing.T, c *http.Client, path, token string) int { + t.Helper() + req, err := http.NewRequest(http.MethodGet, "http://listener"+path, nil) + if err != nil { + t.Fatal(err) + } + if token != "" { + req.Header.Set("Authorization", "Bearer "+token) + } + resp, err := c.Do(req) + if err != nil { + t.Fatalf("GET %s: %v", path, err) + } + _ = resp.Body.Close() + return resp.StatusCode +} + +// waitReturns fails t unless wg.Wait returns within d. +func waitReturns(t *testing.T, wg *sync.WaitGroup, d time.Duration) { + t.Helper() + done := make(chan struct{}) + go func() { wg.Wait(); close(done) }() + select { + case <-done: + case <-time.After(d): + t.Fatalf("WaitGroup still waiting after %v", d) + } +} + +// writeToken writes a 0600 token file and returns its path. +func writeToken(t *testing.T, dir, token string) string { + t.Helper() + p := filepath.Join(dir, "token") + if err := os.WriteFile(p, []byte(token+"\n"), 0o600); err != nil { + t.Fatal(err) + } + return p +} + +// unixListener is a listener on dir/.sock serving classes. +func unixListener(dir, name string, auth *xtcp_config.ListenerAuth, classes ...xtcp_config.EndpointClass) *xtcp_config.Listener { + return &xtcp_config.Listener{ + Name: name, + Endpoint: &xtcp_config.ListenerEndpoint{Address: filepath.Join(dir, name+".sock")}, + Auth: auth, + Serves: classes, + } +} + +var authOff = &xtcp_config.ListenerAuth{Mode: xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_DISABLED} + +// TestStartListeners binds real listeners from a resolved config and checks +// what each serves: a path of a class a listener does not serve is 404, an +// unauthenticated request to an authenticated one is 401, and a bind +// failure fails startup with nothing left bound. +func TestStartListeners(t *testing.T) { + type req struct { + listener, path, token string + expected int + } + tests := []struct { + name, category, description string + listeners func(t *testing.T, dir string) []*xtcp_config.Listener + ipPaths bool + promPath string + requests []req + grpc int + wantErr string + }{ + { + name: "default_shape", category: "positive", + description: "health, metrics and metrics-detail on a socket; pprof and /ip are not served", + listeners: func(_ *testing.T, dir string) []*xtcp_config.Listener { + return []*xtcp_config.Listener{unixListener(dir, "metrics", authOff, listeners.Health, listeners.Metrics, listeners.MetricsDetail)} + }, + requests: []req{ + {"metrics", "/metrics", "", http.StatusOK}, + {"metrics", "/healthz", "", http.StatusOK}, + {"metrics", "/debug/pprof/", "", http.StatusNotFound}, + {"metrics", "/ip/link", "", http.StatusNotFound}, + }, + }, + { + name: "raw_token", category: "negative", + description: "a listener with a token refuses a request without it", + listeners: func(t *testing.T, dir string) []*xtcp_config.Listener { + a := &xtcp_config.ListenerAuth{Mode: xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN, RawTokenFile: writeToken(t, dir, "s3cret")} + return []*xtcp_config.Listener{unixListener(dir, "metrics", a, listeners.Health, listeners.Metrics)} + }, + requests: []req{ + {"metrics", "/metrics", "", http.StatusUnauthorized}, + {"metrics", "/metrics", "wrong", http.StatusUnauthorized}, + {"metrics", "/metrics", "s3cret", http.StatusOK}, + }, + }, + { + name: "debug_listener", category: "positive", + description: "pprof only on the debug listener, never cmdline; the metrics listener has no pprof", + listeners: func(t *testing.T, dir string) []*xtcp_config.Listener { + a := &xtcp_config.ListenerAuth{Mode: xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN, RawTokenFile: writeToken(t, dir, "admin")} + return []*xtcp_config.Listener{ + unixListener(dir, "metrics", authOff, listeners.Health, listeners.Metrics), + unixListener(dir, "debug", a, listeners.Debug), + } + }, + requests: []req{ + {"debug", "/debug/pprof/", "admin", http.StatusOK}, + {"debug", "/debug/pprof/cmdline", "admin", http.StatusNotFound}, + {"debug", "/debug/pprof/", "", http.StatusUnauthorized}, + {"debug", "/metrics", "admin", http.StatusNotFound}, + {"metrics", "/debug/pprof/", "", http.StatusNotFound}, + }, + }, + { + name: "ip_listener", category: "positive", + description: "the ip class serves /ip and /i (404 until a daemon attaches) and nothing else", + ipPaths: true, + listeners: func(_ *testing.T, dir string) []*xtcp_config.Listener { + return []*xtcp_config.Listener{ + unixListener(dir, "metrics", authOff, listeners.Health, listeners.Metrics), + unixListener(dir, "ip", authOff, listeners.IP), + } + }, + requests: []req{ + {"ip", "/ip/link", "", http.StatusNotFound}, + {"ip", "/metrics", "", http.StatusNotFound}, + {"ip", "/healthz", "", http.StatusNotFound}, + }, + }, + { + name: "root_prom_path", category: "corner", + description: "a promPath of / serves metrics on every path and mounts no detail routes", + promPath: "/", + listeners: func(_ *testing.T, dir string) []*xtcp_config.Listener { + return []*xtcp_config.Listener{unixListener(dir, "metrics", authOff, listeners.Health, listeners.Metrics, listeners.MetricsDetail)} + }, + requests: []req{{"metrics", "/anything", "", http.StatusOK}, {"metrics", "/healthz", "", http.StatusOK}}, + }, + { + name: "grpc_returned", category: "boundary", + description: "a gRPC listener is bound and handed to the daemon, not served over HTTP", + listeners: func(_ *testing.T, dir string) []*xtcp_config.Listener { + return []*xtcp_config.Listener{ + unixListener(dir, "metrics", authOff, listeners.Health), + unixListener(dir, "grpc", authOff, listeners.GRPCRead), + } + }, + grpc: 1, + }, + { + name: "ip_prom_path_collision", category: "negative", + description: "a promPath that is an ip route on the same listener is refused before binding", + ipPaths: true, + promPath: "/ip", + listeners: func(_ *testing.T, dir string) []*xtcp_config.Listener { + return []*xtcp_config.Listener{unixListener(dir, "metrics", authOff, listeners.Health, listeners.Metrics, listeners.IP)} + }, + wantErr: "is an ip route", + }, + { + name: "second_bind_fails", category: "corner", + description: "a port in use fails startup and the listener bound before it is closed", + listeners: func(t *testing.T, dir string) []*xtcp_config.Listener { + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { _ = ln.Close() }) + return []*xtcp_config.Listener{ + unixListener(dir, "metrics", authOff, listeners.Health, listeners.Metrics), + {Name: "tcp", Serves: []xtcp_config.EndpointClass{listeners.MetricsDetail}, Auth: authOff, + Endpoint: &xtcp_config.ListenerEndpoint{Network: xtcp_config.ListenerNetwork_LISTENER_NETWORK_TCP, Address: ln.Addr().String()}}, + } + }, + wantErr: `listener "tcp"`, + }, + } + for _, tc := range tests { + t.Run(tc.category+"/"+tc.name, func(t *testing.T) { + t.Logf("%s: %s", tc.category, tc.description) + dir, err := os.MkdirTemp("/tmp", "xtcp2-ls-") // short: sun_path is 108 bytes + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { _ = os.RemoveAll(dir) }) + c := &xtcp_config.XtcpConfig{Listeners: tc.listeners(t, dir), LinkMonitor: &xtcp_config.LinkMonitorConfig{IpPaths: tc.ipPaths}} + specs, _, err := listeners.Resolve(c, readSecretFile) + if err != nil { + t.Fatal(err) + } + promPath := tc.promPath + if promPath == "" { + promPath = "/metrics" + } + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + var wg sync.WaitGroup + grpcLns, err := startListeners(ctx, &wg, specs, promPath) + if tc.wantErr != "" { + if err == nil || !strings.Contains(err.Error(), tc.wantErr) { + t.Fatalf("%s: err = %v, want %q", tc.description, err, tc.wantErr) + } + waitReturns(t, &wg, time.Second) + if _, err := os.Lstat(filepath.Join(dir, "metrics.sock")); !os.IsNotExist(err) { + t.Errorf("%s: metrics.sock left behind (%v)", tc.description, err) + } + return + } + if err != nil { + t.Fatal(err) + } + defer closeGRPCListeners(grpcLns) + if len(grpcLns) != tc.grpc { + t.Errorf("%s: %d gRPC listeners returned, want %d", tc.description, len(grpcLns), tc.grpc) + } + for _, r := range tc.requests { + c := unixClient(filepath.Join(dir, r.listener+".sock")) + if got := getStatus(t, c, r.path, r.token); got != r.expected { + t.Errorf("%s: %s GET %s (token %q) = %d, want %d", tc.description, r.listener, r.path, r.token, got, r.expected) + } + } + cancel() + waitReturns(t, &wg, httpShutdownGrace+time.Second) + }) + } +} + +// TestServeHTTP covers the serve worker's two exits: a serve failure while +// running, and a shutdown whose drain outlasts the grace. +func TestServeHTTP(t *testing.T) { + tests := []struct { + name, category, description, expectedOutcome string + classes []xtcp_config.EndpointClass + closeFirst, stall bool + wantFatal string + }{ + {"serve_failure", "negative", "the metrics listener fails while the daemon runs", "fatalf names the listener", + []xtcp_config.EndpointClass{listeners.Metrics}, true, false, `listener "l"`}, + {"serve_failure_ip", "corner", "losing an ip-only listener is logged, not fatal", "no fatal", + []xtcp_config.EndpointClass{listeners.IP}, true, false, ""}, + {"drain_past_grace", "boundary", "a request stalls past the shutdown grace", "server closed, worker returns, no fatal", + []xtcp_config.EndpointClass{listeners.Metrics}, false, true, ""}, + {"idle_shutdown", "positive", "shutdown with nothing in flight", "worker returns at once, no fatal", + []xtcp_config.EndpointClass{listeners.Metrics}, false, false, ""}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + t.Logf("%s: %s; expected: %s", tc.category, tc.description, tc.expectedOutcome) + prev := fatalf + var fatal atomic.Value + fatal.Store("") + fatalf = func(format string, args ...any) { fatal.Store(fmt.Sprintf(format, args...)) } + t.Cleanup(func() { fatalf = prev }) + + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatal(err) + } + release := make(chan struct{}) + defer close(release) + entered := make(chan struct{}, 1) + srv := newHTTPServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + entered <- struct{}{} + <-release + })) + if tc.closeFirst { + _ = ln.Close() + } + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + var wg sync.WaitGroup + wg.Add(1) + failed := httpServeFailed(listeners.Spec{Name: "l", Classes: tc.classes}) + captureLog(t, func() { + go serveHTTP(ctx, &wg, "l", srv, ln, 50*time.Millisecond, failed) + if tc.closeFirst { + waitReturns(t, &wg, time.Second) + } else { + if tc.stall { + go func() { + resp, err := http.Get("http://" + ln.Addr().String() + "/") + if err == nil { + _ = resp.Body.Close() + } + }() + <-entered + } + cancel() + waitReturns(t, &wg, 2*time.Second) + } + }) + if got := fatal.Load().(string); !strings.Contains(got, tc.wantFatal) || (tc.wantFatal == "" && got != "") { + t.Fatalf("fatal = %q, want %q", got, tc.wantFatal) + } + }) + } +} + +// TestLinkMonitorRoutes covers the late-bound link monitor routes and the +// SIGUSR1 target as a daemon comes and goes. +func TestLinkMonitorRoutes(t *testing.T) { + tests := []struct { + name, category, description, expectedOutcome string + attach, detach bool + wantCode int + wantLog string + }{ + {"nothing_attached", "negative", "before a daemon starts", "404, SIGUSR1 ignored", false, false, http.StatusNotFound, "no daemon running"}, + {"daemon_without_monitor", "negative", "a daemon run with -linkMonitor=false", "404, SIGUSR1 rejected as disabled", true, false, http.StatusNotFound, "link monitor is disabled"}, + {"after_detach", "corner", "after the daemon stops, as on a reconfigure", "404, SIGUSR1 ignored", true, true, http.StatusNotFound, "no daemon running"}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + t.Logf("%s: %s; expected: %s", tc.category, tc.description, tc.expectedOutcome) + l := &linkMonitorRoutes{promPath: "/metrics"} + if tc.attach { + detach, err := l.attach(&xtcp.XTCP{}) + if err != nil { + t.Fatal(err) + } + if tc.detach { + detach() + } + } + rec := httptest.NewRecorder() + l.ServeHTTP(rec, httptest.NewRequest(http.MethodGet, "/metrics/link", nil)) + if rec.Code != tc.wantCode { + t.Errorf("GET /metrics/link = %d, want %d", rec.Code, tc.wantCode) + } + out := captureLog(t, l.rebaseline) + if !strings.Contains(out, tc.wantLog) { + t.Errorf("rebaseline log %q, want %q", out, tc.wantLog) + } + }) + } +} + +// TestAwaitSignalAndShutdown_sigusr1 checks SIGUSR1 rebaselines without +// shutting down, and a later SIGTERM still shuts down. +func TestAwaitSignalAndShutdown_sigusr1(t *testing.T) { + tests := []struct { + name, category, description, expectedOutcome string + usr1 int + rebaseline bool + }{ + {"two_rebaselines", "positive", "two SIGUSR1 then SIGTERM", "two rebaselines, then cancel", 2, true}, + {"no_rebaseline_func", "corner", "SIGUSR1 with no rebaseline target", "ignored, then cancel", 1, false}, + {"terminate_only", "boundary", "SIGTERM alone", "no rebaseline, cancel", 0, true}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + t.Logf("%s: %s; expected: %s", tc.category, tc.description, tc.expectedOutcome) + sigs := make(chan os.Signal, tc.usr1+1) + complete := make(chan struct{}, 1) + var rebaselines, cancels atomic.Int32 + var rebaseline func() + if tc.rebaseline { + rebaseline = func() { rebaselines.Add(1) } + } + done := make(chan struct{}) + go func() { + awaitSignalAndShutdown(sigs, func() { cancels.Add(1) }, complete, time.Second, false, rebaseline) + close(done) + }() + for range tc.usr1 { + sigs <- syscall.SIGUSR1 + } + sigs <- syscall.SIGTERM + complete <- struct{}{} + select { + case <-done: + case <-time.After(2 * time.Second): + t.Fatal("awaitSignalAndShutdown did not return") + } + want := int32(0) + if tc.rebaseline { + want = int32(tc.usr1) + } + if got := rebaselines.Load(); got != want { + t.Errorf("rebaselines = %d, want %d", got, want) + } + if cancels.Load() != 1 { + t.Errorf("cancels = %d, want 1", cancels.Load()) + } + }) + } +} diff --git a/cmd/xtcp2/ip_server.go b/cmd/xtcp2/ip_server.go deleted file mode 100644 index 60e8aaef5..000000000 --- a/cmd/xtcp2/ip_server.go +++ /dev/null @@ -1,90 +0,0 @@ -package main - -import ( - "context" - "fmt" - "log" - "net" - "sync" - "sync/atomic" - "time" - - "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" - "github.com/randomizedcoder/xtcp2/pkg/listener" -) - -// ipRejectLogEvery bounds the log of connections the /ip listener closes, so -// a peer retrying in a loop cannot flood the log. -const ipRejectLogEvery = time.Minute - -// ipServerStarter is the indirection point for the /ip listener, as -// promHandlerStarter is for the prom listener. -var ipServerStarter = startIPServer - -// ipListenAddress returns the address of the /ip listener: ip_listen, checked -// to be a loopback host:port, or "" when /ip stays on the Prometheus listener -// or is not served. ip_listen without ip_paths is an error rather than a -// listener serving nothing; with the monitor disabled there is nothing to -// serve, so no listener. -func ipListenAddress(m *xtcp_config.LinkMonitorConfig) (string, error) { - addr := m.GetIpListen() - if addr == "" { - return "", nil - } - if !m.GetIpPaths() { - return "", fmt.Errorf("linkMonitorIPListen %q needs linkMonitorIPPaths", addr) - } - if _, err := listener.ParseLoopback(addr); err != nil { - return "", fmt.Errorf("linkMonitorIPListen: %w", err) - } - if !m.GetEnable() { - return "", nil - } - return addr, nil -} - -// startIPServer binds the /ip listener now, so a bad address or a port in use -// fails startup as the prom listener's would, then serves the late-bound /ip -// routes on a worker that joins wg and drains when ctx ends. The listener has -// no listener auth: it accepts loopback peers only, who could run `ip` anyway. -func startIPServer(ctx context.Context, wg *sync.WaitGroup, m *xtcp_config.LinkMonitorConfig) error { - addr, err := ipListenAddress(m) - if err != nil || addr == "" { - return err - } - // TTL and hop limit 1: replies never pass a router. - ln, err := listener.Listen(ctx, listener.Endpoint{Network: listener.NetworkTCP, Address: addr}, 1, 1) - if err != nil { - return fmt.Errorf("ip listener: %w", err) - } - ln = listener.LoopbackOnly(ln, rateLimitedRejectLog(ipRejectLogEvery)) - wg.Add(1) - go serveHTTP(ctx, wg, "ip listener", newPromServer(linkMonitorHTTP.ipRoutes()), ln, promShutdownGrace, func(err error) { - // /ip is a convenience: losing it must not stop the collection. - log.Printf("ip listener stopped: %v; /ip is unavailable until xtcp2 restarts", err) - }) - log.Printf("ip listener: /ip and /i on %s, loopback peers only", addr) - return nil -} - -// rateLimitedRejectLog logs a closed non-loopback connection at most once -// per every, with the count closed since the last line, and the close error -// of the connection that line reports, if any. -func rateLimitedRejectLog(every time.Duration) func(net.Addr, error) { - var last atomic.Int64 - var count atomic.Int64 - return func(a net.Addr, closeErr error) { - n := count.Add(1) - now := time.Now().UnixNano() - prev := last.Load() - if now-prev < int64(every) || !last.CompareAndSwap(prev, now) { - return - } - count.Add(-n) - if closeErr != nil { - log.Printf("ip listener: closed %d connection(s) from non-loopback peers, last from %s: %v", n, a, closeErr) - return - } - log.Printf("ip listener: closed %d connection(s) from non-loopback peers, last from %s", n, a) - } -} diff --git a/cmd/xtcp2/ip_server_test.go b/cmd/xtcp2/ip_server_test.go deleted file mode 100644 index 0adbf9b18..000000000 --- a/cmd/xtcp2/ip_server_test.go +++ /dev/null @@ -1,241 +0,0 @@ -package main - -import ( - "context" - "errors" - "net" - "net/http" - "strings" - "sync" - "testing" - "time" - - "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" - "github.com/randomizedcoder/xtcp2/pkg/xtcp" -) - -func TestIPListenAddress(t *testing.T) { - tests := []struct { - category, description, expected string - config *xtcp_config.LinkMonitorConfig - wantErr string - }{ - { - category: "positive", description: "loopback address with /ip on", - expected: "127.0.0.1:9089", - config: &xtcp_config.LinkMonitorConfig{Enable: true, IpPaths: true, IpListen: "127.0.0.1:9089"}, - }, - { - category: "positive", description: "IPv6 loopback", - expected: "[::1]:9089", - config: &xtcp_config.LinkMonitorConfig{Enable: true, IpPaths: true, IpListen: "[::1]:9089"}, - }, - { - category: "negative", description: "every address is refused", - config: &xtcp_config.LinkMonitorConfig{Enable: true, IpPaths: true, IpListen: ":9089"}, - wantErr: "loopback", - }, - { - category: "negative", description: "a host address is refused", - config: &xtcp_config.LinkMonitorConfig{Enable: true, IpPaths: true, IpListen: "10.0.0.1:9089"}, - wantErr: "loopback", - }, - { - category: "negative", description: "an address without /ip on is a misconfiguration", - config: &xtcp_config.LinkMonitorConfig{Enable: true, IpListen: "127.0.0.1:9089"}, - wantErr: "needs linkMonitorIPPaths", - }, - { - category: "boundary", description: "unset keeps one listener", - expected: "", - config: &xtcp_config.LinkMonitorConfig{Enable: true, IpPaths: true}, - }, - { - category: "boundary", description: "no link monitor config at all", - expected: "", - }, - { - category: "corner", description: "a disabled monitor binds nothing", - expected: "", - config: &xtcp_config.LinkMonitorConfig{IpPaths: true, IpListen: "127.0.0.1:9089"}, - }, - { - category: "corner", description: "a disabled monitor still refuses a bad address", - config: &xtcp_config.LinkMonitorConfig{IpPaths: true, IpListen: "0.0.0.0:9089"}, - wantErr: "loopback", - }, - } - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - t.Logf("%s: %s; expected: %q %s", tc.category, tc.description, tc.expected, tc.wantErr) - got, err := ipListenAddress(tc.config) - if tc.wantErr != "" { - if err == nil || !strings.Contains(err.Error(), tc.wantErr) { - t.Fatalf("err = %v, want %q", err, tc.wantErr) - } - return - } - if err != nil || got != tc.expected { - t.Fatalf("ipListenAddress = %q, %v; want %q", got, err, tc.expected) - } - }) - } -} - -// freeLoopbackPort returns a loopback address with a port nothing listens on -// (for now): ip_listen refuses port 0. -func freeLoopbackPort(t *testing.T) string { - t.Helper() - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - t.Fatal(err) - } - addr := ln.Addr().String() - _ = ln.Close() - return addr -} - -// TestStartIPServer binds the real /ip listener and serves the late-bound -// routes from loopback; the peer filter itself is pkg/listener's test. -func TestStartIPServer(t *testing.T) { - tests := []struct { - category, description, expected string - attach, occupied, badAddr bool - wantCode int - wantErr string - }{ - {"positive", "an attached daemon's /ip routes serve", "200", true, false, false, http.StatusOK, ""}, - {"negative", "nothing attached yet", "404", false, false, false, http.StatusNotFound, ""}, - {"negative", "a non-loopback address fails startup", "error, nothing bound", false, false, true, 0, "loopback"}, - {"boundary", "a port in use fails startup", "error naming the ip listener", false, true, false, 0, "ip listener"}, - } - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - t.Logf("%s: %s; expected: %s", tc.category, tc.description, tc.expected) - addr := freeLoopbackPort(t) - if tc.occupied { - ln, err := net.Listen("tcp", addr) - if err != nil { - t.Fatal(err) - } - defer func() { _ = ln.Close() }() - } - if tc.badAddr { - addr = "0.0.0.0:9089" - } - if tc.attach { - h := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {})) - linkMonitorHTTP.ip.Store(&h) - t.Cleanup(func() { linkMonitorHTTP.ip.Store(nil) }) - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - var wg sync.WaitGroup - err := startIPServer(ctx, &wg, &xtcp_config.LinkMonitorConfig{Enable: true, IpPaths: true, IpListen: addr}) - if tc.wantErr != "" { - if err == nil || !strings.Contains(err.Error(), tc.wantErr) { - t.Fatalf("err = %v, want %q", err, tc.wantErr) - } - waitReturns(t, &wg, time.Second) - return - } - if err != nil { - t.Fatal(err) - } - resp, err := http.Get("http://" + addr + "/ip/link") - if err != nil { - t.Fatal(err) - } - _ = resp.Body.Close() - if resp.StatusCode != tc.wantCode { - t.Errorf("GET /ip/link = %d, want %d", resp.StatusCode, tc.wantCode) - } - cancel() - waitReturns(t, &wg, promShutdownGrace+time.Second) - }) - } -} - -// TestLinkMonitorRoutesIP covers the /ip listener's late binding. -func TestLinkMonitorRoutesIP(t *testing.T) { - tests := []struct { - category, description, expected string - attach, detach bool - }{ - {"negative", "before a daemon starts", "404", false, false}, - {"negative", "a daemon run without a monitor", "404", true, false}, - {"corner", "after the daemon stops", "404", true, true}, - } - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - t.Logf("%s: %s; expected: %s", tc.category, tc.description, tc.expected) - l := &linkMonitorRoutes{promPath: "/metrics"} - if tc.attach { - detach, err := l.attach(&xtcp.XTCP{}) - if err != nil { - t.Fatal(err) - } - if tc.detach { - detach() - } - } - srv := newPromServer(l.ipRoutes()) - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - t.Fatal(err) - } - go func() { _ = srv.Serve(ln) }() - defer func() { _ = srv.Close() }() - resp, err := http.Get("http://" + ln.Addr().String() + "/ip/link") - if err != nil { - t.Fatal(err) - } - _ = resp.Body.Close() - if resp.StatusCode != http.StatusNotFound { - t.Errorf("GET /ip/link = %d, want 404", resp.StatusCode) - } - }) - } -} - -func TestRateLimitedRejectLog(t *testing.T) { - peer := &net.TCPAddr{IP: net.IPv4(172, 17, 0, 2), Port: 40000} - tests := []struct { - category, description string - every time.Duration - rejects int - closeErr error - expected []string // log lines, in order - }{ - {"positive", "the first reject is logged at once", time.Hour, 1, nil, []string{"closed 1 connection(s)"}}, - {"negative", "a burst inside the window logs one line", time.Hour, 50, nil, []string{"closed 1 connection(s)"}}, - {"boundary", "no rejects, no log", time.Hour, 0, nil, nil}, - {"corner", "a zero window logs each reject with its own count", 0, 3, nil, []string{"closed 1 ", "closed 1 ", "closed 1 "}}, - {"corner", "a close error is on the line", time.Hour, 1, errors.New("close failed"), []string{"40000: close failed"}}, - } - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - t.Logf("%s: %s; expected: %v", tc.category, tc.description, tc.expected) - reject := rateLimitedRejectLog(tc.every) - out := captureLog(t, func() { - for range tc.rejects { - reject(peer, tc.closeErr) - } - }) - var lines []string - for _, l := range strings.Split(strings.TrimSpace(out), "\n") { - if l != "" { - lines = append(lines, l) - } - } - if len(lines) != len(tc.expected) { - t.Fatalf("log lines = %q, want %d", lines, len(tc.expected)) - } - for i, want := range tc.expected { - if !strings.Contains(lines[i], want) || !strings.Contains(lines[i], "172.17.0.2:40000") { - t.Errorf("line %d = %q, want %q and the peer", i, lines[i], want) - } - } - }) - } -} diff --git a/cmd/xtcp2/listeners.go b/cmd/xtcp2/listeners.go new file mode 100644 index 000000000..60c943b13 --- /dev/null +++ b/cmd/xtcp2/listeners.go @@ -0,0 +1,338 @@ +package main + +import ( + "context" + "errors" + "flag" + "fmt" + "log" + "net" + "net/http" + "net/http/pprof" // registered explicitly on a debug listener's mux in httpHandler + "os" + "slices" + "strings" + "sync" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/prometheus/client_golang/prometheus/promhttp" + "google.golang.org/protobuf/proto" + + "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" + "github.com/randomizedcoder/xtcp2/pkg/health" + "github.com/randomizedcoder/xtcp2/pkg/listener" + "github.com/randomizedcoder/xtcp2/pkg/listenerauth" + "github.com/randomizedcoder/xtcp2/pkg/listeners" + "github.com/randomizedcoder/xtcp2/pkg/xtcp" +) + +// listenersEnv overrides -listener: specs separated by ';'. +const listenersEnv = "LISTENERS" + +// listenerFlag collects the repeatable -listener flag. +type listenerFlag []string + +func (l *listenerFlag) String() string { + if l == nil { + return "" + } + return strings.Join(*l, ";") +} + +func (l *listenerFlag) Set(v string) error { + *l = append(*l, v) + return nil +} + +// The listeners the legacy flags expand to, by name. +const ( + legacyProm = "prometheus" + legacyGRPC = "grpc" + legacyIP = "ip" +) + +// legacyListenerFlags and legacyListenerEnv are the per-listener settings +// that -listener replaces, by the listener they configure. +var ( + legacyListenerFlags = map[string][]string{ + legacyProm: {"promListen", "promListenNetwork", "promUnixSocketMode", "promUnlinkStaleUnixSocket"}, + legacyGRPC: {"grpcPort", "grpcListenNetwork", "grpcListenAddress", "grpcUnixSocketMode", "grpcUnlinkStaleUnixSocket"}, + legacyIP: {"linkMonitorIPListen"}, + } + legacyListenerEnv = map[string][]string{ + legacyProm: {"PROM_LISTEN", "PROM_LISTEN_NETWORK", "PROM_UNIX_SOCKET_MODE", "PROM_UNLINK_STALE_UNIX_SOCKET"}, + legacyGRPC: {"GRPC_PORT", "GRPC_LISTEN_NETWORK", "GRPC_LISTEN_ADDRESS", "GRPC_UNIX_SOCKET_MODE", "GRPC_UNLINK_STALE_UNIX_SOCKET"}, + legacyIP: {"LINK_MONITOR_IP_LISTEN"}, + } +) + +// legacyListenerSettings returns, per legacy listener, the flags and env vars +// given for it. +func legacyListenerSettings(fs *flag.FlagSet) map[string][]string { + seen := map[string][]string{} + given := map[string]bool{} + fs.Visit(func(f *flag.Flag) { given[f.Name] = true }) + for name, flags := range legacyListenerFlags { + for _, f := range flags { + if given[f] { + seen[name] = append(seen[name], "-"+f) + } + } + } + for name, keys := range legacyListenerEnv { + for _, k := range keys { + if v, ok := os.LookupEnv(k); ok && v != "" { + seen[name] = append(seen[name], k) + } + } + } + return seen +} + +// configureListeners sets c.Listeners from -listener / LISTENERS, or from +// the legacy per-listener settings, which it expands with a deprecation +// line. Giving both forms is a usage error: which one wins would be a guess. +// With neither, c.Listeners stays empty and the daemon serves +// listeners.Default. +func configureListeners(c *xtcp_config.XtcpConfig, specs []string, legacy map[string][]string, promListen string) error { + list := strings.Join(specs, ";") + if v, ok := os.LookupEnv(listenersEnv); ok && strings.TrimSpace(v) != "" { + list = v + } + ls, err := listeners.ParseList(list) + if err != nil { + return err + } + var used []string + for _, name := range []string{legacyProm, legacyGRPC, legacyIP} { + used = append(used, legacy[name]...) + } + if len(ls) > 0 && len(used) > 0 { + return fmt.Errorf("%w: -listener/%s and the deprecated %s are both set; describe every listener with -listener", + listeners.ErrConfig, listenersEnv, strings.Join(used, ", ")) + } + if len(ls) > 0 { + c.Listeners = ls + return nil + } + if len(used) == 0 { + return nil + } + ls, err = expandLegacyListeners(c, legacy, promListen) + if err != nil { + return err + } + c.Listeners = ls + forms := make([]string, 0, len(ls)) + for _, l := range ls { + forms = append(forms, "-listener '"+listeners.FormatSpec(l)+"'") + } + log.Printf("DEPRECATED: %s; use %s", strings.Join(used, ", "), strings.Join(forms, " ")) + return nil +} + +// expandLegacyListeners maps the legacy settings onto listeners. The +// Prometheus listener serves health, metrics, metrics-detail and, with +// -linkMonitorIPPaths and no ip listener of its own, ip; it no longer serves +// pprof, which needs a debug listener now. Without it the default socket +// stays. The gRPC listener serves everything under the one credential, or +// read and admin under their own when an admin credential is set. The ip +// listener keeps its loopback-only, no-auth shape. +func expandLegacyListeners(c *xtcp_config.XtcpConfig, legacy map[string][]string, promListen string) ([]*xtcp_config.Listener, error) { + var out []*xtcp_config.Listener + m := c.GetLinkMonitor() + ipOwn := len(legacy["ip"]) > 0 && m.GetIpListen() != "" + if len(legacy[legacyProm]) > 0 { + ep := legacyEndpoint(c.GetPrometheusListener(), promListen) + serves := []xtcp_config.EndpointClass{listeners.Health, listeners.Metrics, listeners.MetricsDetail} + if m.GetIpPaths() && !ipOwn { + serves = append(serves, listeners.IP) + } + out = append(out, &xtcp_config.Listener{Name: legacyProm, Endpoint: ep, Serves: serves}) + } else { + out = append(out, listeners.Default()...) + } + if len(legacy[legacyGRPC]) > 0 { + ep := legacyEndpoint(c.GetGrpcListener(), fmt.Sprintf(":%d", c.GetGrpcPort())) + serves := []xtcp_config.EndpointClass{listeners.GRPCAdmin} + if authEnabled(c.GetAdminListenerAuth()) { + serves = []xtcp_config.EndpointClass{listeners.GRPCRead, listeners.GRPCAdmin} + } + out = append(out, &xtcp_config.Listener{Name: legacyGRPC, Endpoint: ep, Serves: serves}) + } + if ipOwn && m.GetEnable() { + if _, err := listener.ParseLoopback(m.GetIpListen()); err != nil { + return nil, fmt.Errorf("%w: linkMonitorIPListen: %w", listeners.ErrConfig, err) + } + out = append(out, &xtcp_config.Listener{ + Name: "ip", + Endpoint: &xtcp_config.ListenerEndpoint{ + Network: xtcp_config.ListenerNetwork_LISTENER_NETWORK_TCP, + Address: m.GetIpListen(), + }, + Auth: &xtcp_config.ListenerAuth{Mode: xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_DISABLED}, + Serves: []xtcp_config.EndpointClass{listeners.IP}, + }) + } + return out, nil +} + +// authEnabled reports whether a enforces a credential. +func authEnabled(a *xtcp_config.ListenerAuth) bool { + m := a.GetMode() + return m != xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_UNSPECIFIED && + m != xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_DISABLED +} + +// legacyEndpoint is a legacy listener's endpoint: as configured, with an +// empty network meaning TCP, as it always did, and an empty address +// defaulted. +func legacyEndpoint(ep *xtcp_config.ListenerEndpoint, address string) *xtcp_config.ListenerEndpoint { + out := &xtcp_config.ListenerEndpoint{UnlinkStaleUnixSocket: unlinkStaleSocketCst} + if ep != nil { + out = proto.CloneOf(ep) + } + if out.GetNetwork() == xtcp_config.ListenerNetwork_LISTENER_NETWORK_UNSPECIFIED { + out.Network = xtcp_config.ListenerNetwork_LISTENER_NETWORK_TCP + } + if out.GetAddress() == "" { + out.Address = address + } + return out +} + +// listenerActive is 1 per class each listener serves. +var listenerActive = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "xtcp2_listener_active", + Help: "1 for each endpoint class a listener serves: name, network (unix or tcp) and class.", +}, []string{"name", "network", "class"}) + +// listenersStarter binds and serves the listeners. Tests swap it for a stub +// that binds nothing. +var listenersStarter = startListeners + +// startListeners binds every listener before serving any, so a bad address +// or a port in use fails startup cleanly. It serves the HTTP listeners on +// workers that join wg and drain when ctx ends, and returns the gRPC ones +// for the daemon to serve. +func startListeners(ctx context.Context, wg *sync.WaitGroup, specs []listeners.Spec, promPath string) ([]xtcp.GRPCListener, error) { + type bound struct { + spec listeners.Spec + ln net.Listener + handler http.Handler + } + var all []bound + closeAll := func() { + for i := range all { + if err := all[i].ln.Close(); err != nil { + log.Printf("listener %q: close: %v", all[i].spec.Name, err) + } + } + } + for _, s := range specs { + var h http.Handler + if !s.GRPC() { + var err error + if h, err = httpHandler(s, promPath); err != nil { + closeAll() + return nil, err + } + } + ln, err := s.Listen(ctx, rateLimitedRejectLog(s.Name, ipRejectLogEvery)) + if err != nil { + closeAll() + return nil, err + } + all = append(all, bound{s, ln, h}) + } + var grpcLns []xtcp.GRPCListener + for i := range all { + b := &all[i] + for _, cl := range b.spec.Classes { + listenerActive.WithLabelValues(b.spec.Name, b.spec.Endpoint.Network, listeners.ClassName(cl)).Set(1) + } + log.Print(b.spec.Describe()) + if b.handler == nil { + grpcLns = append(grpcLns, xtcp.GRPCListener{Spec: b.spec, Listener: b.ln}) + continue + } + wg.Add(1) + go serveHTTP(ctx, wg, "listener "+b.spec.Name, newHTTPServer(b.handler), b.ln, httpShutdownGrace, httpServeFailed(b.spec)) + } + return grpcLns, nil +} + +// httpServeFailed is what a listener's serve failure does. Losing health or +// metrics stops the daemon, which must not run unobserved; losing the rest +// is logged. +func httpServeFailed(s listeners.Spec) func(error) { + if s.Serves(listeners.Health) || s.Serves(listeners.Metrics) { + return func(err error) { fatalf("listener %q: %v", s.Name, err) } + } + return func(err error) { + log.Printf("listener %q stopped: %v; its paths are unavailable until xtcp2 restarts", s.Name, err) + } +} + +// ipPatterns are the ip class's routes. +var ipPatterns = []string{"/ip", "/ip/", "/i", "/i/"} + +// httpHandler builds the mux for one HTTP listener from the classes it +// serves, behind its auth policy. A path outside them is 404. +// +// A dedicated mux, not http.DefaultServeMux: pprof is registered explicitly +// under debug, rather than by the side-effect import that registers it on +// DefaultServeMux (gosec G108). +func httpHandler(s listeners.Spec, promPath string) (http.Handler, error) { + mux := http.NewServeMux() + if s.Serves(listeners.Health) { + mux.HandleFunc("/healthz", health.Healthz) + mux.HandleFunc("/readyz", health.Readyz) + } + if s.Serves(listeners.Metrics) { + if s.Serves(listeners.IP) && slices.Contains(ipPatterns, promPath) { + return nil, fmt.Errorf("%w: listener %q: -promPath %s is an ip route", listeners.ErrConfig, s.Name, promPath) + } + mux.Handle(promPath, promhttp.HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{ + EnableOpenMetrics: promEnableOpenMetrics, + MaxRequestsInFlight: promMaxRequestsInFlight, + })) + } + if s.Serves(listeners.Debug) { + // pprof.Index also serves the named runtime profiles (goroutine, + // heap, ...). cmdline is never served: it is the process's argv. + mux.HandleFunc("/debug/pprof/", pprof.Index) + mux.HandleFunc("/debug/pprof/cmdline", http.NotFound) + mux.HandleFunc("/debug/pprof/profile", pprof.Profile) + mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) + mux.HandleFunc("/debug/pprof/trace", pprof.Trace) + } + // The link monitor's detail paths are every other path, once the daemon + // has attached them; the patterns above are more specific and win. A + // promPath of "/" on this listener already serves every path. + if s.Serves(listeners.MetricsDetail) && (promPath != "/" || !s.Serves(listeners.Metrics)) { + mux.Handle("/", &linkMonitorHTTP) + } + if s.Serves(listeners.IP) { + for _, p := range ipPatterns { + mux.Handle(p, linkMonitorHTTP.ipRoutes()) + } + } + policy, err := s.Policy(nil) + if err != nil { + return nil, fmt.Errorf("%w: listener %q: %w", listeners.ErrConfig, s.Name, err) + } + return policy.WrapHTTP(mux, listenerauth.PathAccess("/debug/pprof/")), nil +} + +// closeGRPCListeners closes the gRPC listeners once the daemon has +// stopped. The daemon's servers close the ones they served, so an error +// here is expected and ignored; this catches a daemon that never served. +func closeGRPCListeners(ls []xtcp.GRPCListener) { + for i := range ls { + if err := ls[i].Listener.Close(); err != nil && !errors.Is(err, net.ErrClosed) { + log.Printf("listener %q: close: %v", ls[i].Spec.Name, err) + } + } +} diff --git a/cmd/xtcp2/listeners_test.go b/cmd/xtcp2/listeners_test.go new file mode 100644 index 000000000..a832feca5 --- /dev/null +++ b/cmd/xtcp2/listeners_test.go @@ -0,0 +1,186 @@ +package main + +import ( + "context" + "os" + "slices" + "strings" + "sync" + "testing" + + "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" + "github.com/randomizedcoder/xtcp2/pkg/listeners" + "github.com/randomizedcoder/xtcp2/pkg/xtcp" +) + +// stubListeners makes a runMain test bind nothing, and lets the default +// listener resolve without a token file. It returns the specs runMain asked +// to start. +func stubListeners(t *testing.T) *[]listeners.Spec { + t.Helper() + t.Setenv("LISTENER_AUTH_MODE", "disabled") + var started []listeners.Spec + prev := listenersStarter + listenersStarter = func(_ context.Context, _ *sync.WaitGroup, specs []listeners.Spec, _ string) ([]xtcp.GRPCListener, error) { + started = specs + return nil, nil + } + t.Cleanup(func() { listenersStarter = prev }) + return &started +} + +// TestConfigureListeners covers -listener / LISTENERS and the expansion of +// the deprecated per-listener settings. +func TestConfigureListeners(t *testing.T) { + adminRaw := &xtcp_config.ListenerAuth{Mode: xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN} + tests := []struct { + name, category, description string + specs []string + env map[string]string + legacy map[string][]string + config func(c *xtcp_config.XtcpConfig) + expected []string // FormatSpec of each listener; nil = none configured + wantErr string + }{ + {name: "none", category: "positive", description: "nothing set leaves the default to the daemon"}, + {name: "flag", category: "positive", description: "-listener sets the listeners", + specs: []string{"name=m,serves=health+metrics,address=/run/m.sock"}, + expected: []string{"name=m,serves=health+metrics,address=/run/m.sock"}}, + {name: "env_overrides_flag", category: "boundary", description: "LISTENERS wins over -listener", + specs: []string{"name=m,serves=health,address=/run/m.sock"}, + env: map[string]string{"LISTENERS": "name=a,serves=health,address=/a.sock;name=b,serves=metrics,address=/b.sock"}, + expected: []string{"name=a,serves=health,address=/a.sock", "name=b,serves=metrics,address=/b.sock"}}, + {name: "both_forms", category: "negative", description: "-listener with a deprecated flag is a usage error", + specs: []string{"name=m,serves=health,address=/run/m.sock"}, + legacy: map[string][]string{"prometheus": {"-promListen"}}, + wantErr: "both set"}, + {name: "bad_spec", category: "negative", description: "an unparsable spec is a usage error", + specs: []string{"name=m,bogus=1"}, wantErr: "unknown key"}, + {name: "legacy_prom", category: "positive", description: "-promListen becomes a typed TCP listener without pprof", + legacy: map[string][]string{"prometheus": {"-promListen"}}, + expected: []string{"name=prometheus,serves=health+metrics+metrics-detail,address=:9088,network=tcp"}}, + {name: "legacy_prom_unix_ip", category: "corner", description: "a unix prom listener keeps /ip when ip has no listener of its own", + legacy: map[string][]string{"prometheus": {"PROM_LISTEN_NETWORK"}}, + config: func(c *xtcp_config.XtcpConfig) { + c.PrometheusListener = &xtcp_config.ListenerEndpoint{Network: xtcp_config.ListenerNetwork_LISTENER_NETWORK_UNIX, Address: "/run/p.sock", UnixSocketMode: 0o660} + c.LinkMonitor = &xtcp_config.LinkMonitorConfig{Enable: true, IpPaths: true} + }, + expected: []string{"name=prometheus,serves=health+metrics+metrics-detail+ip,address=/run/p.sock,network=unix,mode=0660"}}, + {name: "legacy_grpc_keeps_default", category: "positive", description: "-grpcPort adds a gRPC listener next to the default socket, one credential for all", + legacy: map[string][]string{"grpc": {"-grpcPort"}}, + expected: []string{"name=metrics,serves=health+metrics+metrics-detail,address=/run/xtcp2/metrics.sock,network=unix,mode=0600", + "name=grpc,serves=grpc-admin,address=:8889,network=tcp"}}, + {name: "legacy_grpc_admin_split", category: "boundary", description: "with an admin credential the gRPC listener serves read and admin", + legacy: map[string][]string{"grpc": {"GRPC_PORT"}}, + config: func(c *xtcp_config.XtcpConfig) { c.AdminListenerAuth = adminRaw }, + expected: []string{"name=metrics,serves=health+metrics+metrics-detail,address=/run/xtcp2/metrics.sock,network=unix,mode=0600", + "name=grpc,serves=grpc-read+grpc-admin,address=:8889,network=tcp"}}, + {name: "legacy_ip_listen", category: "positive", description: "-linkMonitorIPListen becomes a loopback listener without auth", + legacy: map[string][]string{"ip": {"-linkMonitorIPListen"}}, + config: func(c *xtcp_config.XtcpConfig) { + c.LinkMonitor = &xtcp_config.LinkMonitorConfig{Enable: true, IpPaths: true, IpListen: "127.0.0.1:9089"} + }, + expected: []string{"name=metrics,serves=health+metrics+metrics-detail,address=/run/xtcp2/metrics.sock,network=unix,mode=0600", + "name=ip,serves=ip,address=127.0.0.1:9089,network=tcp,auth=disabled"}}, + {name: "legacy_ip_not_loopback", category: "negative", description: "a non-loopback ip address is refused", + legacy: map[string][]string{"ip": {"LINK_MONITOR_IP_LISTEN"}}, + config: func(c *xtcp_config.XtcpConfig) { + c.LinkMonitor = &xtcp_config.LinkMonitorConfig{Enable: true, IpPaths: true, IpListen: "0.0.0.0:9089"} + }, + wantErr: "loopback"}, + {name: "legacy_ip_monitor_off", category: "corner", description: "with the monitor off the ip listener is dropped", + legacy: map[string][]string{"ip": {"-linkMonitorIPListen"}}, + config: func(c *xtcp_config.XtcpConfig) { + c.LinkMonitor = &xtcp_config.LinkMonitorConfig{IpPaths: true, IpListen: "127.0.0.1:9089"} + }, + expected: []string{"name=metrics,serves=health+metrics+metrics-detail,address=/run/xtcp2/metrics.sock,network=unix,mode=0600"}}, + } + for _, tc := range tests { + t.Run(tc.category+"/"+tc.name, func(t *testing.T) { + t.Setenv(listenersEnv, "") + for k, v := range tc.env { + t.Setenv(k, v) + } + c := &xtcp_config.XtcpConfig{GrpcPort: grpcPortCst} + if tc.config != nil { + tc.config(c) + } + var err error + out := captureLog(t, func() { err = configureListeners(c, tc.specs, tc.legacy, promListenCst) }) + if tc.wantErr != "" { + if err == nil || !strings.Contains(err.Error(), tc.wantErr) || exitCodeFor(err) != exitUsage { + t.Fatalf("%s: err = %v (exit %d), want %q and exit 64", tc.description, err, exitCodeFor(err), tc.wantErr) + } + return + } + if err != nil { + t.Fatalf("%s: %v", tc.description, err) + } + var got []string + for _, l := range c.GetListeners() { + got = append(got, listeners.FormatSpec(l)) + } + if !slices.Equal(got, tc.expected) { + t.Errorf("%s:\n got %q\nwant %q", tc.description, got, tc.expected) + } + if deprecated := strings.Contains(out, "DEPRECATED"); deprecated != (len(tc.legacy) > 0) { + t.Errorf("%s: deprecation logged = %v, want %v (%q)", tc.description, deprecated, len(tc.legacy) > 0, out) + } + }) + } +} + +// TestRunMain_listeners covers the listener outcomes of a run: what is +// started, and the usage errors that stop it before anything binds. +func TestRunMain_listeners(t *testing.T) { + tests := []struct { + name, category, description string + args []string + env map[string]string + expected int + started []string // names of the listeners asked to start + }{ + {"default", "positive", "no listener config starts the default socket", + nil, map[string]string{"LISTENER_AUTH_MODE": "disabled"}, exitOK, []string{"metrics"}}, + {"default_needs_token", "negative", "an empty LISTENER_AUTH_MODE is unset, so the default socket still needs a token", + nil, map[string]string{"LISTENER_AUTH_MODE": ""}, exitUsage, nil}, + {"both_forms", "negative", "-listener with -promListen is a usage error", + []string{"-listener", "name=m,serves=health,address=/run/m.sock,auth=disabled", "-promListen", ":9000"}, + nil, exitUsage, nil}, + {"tcp_no_auth", "negative", "auth disabled on a non-loopback TCP listener is refused", + []string{"-listener", "name=m,serves=metrics,address=:9000,network=tcp,auth=disabled"}, nil, exitUsage, nil}, + {"missing_token_file", "negative", "a token file that does not exist is a usage error", + []string{"-listener", "name=m,serves=metrics,address=/run/m.sock,tokenFile=/nonexistent/token"}, nil, exitUsage, nil}, + {"health_only_tcp", "boundary", "a health-only TCP listener may run without auth", + []string{"-listener", "name=h,serves=health,address=:9000,network=tcp,auth=disabled"}, nil, exitOK, []string{"h"}}, + {"debug_without_admin", "corner", "debug next to metrics needs an admin credential", + []string{"-listener", "name=m,serves=metrics+debug,address=/run/m.sock,auth=disabled"}, nil, exitUsage, nil}, + } + for _, tc := range tests { + t.Run(tc.category+"/"+tc.name, func(t *testing.T) { + envHelperReset(t) + prevArgs := os.Args + os.Args = append([]string{"xtcp2", "-dest", "null"}, tc.args...) + t.Cleanup(func() { os.Args = prevArgs }) + started := stubListeners(t) + for k, v := range tc.env { + t.Setenv(k, v) + } + prevDaemon := daemonRunner + daemonRunner = func(context.Context, context.CancelFunc, *xtcp_config.XtcpConfig, []xtcp.GRPCListener) {} + t.Cleanup(func() { daemonRunner = prevDaemon }) + var rc int + captureLog(t, func() { rc = runMain(t.Context()) }) + if rc != tc.expected { + t.Fatalf("%s: rc = %d, want %d", tc.description, rc, tc.expected) + } + names := make([]string, 0, len(*started)) + for _, s := range *started { + names = append(names, s.Name) + } + if !slices.Equal(names, tc.started) { + t.Errorf("%s: started %v, want %v", tc.description, names, tc.started) + } + }) + } +} diff --git a/cmd/xtcp2/prom_lifecycle_test.go b/cmd/xtcp2/prom_lifecycle_test.go deleted file mode 100644 index f1cef4eb9..000000000 --- a/cmd/xtcp2/prom_lifecycle_test.go +++ /dev/null @@ -1,298 +0,0 @@ -package main - -import ( - "context" - "fmt" - "net" - "net/http" - "net/http/httptest" - "os" - "path/filepath" - "strings" - "sync" - "sync/atomic" - "syscall" - "testing" - "time" - - "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" - "github.com/randomizedcoder/xtcp2/pkg/xtcp" -) - -// unixClient is an HTTP client for the prom listener on sock. -func unixClient(sock string) *http.Client { - return &http.Client{ - Timeout: 5 * time.Second, - Transport: &http.Transport{DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) { - return (&net.Dialer{}).DialContext(ctx, "unix", sock) - }}, - } -} - -func getStatus(t *testing.T, c *http.Client, path string) int { - t.Helper() - resp, err := c.Get("http://prom" + path) - if err != nil { - t.Fatalf("GET %s: %v", path, err) - } - _ = resp.Body.Close() - return resp.StatusCode -} - -// waitReturns fails t unless wg.Wait returns within d. -func waitReturns(t *testing.T, wg *sync.WaitGroup, d time.Duration) { - t.Helper() - done := make(chan struct{}) - go func() { wg.Wait(); close(done) }() - select { - case <-done: - case <-time.After(d): - t.Fatalf("WaitGroup still waiting after %v", d) - } -} - -// TestStartPromServer covers the prom listener's lifecycle: it binds before -// returning, serves until the run context ends, then drains and leaves the -// WaitGroup. -func TestStartPromServer(t *testing.T) { - tests := []struct { - name, category, description, expectedOutcome string - params func(t *testing.T, sock string) promParams - wantErr string - requests map[string]int - }{ - { - name: "serves_and_drains", category: "positive", - description: "a unix socket listener serves metrics, health and pprof, then stops on cancel", - expectedOutcome: "200s, 404 for link monitor paths with no daemon attached, Wait returns", - params: func(_ *testing.T, sock string) promParams { - return promParams{path: "/metrics", listener: &xtcp_config.ListenerEndpoint{Network: xtcp_config.ListenerNetwork_LISTENER_NETWORK_UNIX, Address: sock}} - }, - requests: map[string]int{"/metrics": http.StatusOK, "/healthz": http.StatusOK, "/debug/pprof/": http.StatusOK, "/metrics/link": http.StatusNotFound, "/metrics-all": http.StatusNotFound}, - }, - { - name: "bad_address", category: "negative", - description: "an unparsable TCP address fails startup", - expectedOutcome: "error, no worker", - params: func(*testing.T, string) promParams { - return promParams{path: "/metrics", listen: "invalid-host:-1"} - }, - wantErr: "prometheus", - }, - { - name: "port_in_use", category: "negative", - description: "an address already bound fails startup instead of exiting later", - expectedOutcome: "listen error, no worker", - params: func(t *testing.T, _ string) promParams { - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - t.Fatal(err) - } - t.Cleanup(func() { _ = ln.Close() }) - return promParams{path: "/metrics", listen: ln.Addr().String()} - }, - wantErr: "listen", - }, - { - name: "bad_auth", category: "negative", - description: "an invalid listener auth config fails before binding", - expectedOutcome: "auth config error", - params: func(*testing.T, string) promParams { - return promParams{path: "/metrics", listen: "127.0.0.1:0", auth: &xtcp_config.ListenerAuth{Mode: xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN}} - }, - wantErr: "listener auth config invalid", - }, - { - name: "root_prom_path", category: "corner", - description: "a promPath of / serves metrics on every path and mounts no link monitor routes", - expectedOutcome: "no mux conflict panic, metrics on /anything", - params: func(_ *testing.T, sock string) promParams { - return promParams{path: "/", listener: &xtcp_config.ListenerEndpoint{Network: xtcp_config.ListenerNetwork_LISTENER_NETWORK_UNIX, Address: sock}} - }, - requests: map[string]int{"/anything": http.StatusOK, "/healthz": http.StatusOK}, - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - t.Logf("%s: %s; expected: %s", tc.category, tc.description, tc.expectedOutcome) - sock := filepath.Join(t.TempDir(), "prom.sock") - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - var wg sync.WaitGroup - err := startPromServer(ctx, &wg, tc.params(t, sock)) - if tc.wantErr != "" { - if err == nil || !strings.Contains(err.Error(), tc.wantErr) { - t.Fatalf("err = %v, want %q", err, tc.wantErr) - } - waitReturns(t, &wg, time.Second) - return - } - if err != nil { - t.Fatal(err) - } - c := unixClient(sock) - for path, want := range tc.requests { - if got := getStatus(t, c, path); got != want { - t.Errorf("GET %s = %d, want %d", path, got, want) - } - } - cancel() - waitReturns(t, &wg, promShutdownGrace+time.Second) - if _, err := c.Get("http://prom/healthz"); err == nil { - t.Error("listener still serving after shutdown") - } - }) - } -} - -// TestServePromHandler covers the serve worker's two exits: a serve failure -// while running, and a shutdown whose drain outlasts the grace. -func TestServePromHandler(t *testing.T) { - tests := []struct { - name, category, description, expectedOutcome string - closeFirst, stall bool - wantFatal string - }{ - {"serve_failure", "negative", "the listener fails while the daemon runs", "fatalf names the prometheus error", true, false, "prometheus error"}, - {"drain_past_grace", "boundary", "a request stalls past the shutdown grace", "server closed, worker returns, no fatal", false, true, ""}, - {"idle_shutdown", "positive", "shutdown with nothing in flight", "worker returns at once, no fatal", false, false, ""}, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - t.Logf("%s: %s; expected: %s", tc.category, tc.description, tc.expectedOutcome) - prev := fatalf - var fatal atomic.Value - fatal.Store("") - fatalf = func(format string, args ...any) { fatal.Store(fmt.Sprintf(format, args...)) } - t.Cleanup(func() { fatalf = prev }) - - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - t.Fatal(err) - } - release := make(chan struct{}) - defer close(release) - entered := make(chan struct{}, 1) - srv := newPromServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { - entered <- struct{}{} - <-release - })) - if tc.closeFirst { - _ = ln.Close() - } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - var wg sync.WaitGroup - wg.Add(1) - go servePromHandler(ctx, &wg, srv, ln, 50*time.Millisecond) - if tc.closeFirst { - waitReturns(t, &wg, time.Second) - } else { - if tc.stall { - go func() { - resp, err := http.Get("http://" + ln.Addr().String() + "/") - if err == nil { - _ = resp.Body.Close() - } - }() - <-entered - } - cancel() - waitReturns(t, &wg, 2*time.Second) - } - if got := fatal.Load().(string); !strings.Contains(got, tc.wantFatal) || (tc.wantFatal == "" && got != "") { - t.Fatalf("fatal = %q, want %q", got, tc.wantFatal) - } - }) - } -} - -// TestLinkMonitorRoutes covers the late-bound link monitor routes and the -// SIGUSR1 target as a daemon comes and goes. -func TestLinkMonitorRoutes(t *testing.T) { - tests := []struct { - name, category, description, expectedOutcome string - attach, detach bool - wantCode int - wantLog string - }{ - {"nothing_attached", "negative", "before a daemon starts", "404, SIGUSR1 ignored", false, false, http.StatusNotFound, "no daemon running"}, - {"daemon_without_monitor", "negative", "a daemon run with -linkMonitor=false", "404, SIGUSR1 rejected as disabled", true, false, http.StatusNotFound, "link monitor is disabled"}, - {"after_detach", "corner", "after the daemon stops, as on a reconfigure", "404, SIGUSR1 ignored", true, true, http.StatusNotFound, "no daemon running"}, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - t.Logf("%s: %s; expected: %s", tc.category, tc.description, tc.expectedOutcome) - l := &linkMonitorRoutes{promPath: "/metrics"} - if tc.attach { - detach, err := l.attach(&xtcp.XTCP{}) - if err != nil { - t.Fatal(err) - } - if tc.detach { - detach() - } - } - rec := httptest.NewRecorder() - l.ServeHTTP(rec, httptest.NewRequest(http.MethodGet, "/metrics/link", nil)) - if rec.Code != tc.wantCode { - t.Errorf("GET /metrics/link = %d, want %d", rec.Code, tc.wantCode) - } - out := captureLog(t, l.rebaseline) - if !strings.Contains(out, tc.wantLog) { - t.Errorf("rebaseline log %q, want %q", out, tc.wantLog) - } - }) - } -} - -// TestAwaitSignalAndShutdown_sigusr1 checks SIGUSR1 rebaselines without -// shutting down, and a later SIGTERM still shuts down. -func TestAwaitSignalAndShutdown_sigusr1(t *testing.T) { - tests := []struct { - name, category, description, expectedOutcome string - usr1 int - rebaseline bool - }{ - {"two_rebaselines", "positive", "two SIGUSR1 then SIGTERM", "two rebaselines, then cancel", 2, true}, - {"no_rebaseline_func", "corner", "SIGUSR1 with no rebaseline target", "ignored, then cancel", 1, false}, - {"terminate_only", "boundary", "SIGTERM alone", "no rebaseline, cancel", 0, true}, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - t.Logf("%s: %s; expected: %s", tc.category, tc.description, tc.expectedOutcome) - sigs := make(chan os.Signal, tc.usr1+1) - complete := make(chan struct{}, 1) - var rebaselines, cancels atomic.Int32 - var rebaseline func() - if tc.rebaseline { - rebaseline = func() { rebaselines.Add(1) } - } - done := make(chan struct{}) - go func() { - awaitSignalAndShutdown(sigs, func() { cancels.Add(1) }, complete, time.Second, false, rebaseline) - close(done) - }() - for range tc.usr1 { - sigs <- syscall.SIGUSR1 - } - sigs <- syscall.SIGTERM - complete <- struct{}{} - select { - case <-done: - case <-time.After(2 * time.Second): - t.Fatal("awaitSignalAndShutdown did not return") - } - want := int32(0) - if tc.rebaseline { - want = int32(tc.usr1) - } - if got := rebaselines.Load(); got != want { - t.Errorf("rebaselines = %d, want %d", got, want) - } - if cancels.Load() != 1 { - t.Errorf("cancels = %d, want 1", cancels.Load()) - } - }) - } -} diff --git a/cmd/xtcp2/prom_server.go b/cmd/xtcp2/prom_server.go deleted file mode 100644 index 2ad32b967..000000000 --- a/cmd/xtcp2/prom_server.go +++ /dev/null @@ -1,153 +0,0 @@ -package main - -import ( - "context" - "errors" - "fmt" - "log" - "net" - "net/http" - "net/http/pprof" // registered explicitly on the prom mux in promHandler (see there) - "sync" - "time" - - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promhttp" - "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" - "github.com/randomizedcoder/xtcp2/pkg/health" - "github.com/randomizedcoder/xtcp2/pkg/listener" - "github.com/randomizedcoder/xtcp2/pkg/listenerauth" -) - -// promShutdownGrace bounds the drain of in-flight scrapes at shutdown. It is -// under cancelSleepTimeCst, so the drain finishes before the signal handler -// gives up and exits. -const promShutdownGrace = 3 * time.Second - -// promParams configures the Prometheus, health and pprof listener. -type promParams struct { - path string - listener *xtcp_config.ListenerEndpoint - listen string - ipv4TTL, ipv6HopLimit uint32 - auth, adminAuth *xtcp_config.ListenerAuth -} - -// promHandlerStarter is the indirection point for the prom server. Default -// starts the real server; tests swap it for a no-op to skip the port-bind. -var promHandlerStarter = startPromServer - -// fatalf is the package-level abort handler. Defaults to log.Fatalf; -// tests swap this in for a capture so the serve error branch is -// exercisable without exiting. -var fatalf = log.Fatalf - -// startPromServer binds the prom listener now, so a bad address or a port in -// use fails startup before the daemon runs, then serves it on a worker that -// joins wg and drains when ctx ends. -func startPromServer(ctx context.Context, wg *sync.WaitGroup, p promParams) error { - handler, err := promHandler(p) - if err != nil { - return err - } - ep, err := listener.EndpointFromProto(p.listener, listener.NetworkTCP, p.listen) - if err != nil { - return fmt.Errorf("prometheus listener config: %w", err) - } - ln, err := listener.Listen(ctx, ep, p.ipv4TTL, p.ipv6HopLimit) - if err != nil { - return fmt.Errorf("prometheus error, listen: %w", err) - } - wg.Add(1) - go servePromHandler(ctx, wg, newPromServer(handler), ln, promShutdownGrace) - return nil -} - -// promHandler builds the prom listener's handler behind the listener auth -// policy. -func promHandler(p promParams) (http.Handler, error) { - // A dedicated mux (not http.DefaultServeMux) for this listener. This is what - // lets pprof be registered EXPLICITLY below without the blank - // `_ "net/http/pprof"` side-effect import (which trips gosec G108): that - // import's init() registers /debug/pprof/* on DefaultServeMux, so serving - // our own mux both keeps DefaultServeMux out of the request path and avoids - // a double-registration panic. - mux := http.NewServeMux() - mux.Handle(p.path, promhttp.HandlerFor( - prometheus.DefaultGatherer, - promhttp.HandlerOpts{ - EnableOpenMetrics: promEnableOpenMetrics, - MaxRequestsInFlight: promMaxRequestsInFlight, - }, - )) - // Liveness + readiness for container/k8s deployment, on the same listener. - mux.HandleFunc("/healthz", health.Healthz) - mux.HandleFunc("/readyz", health.Readyz) - // pprof on the prom listener for on-demand forensic stack snapshots. - // pprof.Index also serves the named runtime profiles - // (/debug/pprof/goroutine, /heap, …). - mux.HandleFunc("/debug/pprof/", pprof.Index) - mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline) - mux.HandleFunc("/debug/pprof/profile", pprof.Profile) - mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) - mux.HandleFunc("/debug/pprof/trace", pprof.Trace) - // Every other path is the embedded link monitor's, once the daemon has - // attached it; the patterns above are more specific and win. A promPath - // of "/" already serves every path. - if p.path != "/" { - mux.Handle("/", &linkMonitorHTTP) - } - // pprof exposes command lines, heap contents and CPU profiles, so it is - // an admin path; metrics and health checks are read paths. - policy, err := listenerauth.NewPolicy(p.auth, p.adminAuth, nil) - if err != nil { - return nil, fmt.Errorf("listener auth config invalid: %w", err) - } - return policy.WrapHTTP(mux, listenerauth.PathAccess("/debug/pprof/")), nil -} - -func newPromServer(handler http.Handler) *http.Server { - return &http.Server{ - Handler: handler, - ReadHeaderTimeout: 5 * time.Second, - ReadTimeout: 10 * time.Second, - // The link monitor's detail paths answer within their own 10s - // timeout; the write deadline leaves room to send the body. - WriteTimeout: 15 * time.Second, - IdleTimeout: 30 * time.Second, - } -} - -// servePromHandler serves ln until ctx ends, then drains in-flight requests -// for at most grace before closing what remains. A serve failure while ctx is -// live invokes fatalf: without the listener there are no health checks, so -// the daemon must not keep running unobserved. -func servePromHandler(ctx context.Context, wg *sync.WaitGroup, srv *http.Server, ln net.Listener, grace time.Duration) { - serveHTTP(ctx, wg, "prometheus", srv, ln, grace, func(err error) { fatalf("prometheus error: %v", err) }) -} - -// serveHTTP serves ln until ctx ends, then drains in-flight requests for at -// most grace before closing what remains. A serve failure while ctx is live -// calls failed. name prefixes the shutdown logs. -func serveHTTP(ctx context.Context, wg *sync.WaitGroup, name string, srv *http.Server, ln net.Listener, grace time.Duration, failed func(error)) { - defer wg.Done() - served := make(chan error, 1) - go func() { served <- srv.Serve(ln) }() - select { - case err := <-served: - failed(err) - return - case <-ctx.Done(): - } - shutdownCtx, cancel := context.WithTimeout(context.WithoutCancel(ctx), grace) - defer cancel() - if err := srv.Shutdown(shutdownCtx); err != nil { - log.Printf("%s shutdown: %v; closing", name, err) - if err := srv.Close(); err != nil { - log.Printf("%s close: %v", name, err) - } - } - if err := <-served; !errors.Is(err, http.ErrServerClosed) { - log.Printf("%s serve: %v", name, err) - } -} diff --git a/cmd/xtcp2/reexec_process_test.go b/cmd/xtcp2/reexec_process_test.go index 0b8238196..43711b94b 100644 --- a/cmd/xtcp2/reexec_process_test.go +++ b/cmd/xtcp2/reexec_process_test.go @@ -19,6 +19,8 @@ import ( "time" "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" + "github.com/randomizedcoder/xtcp2/pkg/listeners" + "github.com/randomizedcoder/xtcp2/pkg/xtcp" "golang.org/x/sys/unix" ) @@ -190,8 +192,13 @@ func runReexecChild(mode string) error { testArgs, testFlags := os.Args, flag.CommandLine os.Args = args flag.CommandLine = flag.NewFlagSet(args[0], flag.ContinueOnError) - promHandlerStarter = func(context.Context, *sync.WaitGroup, promParams) error { return nil } - daemonRunner = func(_ context.Context, _ context.CancelFunc, _ *xtcp_config.XtcpConfig) { + listenersStarter = func(context.Context, *sync.WaitGroup, []listeners.Spec, string) ([]xtcp.GRPCListener, error) { + return nil, nil + } + if err := os.Setenv("LISTENER_AUTH_MODE", "disabled"); err != nil { + return err + } + daemonRunner = func(context.Context, context.CancelFunc, *xtcp_config.XtcpConfig, []xtcp.GRPCListener) { // Run long enough for the profile's timer to be armed, then ask for // the restart the way runDaemonDefault does once it has drained. burnCPU(50 * time.Millisecond) diff --git a/cmd/xtcp2/reject_log.go b/cmd/xtcp2/reject_log.go new file mode 100644 index 000000000..367bd7326 --- /dev/null +++ b/cmd/xtcp2/reject_log.go @@ -0,0 +1,35 @@ +package main + +import ( + "log" + "net" + "sync/atomic" + "time" +) + +// ipRejectLogEvery bounds the log of connections a loopback listener closes, +// so a peer retrying in a loop cannot flood the log. +const ipRejectLogEvery = time.Minute + +// rateLimitedRejectLog logs a connection a loopback listener closed because +// its peer is not loopback, at most once per every, with the count closed +// since the last line, and the close error of the connection that line +// reports, if any. name is the listener's. +func rateLimitedRejectLog(name string, every time.Duration) func(net.Addr, error) { + var last atomic.Int64 + var count atomic.Int64 + return func(a net.Addr, closeErr error) { + n := count.Add(1) + now := time.Now().UnixNano() + prev := last.Load() + if now-prev < int64(every) || !last.CompareAndSwap(prev, now) { + return + } + count.Add(-n) + if closeErr != nil { + log.Printf("listener %q: closed %d connection(s) from non-loopback peers, last from %s: %v", name, n, a, closeErr) + return + } + log.Printf("listener %q: closed %d connection(s) from non-loopback peers, last from %s", name, n, a) + } +} diff --git a/cmd/xtcp2/reject_log_test.go b/cmd/xtcp2/reject_log_test.go new file mode 100644 index 000000000..d64915f72 --- /dev/null +++ b/cmd/xtcp2/reject_log_test.go @@ -0,0 +1,96 @@ +package main + +import ( + "errors" + "net" + "net/http" + "strings" + "testing" + "time" + + "github.com/randomizedcoder/xtcp2/pkg/xtcp" +) + +// TestLinkMonitorRoutesIP covers the /ip listener's late binding. +func TestLinkMonitorRoutesIP(t *testing.T) { + tests := []struct { + category, description, expected string + attach, detach bool + }{ + {"negative", "before a daemon starts", "404", false, false}, + {"negative", "a daemon run without a monitor", "404", true, false}, + {"corner", "after the daemon stops", "404", true, true}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + t.Logf("%s: %s; expected: %s", tc.category, tc.description, tc.expected) + l := &linkMonitorRoutes{promPath: "/metrics"} + if tc.attach { + detach, err := l.attach(&xtcp.XTCP{}) + if err != nil { + t.Fatal(err) + } + if tc.detach { + detach() + } + } + srv := newHTTPServer(l.ipRoutes()) + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatal(err) + } + go func() { _ = srv.Serve(ln) }() + defer func() { _ = srv.Close() }() + resp, err := http.Get("http://" + ln.Addr().String() + "/ip/link") + if err != nil { + t.Fatal(err) + } + _ = resp.Body.Close() + if resp.StatusCode != http.StatusNotFound { + t.Errorf("GET /ip/link = %d, want 404", resp.StatusCode) + } + }) + } +} + +func TestRateLimitedRejectLog(t *testing.T) { + peer := &net.TCPAddr{IP: net.IPv4(172, 17, 0, 2), Port: 40000} + tests := []struct { + category, description string + every time.Duration + rejects int + closeErr error + expected []string // log lines, in order + }{ + {"positive", "the first reject is logged at once, naming the listener", time.Hour, 1, nil, []string{`listener "ip": closed 1 connection(s)`}}, + {"negative", "a burst inside the window logs one line", time.Hour, 50, nil, []string{"closed 1 connection(s)"}}, + {"boundary", "no rejects, no log", time.Hour, 0, nil, nil}, + {"corner", "a zero window logs each reject with its own count", 0, 3, nil, []string{"closed 1 ", "closed 1 ", "closed 1 "}}, + {"corner", "a close error is on the line", time.Hour, 1, errors.New("close failed"), []string{"40000: close failed"}}, + } + for _, tc := range tests { + t.Run(tc.description, func(t *testing.T) { + t.Logf("%s: %s; expected: %v", tc.category, tc.description, tc.expected) + reject := rateLimitedRejectLog("ip", tc.every) + out := captureLog(t, func() { + for range tc.rejects { + reject(peer, tc.closeErr) + } + }) + var lines []string + for _, l := range strings.Split(strings.TrimSpace(out), "\n") { + if l != "" { + lines = append(lines, l) + } + } + if len(lines) != len(tc.expected) { + t.Fatalf("log lines = %q, want %d", lines, len(tc.expected)) + } + for i, want := range tc.expected { + if !strings.Contains(lines[i], want) || !strings.Contains(lines[i], "172.17.0.2:40000") { + t.Errorf("line %d = %q, want %q and the peer", i, lines[i], want) + } + } + }) + } +} diff --git a/cmd/xtcp2/secrets.go b/cmd/xtcp2/secrets.go index e27ae5988..d0f442821 100644 --- a/cmd/xtcp2/secrets.go +++ b/cmd/xtcp2/secrets.go @@ -6,9 +6,9 @@ import ( "fmt" "log" "os" - "strings" "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" + "github.com/randomizedcoder/xtcp2/pkg/secretfile" ) // flavorProduction is "true" in the production (slim) flavors, set at link @@ -66,32 +66,14 @@ func checkSecretFlags(fs *flag.FlagSet, production bool) error { return nil } -// secretFileModeMask is the permission bits a secret file must not have: -// any access for group or others. -const secretFileModeMask = 0o077 - -// readSecretFile reads a credential from the file a _FILE env var names. A -// missing, unreadable, non-regular or group/world-accessible file is an -// error: a credential the operator pointed at but xtcp2 cannot safely use -// must stop startup, not leave the listener or upload unauthenticated. -// Surrounding whitespace (a trailing newline) is trimmed. +// readSecretFile reads a credential from the file a _FILE env var names; see +// secretfile.Read. A file it cannot safely use is a usage error. func readSecretFile(env, path string) (string, error) { - fi, err := os.Stat(path) // follows symlinks, as Kubernetes secret mounts need - if err != nil { - return "", fmt.Errorf("%w: %s=%q: %w", errUsage, env, path, err) - } - if !fi.Mode().IsRegular() { - return "", fmt.Errorf("%w: %s=%q is not a regular file", errUsage, env, path) - } - if perm := fi.Mode().Perm(); perm&secretFileModeMask != 0 { - return "", fmt.Errorf("%w: %s=%q has mode %04o; a secret file must not be accessible by group or "+ - "others (chmod 0400; Kubernetes secret defaultMode: 0400)", errUsage, env, path, perm) - } - b, err := os.ReadFile(path) + v, err := secretfile.Read(env, path) if err != nil { - return "", fmt.Errorf("%w: %s=%q: %w", errUsage, env, path, err) + return "", fmt.Errorf("%w: %w", errUsage, err) } - return strings.TrimSpace(string(b)), nil + return v, nil } // secretFileTarget is one _FILE env var and where its value goes. diff --git a/cmd/xtcp2/testdata/defineflags-golden.txt b/cmd/xtcp2/testdata/defineflags-golden.txt index 360e36675..589ae7241 100644 --- a/cmd/xtcp2/testdata/defineflags-golden.txt +++ b/cmd/xtcp2/testdata/defineflags-golden.txt @@ -23,7 +23,7 @@ grpcListenNetwork gRPC listener network: empty/tcp for TCP, unix for a Unix dom grpcPort 8889 GRPC listening port grpcUnixSocketMode 384 gRPC Unix socket file mode, e.g. 0600 or 0660. Falls back to GRPC_UNIX_SOCKET_MODE env. grpcUnlinkStaleUnixSocket true remove an existing stale gRPC Unix socket before binding. Falls back to GRPC_UNLINK_STALE_UNIX_SOCKET env. -healthcheck false probe the local /readyz endpoint and exit 0 (ready) / 1 (not ready or unreachable), then exit WITHOUT starting the daemon. For a container HEALTHCHECK on the scratch image (no shell/curl); uses -promListen / PROM_LISTEN to find the port. +healthcheck false probe /readyz on the listener serving health and exit 0 (ready) / 1 (not ready or unreachable), then exit WITHOUT starting the daemon. For a container HEALTHCHECK on the scratch image (no shell/curl); reads the same listener flags and env as the daemon. hostname hostname stamped on records; defaults to os.Hostname(). Set this in a container, where os.Hostname() returns the container id, not the host. Falls back to XTCP_HOSTNAME env (NOT HOSTNAME). ioUring false Opt in to io_uring for netlink reads, one multishot recv per socket (Linux 6.1+). Destination writes stay syscalls ioUringCqeBatch 128 io_uring max CQEs reaped per PeekBatchCQE call (1-4096) @@ -63,6 +63,7 @@ linkMonitorStatsExclude ^$ regexp of interfaces excluded from statistics. Falls linkMonitorStatsInclude .* regexp of interfaces whose statistics are collected. Falls back to LINK_MONITOR_STATS_INCLUDE env. linkMonitorStatsInterval 15s interface statistics collection interval (positive). Falls back to LINK_MONITOR_STATS_INTERVAL env. linkMonitorWatchInterval 1m0s on demand: error and state polling interval (positive). Falls back to LINK_MONITOR_WATCH_INTERVAL env. +listener a listener, repeatable: name=,serves=[+...],address=[,network=unix|tcp][,mode=0600][,unlinkStale=true][,auth=raw|hmac-utc-minute|disabled][,tokenFile=][,hmacKeyFile=][,adminAuth=raw|hmac-utc-minute][,adminTokenFile=][,adminHmacKeyFile=]. Classes: health, metrics, metrics-detail, ip, debug, grpc-read, grpc-admin; each served by one listener. Credentials are files only. With none, xtcp2 serves health, metrics and metrics-detail on /run/xtcp2/metrics.sock (mode 0600, raw bearer token from LISTENER_RAW_TOKEN_FILE). Replaces the deprecated -prom*/-grpc*/-linkMonitorIPListen flags. Falls back to LISTENERS env, specs separated by ';'. listenerAdminAuthMode admin listener auth mode: disabled, raw, hmac-utc-minute. When set, admin RPCs and /debug/pprof require this credential and the shared listener credential becomes read-only. Falls back to LISTENER_ADMIN_AUTH_MODE env. listenerAdminHMACSharedKey admin listener auth HMAC shared key. Prefer LISTENER_ADMIN_HMAC_SHARED_KEY or LISTENER_ADMIN_HMAC_SHARED_KEY_FILE; never logged. listenerAdminRawToken admin listener auth raw bearer token. Prefer LISTENER_ADMIN_RAW_TOKEN or LISTENER_ADMIN_RAW_TOKEN_FILE; never logged. diff --git a/cmd/xtcp2/testdata/printflags-golden.txt b/cmd/xtcp2/testdata/printflags-golden.txt index fda436cf9..24278353e 100644 --- a/cmd/xtcp2/testdata/printflags-golden.txt +++ b/cmd/xtcp2/testdata/printflags-golden.txt @@ -105,4 +105,5 @@ compiledInEnrichers: {{compiledInEnrichers}} *promListenNetwork: promListenNetwork-v *promUnixSocketMode: 133 *promUnlinkStaleUnixSocket: true +*listener: listener-v *d: 138 diff --git a/cmd/xtcp2/xtcp2.go b/cmd/xtcp2/xtcp2.go index 6ecaec731..4d56205ed 100644 --- a/cmd/xtcp2/xtcp2.go +++ b/cmd/xtcp2/xtcp2.go @@ -24,6 +24,7 @@ import ( "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" "github.com/randomizedcoder/xtcp2/pkg/listener" "github.com/randomizedcoder/xtcp2/pkg/listenerauth" + "github.com/randomizedcoder/xtcp2/pkg/listeners" "github.com/randomizedcoder/xtcp2/pkg/misc" "github.com/randomizedcoder/xtcp2/pkg/xtcp" "google.golang.org/protobuf/encoding/protojson" @@ -372,6 +373,7 @@ type mainFlags struct { promUnixSocketMode *uint promUnlinkStaleUDS *bool promPath *string + listeners *listenerFlag healthcheck *bool goMaxProcs *uint maxThreads *int @@ -546,7 +548,13 @@ func defineListenerFlags(f *mainFlags) { f.promUnixSocketMode = flag.Uint("promUnixSocketMode", unixSocketModeCst, "Prometheus Unix socket file mode, e.g. 0600 or 0660. Falls back to PROM_UNIX_SOCKET_MODE env.") f.promUnlinkStaleUDS = flag.Bool("promUnlinkStaleUnixSocket", unlinkStaleSocketCst, "remove an existing stale Prometheus Unix socket before binding. Falls back to PROM_UNLINK_STALE_UNIX_SOCKET env.") f.promPath = flag.String("promPath", promPathCst, "Prometheus http path") - f.healthcheck = flag.Bool("healthcheck", false, "probe the local /readyz endpoint and exit 0 (ready) / 1 (not ready or unreachable), then exit WITHOUT starting the daemon. For a container HEALTHCHECK on the scratch image (no shell/curl); uses -promListen / PROM_LISTEN to find the port.") + f.listeners = &listenerFlag{} + flag.Var(f.listeners, "listener", "a listener, repeatable: "+listeners.SpecSyntax+ + ". Classes: health, metrics, metrics-detail, ip, debug, grpc-read, grpc-admin; each served by one listener. "+ + "Credentials are files only. With none, xtcp2 serves health, metrics and metrics-detail on "+listeners.DefaultSocketPath+ + " (mode 0600, raw bearer token from LISTENER_RAW_TOKEN_FILE). Replaces the deprecated -prom*/-grpc*/-linkMonitorIPListen flags. "+ + "Falls back to LISTENERS env, specs separated by ';'.") + f.healthcheck = flag.Bool("healthcheck", false, "probe /readyz on the listener serving health and exit 0 (ready) / 1 (not ready or unreachable), then exit WITHOUT starting the daemon. For a container HEALTHCHECK on the scratch image (no shell/curl); reads the same listener flags and env as the daemon.") } // defineRuntimeFlags registers the process-level knobs that are about how this @@ -757,6 +765,7 @@ func printListenerEndpointFlags(f *mainFlags) { fmt.Println("*promListenNetwork:", *f.promListenNetwork) fmt.Println("*promUnixSocketMode:", *f.promUnixSocketMode) fmt.Println("*promUnlinkStaleUnixSocket:", *f.promUnlinkStaleUDS) + fmt.Println("*listener:", f.listeners.String()) } func buildConfig(f *mainFlags, des *xtcp_config.EnabledDeserializers) *xtcp_config.XtcpConfig { @@ -1047,6 +1056,11 @@ func startupConfig(f *mainFlags) (*xtcp_config.XtcpConfig, int) { fmt.Fprintln(os.Stderr, "xtcp2:", err) return nil, exitCodeFor(err) } + environmentOverrideProm(f.promListen, f.promPath, debugLevel) + if err := configureListeners(c, *f.listeners, legacyListenerSettings(flag.CommandLine), *f.promListen); err != nil { + fmt.Fprintln(os.Stderr, "xtcp2:", err) + return nil, exitCodeFor(err) + } // Soft-restart carry: if a prior ConfigService.Set re-exec'd us with a full // config in the environment, that config wins over the flag/env-derived one. @@ -1078,7 +1092,7 @@ func startupConfig(f *mainFlags) (*xtcp_config.XtcpConfig, int) { } // runMain wires the production main body. Extracted so tests can run -// it with stubbed daemonRunner / promHandlerStarter. +// it with stubbed daemonRunner / listenersStarter. func runMain(ctx context.Context) int { runCtx, cancel := context.WithCancel(ctx) defer cancel() @@ -1096,30 +1110,32 @@ func runMain(ctx context.Context) int { fmt.Fprintln(os.Stderr, "xtcp2:", err) return exitCodeFor(err) } - healthAuth := buildListenerAuth(f) - healthCfg := &xtcp_config.XtcpConfig{ListenerAuth: healthAuth} - envOverrideListenerAuth(healthCfg, 0) - if err := applyListenerSecretFiles(healthCfg); err != nil { - fmt.Fprintln(os.Stderr, "xtcp2:", err) - return exitCodeFor(err) - } // Container HEALTHCHECK mode: probe the local /readyz and exit, without // starting the daemon. The scratch image has no shell/curl, so the binary // self-checks (same pattern as the docker_custom_scrape exporter). if *f.healthcheck { - authn, err := listenerauth.New(healthAuth) - if err != nil { - log.Printf("healthcheck: invalid listener auth config: %v", err) - return 1 - } - return runHealthcheck(runCtx, *f.promListenNetwork, *f.promListen, authn, listenerauth.ClientAuth{RawToken: healthAuth.GetRawToken(), HMACSharedKey: healthAuth.GetHmacSharedKey()}) + return runHealthcheck(runCtx, f) } c, code := startupConfig(f) if c == nil { return code } + // Validate the whole config, then resolve the listeners and their + // credentials, before anything binds or starts. + if err := protovalidate.Validate(c); err != nil { + fmt.Fprintln(os.Stderr, "xtcp2: config validation failed:", err) + return exitUsage + } + specs, warnings, err := listeners.Resolve(c, readSecretFile) + for _, w := range warnings { + log.Printf("WARNING: %s", w) + } + if err != nil { + fmt.Fprintln(os.Stderr, "xtcp2:", err) + return exitCodeFor(err) + } environmentOverrideGoMaxProcs(f.goMaxProcs, debugLevel) if runtime.NumCPU() > int(*f.goMaxProcs) { @@ -1148,45 +1164,23 @@ func runMain(ctx context.Context) int { uint(c.PyroscopeSampleHz), uint(c.PyroscopeUploadIntervalSec), debugLevel)() - environmentOverrideProm(f.promListen, f.promPath, debugLevel) - applyPrometheusListenerAddress(c, *f.promListen) - if _, err := listenerauth.NewPolicy(c.ListenerAuth, c.AdminListenerAuth, nil); err != nil { - fatalf("listener auth config invalid: %v", err) - return 1 - } linkMonitorHTTP.promPath = *f.promPath - // The prom server drains after the daemon, so scrapes and /readyz see the - // shutdown through to the end. - var promWG sync.WaitGroup - defer promWG.Wait() + // The HTTP listeners drain after the daemon, so scrapes and /readyz see + // the shutdown through to the end. + var httpWG sync.WaitGroup + defer httpWG.Wait() defer cancel() - if err := promHandlerStarter(runCtx, &promWG, promParams{ - path: *f.promPath, listener: c.PrometheusListener, listen: *f.promListen, - ipv4TTL: c.Ipv4Ttl, ipv6HopLimit: c.Ipv6HopLimit, auth: c.ListenerAuth, adminAuth: c.AdminListenerAuth, - }); err != nil { - fatalf("%v", err) - return 1 - } - if debugLevel > 10 { - log.Println("Prometheus http listener started on:", *f.promListen, *f.promPath) - } - if err := ipServerStarter(runCtx, &promWG, c.GetLinkMonitor()); err != nil { - fatalf("%v", err) - return 1 - } - - if err := protovalidate.Validate(c); err != nil { - fatalf("config validation failed: %v", err) - return 1 - } - if debugLevel > 10 { - log.Println("config validation succeeded") + grpcLns, err := listenersStarter(runCtx, &httpWG, specs, *f.promPath) + if err != nil { + fmt.Fprintln(os.Stderr, "xtcp2:", err) + return exitCodeFor(err) } - daemonRunner(runCtx, cancel, c) + daemonRunner(runCtx, cancel, c, grpcLns) + closeGRPCListeners(grpcLns) // The signal handler exits once complete is sent, so drain first. cancel() - promWG.Wait() + httpWG.Wait() select { case complete <- struct{}{}: default: @@ -1199,8 +1193,9 @@ func runMain(ctx context.Context) int { // runDaemonDefault is the production daemon body: build an xtcp instance // and run RunWithPoller until ctx cancels the WG. -func runDaemonDefault(ctx context.Context, cancel context.CancelFunc, c *xtcp_config.XtcpConfig) { +func runDaemonDefault(ctx context.Context, cancel context.CancelFunc, c *xtcp_config.XtcpConfig, grpcLns []xtcp.GRPCListener) { x := xtcp.NewXTCP(ctx, cancel, c) + x.SetGRPCListeners(grpcLns) detach, err := linkMonitorHTTP.attach(x) if err != nil { fatalf("link monitor http: %v", err) @@ -1395,95 +1390,92 @@ func awaitSignalAndShutdown( } } -// runHealthcheck probes the local /readyz endpoint and returns a process exit -// code: 0 when ready (HTTP 200), 1 otherwise (not ready, or unreachable). It is -// the `-healthcheck` mode used by the container HEALTHCHECK on the scratch image -// (no shell/curl to run an external probe). The port comes from PROM_LISTEN or -// the -promListen flag; the daemon listens on 0.0.0.0, so 127.0.0.1 reaches it. -func runHealthcheck(ctx context.Context, promNetwork, promListen string, authn *listenerauth.Authenticator, clientAuth listenerauth.ClientAuth) int { - network := promNetwork - if v, ok := os.LookupEnv("PROM_LISTEN_NETWORK"); ok && v != "" { - network = v +// runHealthcheck probes /readyz on the listener serving health and returns a +// process exit code: 0 when ready (HTTP 200), 1 otherwise (not ready, or +// unreachable). It is the `-healthcheck` mode used by the container +// HEALTHCHECK on the scratch image (no shell/curl to run an external probe). +// It resolves the listeners from the same flags and env as the daemon, +// quietly, and sends the health listener's credential. +func runHealthcheck(ctx context.Context, f *mainFlags) int { + c := buildConfig(f, nil) + environmentOverrideConfig(c, 0) + environmentOverrideProm(f.promListen, f.promPath, 0) + err := applyListenerSecretFiles(c) + if err == nil { + err = configureListeners(c, *f.listeners, legacyListenerSettings(flag.CommandLine), *f.promListen) } - addr := promListen - if v, ok := os.LookupEnv("PROM_LISTEN"); ok && v != "" { - addr = v + var specs []listeners.Spec + if err == nil { + specs, _, err = listeners.Resolve(c, readSecretFile) } - parsed, err := listener.ParseNetwork(network) if err != nil { log.Printf("healthcheck: %v", err) return 1 } - if parsed == xtcp_config.ListenerNetwork_LISTENER_NETWORK_UNIX { - return runUnixHealthcheck(ctx, addr, authn, clientAuth) + s, ok := listeners.Find(specs, listeners.Health) + if !ok { + log.Printf("healthcheck: no listener serves health") + return 1 } - _, port, err := net.SplitHostPort(addr) - if err != nil || port == "" { - port = "9088" // promListenCst default + return probeReady(ctx, s.Endpoint, s.ClientAuth()) +} + +// probeReady GETs /readyz on ep. A TCP listener on an unspecified address is +// probed on loopback. +func probeReady(ctx context.Context, ep listener.Endpoint, clientAuth listenerauth.ClientAuth) int { + target := "unix:" + ep.Address + url := "http://unix/readyz" + var d net.Dialer + dial := func(ctx context.Context, _, _ string) (net.Conn, error) { + return d.DialContext(ctx, listener.NetworkUnix, ep.Address) + } + if ep.Network == listener.NetworkTCP { + addr, err := loopbackTarget(ep.Address) + if err != nil { + log.Printf("healthcheck: %v", err) + return 1 + } + target, url = addr, "http://"+addr+"/readyz" + dial = func(ctx context.Context, _, _ string) (net.Conn, error) { + return d.DialContext(ctx, listener.NetworkTCP, addr) + } } - url := "http://127.0.0.1:" + port + "/readyz" reqCtx, cancel := context.WithTimeout(ctx, 3*time.Second) defer cancel() req, err := http.NewRequestWithContext(reqCtx, http.MethodGet, url, nil) if err != nil { - log.Printf("healthcheck: new request %s: %v", url, err) + log.Printf("healthcheck: new request %s: %v", target, err) return 1 } - if authn != nil { - listenerauth.HTTPRequestWithClientAuth(req, clientAuth, time.Now()) - } - client := &http.Client{Timeout: 3 * time.Second} + listenerauth.HTTPRequestWithClientAuth(req, clientAuth, time.Now()) + client := &http.Client{Timeout: 3 * time.Second, Transport: &http.Transport{DialContext: dial}} resp, err := client.Do(req) if err != nil { - log.Printf("healthcheck: GET %s: %v", url, err) + log.Printf("healthcheck: GET %s /readyz: %v", target, err) return 1 } defer func() { _ = resp.Body.Close() }() if resp.StatusCode == http.StatusOK { return 0 } - log.Printf("healthcheck: %s -> %d", url, resp.StatusCode) + log.Printf("healthcheck: %s /readyz -> %d", target, resp.StatusCode) return 1 } -// runUnixHealthcheck is runHealthcheck over a Unix socket. It sends the same -// credential as the TCP probe, so -listenerAuthMode on a socket listener -// doesn't fail the container HEALTHCHECK with 401. -func runUnixHealthcheck(ctx context.Context, socketPath string, authn *listenerauth.Authenticator, clientAuth listenerauth.ClientAuth) int { - if socketPath == "" { - log.Printf("healthcheck: unix socket path is empty") - return 1 - } - reqCtx, cancel := context.WithTimeout(ctx, 3*time.Second) - defer cancel() - req, err := http.NewRequestWithContext(reqCtx, http.MethodGet, "http://unix/readyz", nil) +// loopbackTarget is the address to probe a TCP listener on: its own, or +// loopback when it listens on all addresses. +func loopbackTarget(address string) (string, error) { + host, port, err := net.SplitHostPort(address) if err != nil { - log.Printf("healthcheck: new unix request: %v", err) - return 1 + return "", fmt.Errorf("health listener address %q: %w", address, err) } - if authn != nil { - listenerauth.HTTPRequestWithClientAuth(req, clientAuth, time.Now()) + switch host { + case "", "0.0.0.0": + host = "127.0.0.1" + case "::": + host = "::1" } - client := &http.Client{ - Timeout: 3 * time.Second, - Transport: &http.Transport{ - DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) { - var d net.Dialer - return d.DialContext(ctx, listener.NetworkUnix, socketPath) - }, - }, - } - resp, err := client.Do(req) - if err != nil { - log.Printf("healthcheck: GET unix:%s /readyz: %v", socketPath, err) - return 1 - } - defer func() { _ = resp.Body.Close() }() - if resp.StatusCode == http.StatusOK { - return 0 - } - log.Printf("healthcheck: unix:%s /readyz -> %d", socketPath, resp.StatusCode) - return 1 + return net.JoinHostPort(host, port), nil } // environmentOverrideProm MUTATES promListen, promPath, if the environment @@ -1587,7 +1579,13 @@ func buildAdminListenerAuth(f *mainFlags) *xtcp_config.ListenerAuth { return a } +// listenerAuthModeValue parses a mode flag or env value. Empty is unset, not +// disabled: an unset read credential resolves to raw, so turning auth off +// has to be typed. func listenerAuthModeValue(s string) xtcp_config.ListenerAuthMode { + if strings.TrimSpace(s) == "" { + return xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_UNSPECIFIED + } mode, err := listenerauth.ParseMode(s) if err != nil { return xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_UNSPECIFIED @@ -1625,7 +1623,7 @@ func envOverrideListenerAuth(c *xtcp_config.XtcpConfig, debugLevel uint) { // HMAC_SHARED_KEY. The _FILE forms are read afterwards by // applySecretFiles, which can fail startup on a bad file. func envOverrideAuthCredential(a *xtcp_config.ListenerAuth, prefix, what string, debugLevel uint) { - if v, ok := envString(prefix + "AUTH_MODE"); ok { + if v, ok := envString(prefix + "AUTH_MODE"); ok && strings.TrimSpace(v) != "" { if mode, err := listenerauth.ParseMode(v); err == nil { a.Mode = mode logEnv(prefix+"AUTH_MODE", what+" auth mode set", debugLevel) @@ -2133,12 +2131,6 @@ func ensurePrometheusListener(c *xtcp_config.XtcpConfig) *xtcp_config.ListenerEn return c.PrometheusListener } -func applyPrometheusListenerAddress(c *xtcp_config.XtcpConfig, promListen string) { - if c.PrometheusListener != nil && c.PrometheusListener.Address == "" { - c.PrometheusListener.Address = promListen - } -} - func printConfig(c *xtcp_config.XtcpConfig, comment string) { fmt.Println(comment) fmt.Println("c.NlTimeoutMilliseconds:", c.NlTimeoutMilliseconds) diff --git a/cmd/xtcp2/xtcp2_flags_helpers_test.go b/cmd/xtcp2/xtcp2_flags_helpers_test.go index a2cd4182e..a33f39ccd 100644 --- a/cmd/xtcp2/xtcp2_flags_helpers_test.go +++ b/cmd/xtcp2/xtcp2_flags_helpers_test.go @@ -89,7 +89,7 @@ const ( // mainFlags field must be a registered flag and every registered flag must // have a field. A flag added without a field, or a field that stops being // registered, is the drift this file exists to notice. - mainFlagsFieldCountCst = 127 + mainFlagsFieldCountCst = 128 printFlagsGoldenCst = "testdata/printflags-golden.txt" defineFlagsGoldenCst = "testdata/defineflags-golden.txt" @@ -275,6 +275,7 @@ func populatedMainFlags() *mainFlags { promUnixSocketMode: u(133), promUnlinkStaleUDS: b(true), promPath: s("promPath-v"), + listeners: &listenerFlag{"listener-v"}, healthcheck: b(false), goMaxProcs: u(134), maxThreads: i(135), @@ -740,6 +741,8 @@ func TestPopulatedMainFlagsValuesAreDistinct(t *testing.T) { key = fmt.Sprintf("int:%d", elem.Int()) case reflect.Uint, reflect.Uint64: key = fmt.Sprintf("uint:%d", elem.Uint()) + case reflect.Slice: // listenerFlag + key = "slice:" + strings.Join(*f.listeners, ";") default: t.Errorf("mainFlags.%s has unhandled element kind %s", field.Name, field.Type.Elem().Kind()) continue diff --git a/cmd/xtcp2/xtcp2_test.go b/cmd/xtcp2/xtcp2_test.go index 5fa2fd36e..7600a785c 100644 --- a/cmd/xtcp2/xtcp2_test.go +++ b/cmd/xtcp2/xtcp2_test.go @@ -23,7 +23,9 @@ import ( "google.golang.org/protobuf/types/known/durationpb" "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" + "github.com/randomizedcoder/xtcp2/pkg/listener" "github.com/randomizedcoder/xtcp2/pkg/listenerauth" + "github.com/randomizedcoder/xtcp2/pkg/xtcp" ) // envHelperReset tears down any flag-package state captured by other @@ -568,35 +570,117 @@ func TestAwaitSignalAndShutdown_completeBeforeTimeout(t *testing.T) { } } -func TestRunHealthcheck(t *testing.T) { - portOf := func(url string) string { - _, p, _ := net.SplitHostPort(strings.TrimPrefix(url, "http://")) +func TestProbeReady(t *testing.T) { + serve := func(code int) string { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(code) })) + t.Cleanup(srv.Close) + _, p, _ := net.SplitHostPort(strings.TrimPrefix(srv.URL, "http://")) return p } - - notReady := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { - w.WriteHeader(http.StatusServiceUnavailable) - })) - defer notReady.Close() - if rc := runHealthcheck(context.Background(), "", ":"+portOf(notReady.URL), nil, listenerauth.ClientAuth{}); rc != 1 { - t.Errorf("not-ready: rc=%d, want 1", rc) + tests := []struct { + name, category, description string + address string + expected int + }{ + {"ready_any_address", "positive", "a listener on all addresses is probed on loopback", ":" + serve(http.StatusOK), 0}, + {"ready_explicit", "positive", "an explicit loopback address is probed as is", "127.0.0.1:" + serve(http.StatusOK), 0}, + {"not_ready", "negative", "503 from /readyz", ":" + serve(http.StatusServiceUnavailable), 1}, + {"unreachable", "boundary", "nothing listening", "127.0.0.1:1", 1}, + {"no_port", "corner", "an address without a port", "127.0.0.1", 1}, } - - ready := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { - w.WriteHeader(http.StatusOK) - })) - defer ready.Close() - if rc := runHealthcheck(context.Background(), "", ":"+portOf(ready.URL), nil, listenerauth.ClientAuth{}); rc != 0 { - t.Errorf("ready: rc=%d, want 0", rc) + for _, tc := range tests { + t.Run(tc.category+"/"+tc.name, func(t *testing.T) { + ep := listener.Endpoint{Network: listener.NetworkTCP, Address: tc.address} + var rc int + captureLog(t, func() { rc = probeReady(context.Background(), ep, listenerauth.ClientAuth{}) }) + if rc != tc.expected { + t.Errorf("%s: rc = %d, want %d", tc.description, rc, tc.expected) + } + }) } +} - // Nothing listening -> unreachable -> 1. - if rc := runHealthcheck(context.Background(), "", ":1", nil, listenerauth.ClientAuth{}); rc != 1 { - t.Errorf("unreachable: rc=%d, want 1", rc) +// TestRunHealthcheck drives -healthcheck end to end: it finds the health +// listener from the same flags and env as the daemon and sends its +// credential. +func TestRunHealthcheck(t *testing.T) { + tests := []struct { + name, category, description string + args func(sock, tokenFile string) []string + env func(sock, tokenFile string) map[string]string + serverToken string + expected int + }{ + {"listeners_env", "positive", "LISTENERS names the health listener", + func(string, string) []string { return nil }, + func(sock, _ string) map[string]string { + return map[string]string{"LISTENERS": "name=h,serves=health+metrics,address=" + sock + ",auth=disabled"} + }, "", 0}, + {"listener_flag_token", "positive", "the probe sends the listener's token file", + func(sock, tf string) []string { + return []string{"-listener", "name=h,serves=health,address=" + sock + ",tokenFile=" + tf} + }, + func(string, string) map[string]string { return nil }, "tok", 0}, + {"legacy_prom_flags", "positive", "the deprecated -promListen flags still find the listener", + func(sock, _ string) []string { return []string{"-promListenNetwork", "unix", "-promListen", sock} }, + func(string, string) map[string]string { return map[string]string{"LISTENER_AUTH_MODE": "disabled"} }, "", 0}, + {"no_health_listener", "negative", "no listener serves health", + func(sock, _ string) []string { + return []string{"-listener", "name=m,serves=metrics,address=" + sock + ",auth=disabled"} + }, + func(string, string) map[string]string { return nil }, "", 1}, + {"default_without_token", "negative", "the default listener needs a token the probe does not have", + func(string, string) []string { return nil }, + func(string, string) map[string]string { return nil }, "", 1}, + {"wrong_token", "boundary", "the listener's token differs from the server's", + func(sock, tf string) []string { + return []string{"-listener", "name=h,serves=health,address=" + sock + ",tokenFile=" + tf} + }, + func(string, string) map[string]string { return nil }, "other", 1}, + } + for _, tc := range tests { + t.Run(tc.category+"/"+tc.name, func(t *testing.T) { + envHelperReset(t) + dir, err := os.MkdirTemp("/tmp", "xtcp2-hc-") + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { _ = os.RemoveAll(dir) }) + sock := filepath.Join(dir, "h.sock") + tf := filepath.Join(dir, "token") + if err := os.WriteFile(tf, []byte("tok\n"), 0o600); err != nil { + t.Fatal(err) + } + ln, err := net.Listen("unix", sock) + if err != nil { + t.Fatal(err) + } + srv := &http.Server{ReadHeaderTimeout: time.Second, Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if tc.serverToken != "" && r.Header.Get("Authorization") != "Bearer "+tc.serverToken { + w.WriteHeader(http.StatusUnauthorized) + return + } + w.WriteHeader(http.StatusOK) + })} + go func() { _ = srv.Serve(ln) }() + t.Cleanup(func() { _ = srv.Close() }) + for k, v := range tc.env(sock, tf) { + t.Setenv(k, v) + } + f := defineFlags() + if err := flag.CommandLine.Parse(tc.args(sock, tf)); err != nil { + t.Fatal(err) + } + var rc int + captureLog(t, func() { rc = runHealthcheck(context.Background(), f) }) + if rc != tc.expected { + t.Errorf("%s: rc = %d, want %d", tc.description, rc, tc.expected) + } + }) } } -func TestRunHealthcheckUnix(t *testing.T) { +func TestProbeReadyUnix(t *testing.T) { raw := func(token string) *xtcp_config.ListenerAuth { return &xtcp_config.ListenerAuth{Mode: xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN, RawToken: token} } @@ -620,13 +704,18 @@ func TestRunHealthcheckUnix(t *testing.T) { {"negative", "an HMAC token signed with another key is refused", hmacKey("shared"), hmacKey("other"), false, "", 1}, {"negative", "an authenticated probe of a not-ready daemon still fails", raw("read-token"), raw("read-token"), true, "", 1}, {"boundary", "nothing listens on the socket path", nil, &xtcp_config.ListenerAuth{}, false, "missing", 1}, - {"boundary", "an empty socket path fails before dialing", nil, &xtcp_config.ListenerAuth{}, false, "empty", 1}, - {"corner", "a nil authenticator sends no header, so an auth-on listener refuses it", raw("read-token"), nil, false, "", 1}, + {"boundary", "an empty socket path fails", nil, &xtcp_config.ListenerAuth{}, false, "empty", 1}, + {"corner", "no client credential sends no header, so an auth-on listener refuses it", raw("read-token"), nil, false, "", 1}, } for _, tc := range tests { t.Run(tc.description, func(t *testing.T) { t.Logf("%s: %s; expected: rc=%d", tc.category, tc.description, tc.expected) - sock := filepath.Join(t.TempDir(), "prom.sock") + dir, err := os.MkdirTemp("/tmp", "xtcp2-pr-") // short: sun_path is 108 bytes + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { _ = os.RemoveAll(dir) }) + sock := filepath.Join(dir, "prom.sock") ln, err := net.Listen("unix", sock) if err != nil { t.Fatalf("net.Listen(unix): %v", err) @@ -654,13 +743,8 @@ func TestRunHealthcheckUnix(t *testing.T) { go func() { _ = srv.Serve(ln) }() t.Cleanup(func() { _ = srv.Close() }) - var authn *listenerauth.Authenticator var clientAuth listenerauth.ClientAuth if tc.client != nil { - authn, err = listenerauth.New(tc.client) - if err != nil { - t.Fatalf("client listenerauth.New: %v", err) - } clientAuth = listenerauth.ClientAuth{RawToken: tc.client.GetRawToken(), HMACSharedKey: tc.client.GetHmacSharedKey()} } path := sock @@ -669,9 +753,9 @@ func TestRunHealthcheckUnix(t *testing.T) { path = filepath.Join(t.TempDir(), "missing.sock") case "empty": path = "" - t.Setenv("PROM_LISTEN", "") } - if rc := runHealthcheck(context.Background(), "unix", path, authn, clientAuth); rc != tc.expected { + ep := listener.Endpoint{Network: listener.NetworkUnix, Address: path} + if rc := probeReady(context.Background(), ep, clientAuth); rc != tc.expected { t.Errorf("rc=%d, want %d", rc, tc.expected) } }) @@ -687,10 +771,7 @@ func TestRunMain_version(t *testing.T) { os.Args = []string{"xtcp2", "-v"} t.Cleanup(func() { os.Args = prevArgs }) - // Stub the prom handler starter so it doesn't bind a port. - prevProm := promHandlerStarter - promHandlerStarter = func(context.Context, *sync.WaitGroup, promParams) error { return nil } - t.Cleanup(func() { promHandlerStarter = prevProm }) + stubListeners(t) // runMain routes signals and spawns a signal-handler goroutine. // The goroutine leak is fine for a test that exits quickly. @@ -708,9 +789,7 @@ func TestRunMain_conf(t *testing.T) { os.Args = []string{"xtcp2", "-conf"} t.Cleanup(func() { os.Args = prevArgs }) - prevProm := promHandlerStarter - promHandlerStarter = func(context.Context, *sync.WaitGroup, promParams) error { return nil } - t.Cleanup(func() { promHandlerStarter = prevProm }) + stubListeners(t) captureLog(t, func() { if rc := runMain(t.Context()); rc != 0 { @@ -727,13 +806,11 @@ func TestRunMain_stubbedDaemon(t *testing.T) { os.Args = []string{"xtcp2", "-dest", "null"} t.Cleanup(func() { os.Args = prevArgs }) - prevProm := promHandlerStarter - promHandlerStarter = func(context.Context, *sync.WaitGroup, promParams) error { return nil } - t.Cleanup(func() { promHandlerStarter = prevProm }) + stubListeners(t) prevDaemon := daemonRunner called := false - daemonRunner = func(_ context.Context, _ context.CancelFunc, _ *xtcp_config.XtcpConfig) { + daemonRunner = func(context.Context, context.CancelFunc, *xtcp_config.XtcpConfig, []xtcp.GRPCListener) { called = true } t.Cleanup(func() { daemonRunner = prevDaemon }) @@ -1732,9 +1809,7 @@ func TestRunMainRejectsPositional(t *testing.T) { prevArgs := os.Args os.Args = tc.argv t.Cleanup(func() { os.Args = prevArgs }) - prevProm := promHandlerStarter - promHandlerStarter = func(context.Context, *sync.WaitGroup, promParams) error { return nil } - t.Cleanup(func() { promHandlerStarter = prevProm }) + stubListeners(t) captureLog(t, func() { if rc := runMain(t.Context()); rc != tc.expected { t.Errorf("rc = %d, want %d", rc, tc.expected) diff --git a/cmd/xtcp2client/readme.md b/cmd/xtcp2client/readme.md index b99c1bb27..0aee5ba25 100644 --- a/cmd/xtcp2client/readme.md +++ b/cmd/xtcp2client/readme.md @@ -23,11 +23,12 @@ network blip doesn't end the stream. nix build .#xtcp2client alias xtcp2client=./result/bin/xtcp2client -# Listen mode over TCP — stream records the daemon collects on its own schedule -xtcp2client -target 127.0.0.1 -port 8889 +# Listen mode — stream records the daemon collects on its own schedule, +# from unix:/run/xtcp2/grpc.sock +XTCP2_GRPC_AUTH_TOKEN_FILE=/run/secrets/xtcp2-read xtcp2client -# Listen mode over a local Unix domain socket -xtcp2client -network unix -unixSocket /run/xtcp2/grpc.sock +# Over TCP +xtcp2client -network tcp -target 127.0.0.1 -port 8889 # Poll mode — drive collection from the client, every 2s xtcp2client -poll -pollFrequency 2s @@ -37,20 +38,21 @@ xtcp2client -format csv -columns hostname,inetDiagMsgSocketSource,inetDiagMsgSta xtcp2client -format humanize # decoded IPs, TCP-state names, RFC3339 time ``` -The daemon's gRPC TCP port defaults to `8889` and **must match** its `-grpcPort`. -For local hardening, run the daemon with `-grpcListenNetwork unix` and connect -with `-network unix -unixSocket ...`. Token authentication is not enforced yet, -so protect TCP listeners with loopback/trusted networks and protect UDS -listeners with filesystem ownership and mode. +The daemon serves gRPC only on a listener configured for it, for example +`-listener name=grpc,serves=grpc-read+grpc-admin,address=/run/xtcp2/grpc.sock,tokenFile=,adminTokenFile=`. +Listen mode needs `grpc-read`; poll mode (`PollFlatRecords`) drives collection, +so it is an admin method and needs `grpc-admin` and, on a listener with an +admin credential, `XTCP2_GRPC_ADMIN_TOKEN_FILE`. See +[listeners](../../docs/security.md#listeners). ## Flags | Flag | Default | Purpose | |---|---|---| -| `-network` | `tcp` | gRPC transport network: `tcp` or `unix`. | -| `-target` | `localhost` | Daemon hostname. | -| `-port` | `8889` | Daemon gRPC port (must match the daemon's `-grpcPort`). | -| `-unixSocket` | — | UDS path when `-network unix`. | +| `-network` | `unix` | gRPC transport network: `unix` or `tcp`. | +| `-unixSocket` | `/run/xtcp2/grpc.sock` | Socket path when `-network unix`. | +| `-target` | `localhost` | Daemon hostname when `-network tcp`. | +| `-port` | `8889` | Daemon gRPC port when `-network tcp`. | | `-poll` | `false` | Use `PollFlatRecords` (client-driven) instead of `FlatRecords`. | | `-pollFrequency` | `10s` | Poll interval, poll mode only. | | `-format` | `json` | Output: `json`, `csv`, `tsv`, `humanize`, or `null`. | diff --git a/cmd/xtcp2client/xtcp2client.go b/cmd/xtcp2client/xtcp2client.go index 1b35e970d..c6e0b9da8 100644 --- a/cmd/xtcp2client/xtcp2client.go +++ b/cmd/xtcp2client/xtcp2client.go @@ -16,6 +16,7 @@ import ( "github.com/randomizedcoder/xtcp2/gen/go/xtcp_flat_record" "github.com/randomizedcoder/xtcp2/pkg/listener" "github.com/randomizedcoder/xtcp2/pkg/listenerauth" + "github.com/randomizedcoder/xtcp2/pkg/listeners" "github.com/randomizedcoder/xtcp2/pkg/misc" "github.com/randomizedcoder/xtcp2/pkg/recordfmt" "google.golang.org/grpc" @@ -44,11 +45,9 @@ const ( signalChannelSizeCst = 10 tagertHostnameCst = "localhost" - // grpcPortCst MUST match the xtcp2 daemon's default in cmd/xtcp2 - // (currently 8889). Keeping these in sync is a footgun — a future - // CLAUDE: the daemon's port is exposed via a const in cmd/xtcp2, - // and shipping them out-of-step turns every gRPC roundtrip into a - // silent connection refused. + // grpcPortCst is the port for -network tcp: the daemon's deprecated + // -grpcPort default. The default is the Unix socket, + // listeners.DefaultGRPCSocketPath. grpcPortCst = "8889" pollFrequencyCst = 10 * time.Second @@ -122,10 +121,10 @@ func main() { func runMain(ctx context.Context, args []string, stdout, stderr io.Writer) int { fs := flag.NewFlagSet("xtcp2client", flag.ContinueOnError) fs.SetOutput(stderr) - networkFlag := fs.String("network", listener.NetworkTCP, "gRPC network: tcp or unix") - target := fs.String("target", tagertHostnameCst, "Target hostanme") - port := fs.String("port", grpcPortCst, "Target gRPC port (must match the xtcp2 daemon's -grpcPort flag)") - unixSocket := fs.String("unixSocket", "", "Target gRPC Unix socket path when -network unix") + networkFlag := fs.String("network", listener.NetworkUnix, "gRPC network: unix or tcp") + target := fs.String("target", tagertHostnameCst, "Target hostname when -network tcp") + port := fs.String("port", grpcPortCst, "Target gRPC port when -network tcp") + unixSocket := fs.String("unixSocket", listeners.DefaultGRPCSocketPath, "Target gRPC Unix socket path when -network unix") poll := fs.Bool("poll", false, "poll mode means the client will trigger polling via the PollFlatRecords service") pollFrequency := fs.Duration("pollFrequency", pollFrequencyCst, "poll mode frequency") workers := fs.Int("workers", 10, "workers") diff --git a/cmd/xtcp2ctl/readme.md b/cmd/xtcp2ctl/readme.md index 3dd57e210..913a69a3a 100644 --- a/cmd/xtcp2ctl/readme.md +++ b/cmd/xtcp2ctl/readme.md @@ -21,13 +21,19 @@ Two tiers of change — pick the least disruptive one that does the job: ```sh # Build (produces ./result/bin/xtcp2ctl) nix build .#xtcp2ctl -alias xtcp2ctl=./result/bin/xtcp2ctl # all commands accept -target / -port, or -network unix +alias xtcp2ctl=./result/bin/xtcp2ctl # connects to unix:/run/xtcp2/grpc.sock + +# The daemon serves gRPC only on a listener configured for it: +# xtcp2 -listener name=grpc,serves=grpc-read+grpc-admin,address=/run/xtcp2/grpc.sock,tokenFile=/run/secrets/xtcp2-read,adminTokenFile=/run/secrets/xtcp2-admin +export XTCP2_GRPC_AUTH_TOKEN_FILE=/run/secrets/xtcp2-read +export XTCP2_GRPC_ADMIN_TOKEN_FILE=/run/secrets/xtcp2-admin # Inspect the running config (S3 creds redacted) xtcp2ctl get -# Inspect over a local Unix domain socket -xtcp2ctl get -network unix -unixSocket /run/xtcp2/grpc.sock +# Another socket, or TCP +xtcp2ctl get -unixSocket /run/other/grpc.sock +xtcp2ctl get -network tcp -target 127.0.0.1 -port 8889 # Hot changes — take effect immediately xtcp2ctl set-poll-frequency -frequency 30s -timeout 5s @@ -60,16 +66,16 @@ Because empty credential fields are treated as *unchanged*, the redacted | `set-s3` | `-flush-interval`, `-threshold-bytes` (at least one) | hot | | `reconfigure` | `-file` (`-` = stdin) | soft restart | -Common flags on every command: `-network` (`tcp` or `unix`), `-target` (default -`localhost`), `-port` (default `8889`, must match the daemon's `-grpcPort`), -`-unixSocket` (required with `-network unix`), and `-d` (debug level). Run +Common flags on every command: `-network` (`unix` or `tcp`, default `unix`), +`-unixSocket` (default `/run/xtcp2/grpc.sock`), `-target` and `-port` (with +`-network tcp`; default `localhost` and `8889`), and `-d` (debug level). Run `xtcp2ctl -h` for per-command flags. -> **Security.** This slice adds UDS transport support, but token authentication -> is not enforced yet. `get` redacts S3 credentials and listener auth secrets, -> but any client that can reach the listener can reconfigure or restart the -> daemon. Prefer a UDS with restrictive filesystem ownership/mode for local -> operators, or bind TCP to loopback / a trusted network. +> **Security.** Admin commands (everything but `get` and the link read +> commands) need the listener's admin credential when it has one; a listener +> serving `grpc-read` alone answers them `Unimplemented`. `get` redacts S3 +> credentials and listener auth secrets. See +> [listeners](../../docs/security.md#listeners). A slim single-binary container image is also published as `.#oci-xtcp2ctl` (see [build flavors](../../docs/build-flavors.md)). diff --git a/cmd/xtcp2ctl/xtcp2ctl.go b/cmd/xtcp2ctl/xtcp2ctl.go index 049d56ab5..429d5e034 100644 --- a/cmd/xtcp2ctl/xtcp2ctl.go +++ b/cmd/xtcp2ctl/xtcp2ctl.go @@ -41,6 +41,7 @@ import ( "github.com/randomizedcoder/xtcp2/pkg/linkmonitor/linkmonitorctl" "github.com/randomizedcoder/xtcp2/pkg/listener" "github.com/randomizedcoder/xtcp2/pkg/listenerauth" + "github.com/randomizedcoder/xtcp2/pkg/listeners" "github.com/randomizedcoder/xtcp2/pkg/misc" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -50,9 +51,9 @@ import ( const ( targetHostnameCst = "localhost" - // grpcPortCst MUST match the xtcp2 daemon's default (cmd/xtcp2 - // grpcPortCst, currently 8889). Out-of-step ports turn every call into a - // silent connection refused. + // grpcPortCst is the port for -network tcp: the daemon's deprecated + // -grpcPort default. The default is the Unix socket, + // listeners.DefaultGRPCSocketPath. grpcPortCst = "8889" // callTimeout bounds a single unary control RPC. reconfigure returns @@ -132,10 +133,10 @@ Commands: rebaseline, resync ('xtcp2ctl link [flags] -h') Common flags (all commands): - -network string gRPC network: tcp or unix (default "tcp") - -target string daemon hostname (default "localhost") - -port string daemon gRPC port (default "8889", must match -grpcPort) - -unixSocket path daemon gRPC Unix socket path when -network unix + -network string gRPC network: unix or tcp (default "unix") + -unixSocket path daemon gRPC Unix socket (default "/run/xtcp2/grpc.sock") + -target string daemon hostname when -network tcp (default "localhost") + -port string daemon gRPC port when -network tcp (default "8889") -d uint debug level (default 0) -auth-token, -auth-token-file, -auth-hmac-shared-key, -auth-hmac-shared-key-file credential; XTCP2_GRPC_AUTH_TOKEN[_FILE] / XTCP2_GRPC_HMAC_SHARED_KEY[_FILE] @@ -144,16 +145,19 @@ Common flags (all commands): XTCP2_GRPC_ADMIN_TOKEN[_FILE] / XTCP2_GRPC_ADMIN_HMAC_SHARED_KEY[_FILE] instead when set. +The daemon serves gRPC only on a listener configured for it, e.g. + -listener name=grpc,serves=grpc-read+grpc-admin,address=/run/xtcp2/grpc.sock,tokenFile=,adminTokenFile= + Run 'xtcp2ctl -h' for per-command flags. `) } // commonFlags registers the flags every command shares and returns accessors. func commonFlags(fs *flag.FlagSet) { - fs.String("network", listener.NetworkTCP, "daemon gRPC network: tcp or unix") - fs.String("target", targetHostnameCst, "daemon hostname") - fs.String("port", grpcPortCst, "daemon gRPC port (must match the daemon's -grpcPort)") - fs.String("unixSocket", "", "daemon gRPC Unix socket path when -network unix") + fs.String("network", listener.NetworkUnix, "daemon gRPC network: unix or tcp") + fs.String("target", targetHostnameCst, "daemon hostname when -network tcp") + fs.String("port", grpcPortCst, "daemon gRPC port when -network tcp") + fs.String("unixSocket", listeners.DefaultGRPCSocketPath, "daemon gRPC Unix socket path when -network unix") fs.String("auth-token", "", "raw bearer token; prefer XTCP2_GRPC_AUTH_TOKEN or _FILE") fs.String("auth-token-file", "", "file containing the raw bearer token") fs.String("auth-hmac-shared-key", "", "HMAC shared key; prefer XTCP2_GRPC_HMAC_SHARED_KEY or _FILE") diff --git a/cmd/xtcp2ctl/xtcp2ctl_test.go b/cmd/xtcp2ctl/xtcp2ctl_test.go index 031d5accd..bf227c80b 100644 --- a/cmd/xtcp2ctl/xtcp2ctl_test.go +++ b/cmd/xtcp2ctl/xtcp2ctl_test.go @@ -115,7 +115,7 @@ func TestGet(t *testing.T) { func TestGetUnixMissingSocket(t *testing.T) { startFakeServer(t) - rc, _, errStr := run(t, "get", "-network", "unix") + rc, _, errStr := run(t, "get", "-network", "unix", "-unixSocket", "") if rc != 2 { t.Fatalf("rc=%d stderr=%s, want rc=2", rc, errStr) } @@ -295,3 +295,35 @@ func TestNoArgs(t *testing.T) { t.Errorf("expected rc=2 for no args, got %d", rc) } } + +// TestDialTarget pins where xtcp2ctl connects: the daemon's documented gRPC +// socket unless told otherwise. +func TestDialTarget(t *testing.T) { + tests := []struct { + name, category, description string + args []string + expected string // network + " " + target + }{ + {"default", "positive", "no flags dial the gRPC socket", nil, "unix /run/xtcp2/grpc.sock"}, + {"socket_flag", "positive", "-unixSocket picks another socket", []string{"-unixSocket", "/tmp/g.sock"}, "unix /tmp/g.sock"}, + {"tcp", "boundary", "-network tcp dials target:port", []string{"-network", "tcp"}, "tcp localhost:8889"}, + {"tcp_port", "corner", "-port applies only to tcp", []string{"-network", "tcp", "-target", "10.0.0.1", "-port", "9000"}, "tcp 10.0.0.1:9000"}, + } + for _, tc := range tests { + t.Run(tc.category+"/"+tc.name, func(t *testing.T) { + startFakeServer(t) + inner := dialFunc + var got string + dialFunc = func(network, target string) (*grpc.ClientConn, error) { + got = network + " " + target + return inner(network, target) + } + if rc, _, errStr := run(t, append([]string{"get"}, tc.args...)...); rc != 0 { + t.Fatalf("%s: rc=%d stderr=%s", tc.description, rc, errStr) + } + if got != tc.expected { + t.Errorf("%s: dialed %q, want %q", tc.description, got, tc.expected) + } + }) + } +} diff --git a/docs/README.md b/docs/README.md index 456782884..cbcebe542 100644 --- a/docs/README.md +++ b/docs/README.md @@ -59,7 +59,7 @@ A poll loop dumps every namespace on a fixed interval, deserializes the replies Seven marshallers (`protobufList`, `protoJson`, `protoText`, `msgpack`, `jsonl`, `csv`, `tsv`) and pluggable destinations: stdout/stderr, files, TCP, HTTP(S), UDP, Unix stream/datagram, null, Kafka with schema-registry support, NATS, NSQ, Valkey, and S3/Parquet. Includes the protobufList batch format used for ClickHouse ingestion and the separate S3 record-to-Parquet path. ### [gRPC API](grpc-api.md) -gRPC defaults to TCP port `8889`, with optional Unix sockets and bearer/HMAC authentication. `ConfigService` reads/changes daemon configuration, `XTCPFlatRecordService` streams/polls live records, and `LinkMonitorService` administers monitoring. Clients include `xtcp2client`, `xtcp2ctl`, and vendored `grpcurl`. +gRPC is served on a listener configured for it, by convention `/run/xtcp2/grpc.sock`, with bearer/HMAC authentication ([listeners](security.md#listeners)). `ConfigService` reads/changes daemon configuration, `XTCPFlatRecordService` streams/polls live records, and `LinkMonitorService` administers monitoring. Clients include `xtcp2client`, `xtcp2ctl`, and vendored `grpcurl`. ### [Listener security](security.md) diff --git a/docs/build-flavors.md b/docs/build-flavors.md index 686c1e8ca..3ffcfd95c 100644 --- a/docs/build-flavors.md +++ b/docs/build-flavors.md @@ -184,7 +184,7 @@ docker run --rm --entrypoint /bin/register_schema xtcp2:latest -help nix build .#oci-xtcp2client ./result | docker load docker run --rm xtcp2client:latest -help -docker run --rm xtcp2client:latest -target daemon-host -port 8889 +docker run --rm -v /run/xtcp2:/run/xtcp2 xtcp2client:latest # xtcp2ctl is the runtime-control client: nix build .#oci-xtcp2ctl && ./result | docker load docker run --rm xtcp2ctl:latest -help @@ -237,7 +237,7 @@ xtcp2 -help 2>&1 | grep -A1 enrichAsn xtcp2 -conf | grep compiledInEnrichers # 3. a running daemon publishes one gauge per known enricher: 1 or 0 -curl -s localhost:9088/metrics | grep compiledInEnrichers +curl -s --unix-socket /run/xtcp2/metrics.sock -H "Authorization: Bearer $(cat /etc/xtcp2/token)" http://xtcp2/metrics | grep compiledInEnrichers xtcp_gauges{function="InitPromethus",type="asn",variable="compiledInEnrichers"} 0 xtcp_gauges{function="InitPromethus",type="locality",variable="compiledInEnrichers"} 0 ``` diff --git a/docs/design-linkmonitor-in-xtcp2.md b/docs/design-linkmonitor-in-xtcp2.md index f536c8e35..5e67f5ae3 100644 --- a/docs/design-linkmonitor-in-xtcp2.md +++ b/docs/design-linkmonitor-in-xtcp2.md @@ -34,6 +34,8 @@ Progress, findings and TODOs: [status-linkmonitor-in-xtcp2.md](status-linkmonito ## HTTP paths +> **Since the listener model** ([listeners](security.md#listeners)), these paths are served by class rather than on "the Prometheus listener": the detail paths by the listener serving `metrics-detail` (by default the socket `/run/xtcp2/metrics.sock`), `/ip` and `/i` by the one serving `ip`, and `/debug/pprof/` only by one serving `debug`. `-linkMonitorIPListen` below is deprecated; it expands to an `ip` listener. The rest of this section is the original design. + Everything is served on the existing Prometheus listener (`-promListen`, default `:9088`, or `-promListenNetwork=unix`). The paths copy go-link-monitor's, so scrape configs and dashboards move across unchanged. | Path | Content | Default | In flight | @@ -165,9 +167,9 @@ The detail paths take the Prometheus listener's policy (`-listenerAuthMode` and |---|---| | `pkg/linkmonitor/linkmonitorhttp` | go-link-monitor's route model, moved out of `cmd/go-link-monitor`: routes, in-flight limits, timeout, category registries, interface views, per-path refresh, `Paths.Validate`, the `/ip` route | | `pkg/xtcp/linkmonitor.go` | settings, `initLinkMonitor`, `runLinkMonitor` (degrade), `LinkMonitorHandler`, `RequestLinkMonitorRebaseline` | -| `cmd/xtcp2/prom_server.go` | `startPromServer`, `servePromHandler`, `newPromServer` | +| `cmd/xtcp2/listeners.go`, `cmd/xtcp2/http_server.go` | per-listener HTTP muxes (`startListeners`, `httpHandler`), `serveHTTP` (was `prom_server.go`) | | `cmd/xtcp2/linkmonitor_http.go` | `linkMonitorRoutes`: the late-bound handler and SIGUSR1 target | -| `cmd/xtcp2/ip_server.go` | the `-linkMonitorIPListen` listener: address checks, startup, rate-limited reject log | +| `cmd/xtcp2/reject_log.go` | the rate-limited log of connections a loopback listener closes (the `-linkMonitorIPListen` listener is now an `ip` listener) | | `pkg/listener/loopback.go` | `ParseLoopback`, and `LoopbackOnly`, which closes non-loopback peers | | `cmd/xtcp2/linkmonitor_flags.go` | flags, env overrides, config builder | | `cmd/go-link-monitor` | uses `linkmonitorhttp`; keeps its own listener, health, supervision and admin socket | diff --git a/docs/design-listener-security-hardening.md b/docs/design-listener-security-hardening.md index 077f38ab4..7d2eea9a2 100644 --- a/docs/design-listener-security-hardening.md +++ b/docs/design-listener-security-hardening.md @@ -69,7 +69,7 @@ It registers: ### Prometheus HTTP -`cmd/xtcp2/prom_server.go` starts Prometheus through `startPromServer(ctx, wg, promParams)`, which binds the listener before the daemon starts and serves it as a tracked worker that drains on shutdown. (Before this hardening, `servePromHandler` always called `lc.Listen(context.Background(), "tcp", promListen)` from a bare goroutine.) +`cmd/xtcp2/prom_server.go` (now `listeners.go` and `http_server.go`, one listener per `-listener`) starts Prometheus through `startPromServer(ctx, wg, promParams)`, which binds the listener before the daemon starts and serves it as a tracked worker that drains on shutdown. (Before this hardening, `servePromHandler` always called `lc.Listen(context.Background(), "tcp", promListen)` from a bare goroutine.) `-promListen` and `-promPath` are flag/env-only settings, not part of `XtcpConfig`. `PROM_LISTEN` and `PROM_PATH` override flags. diff --git a/docs/grpc-api.md b/docs/grpc-api.md index 35bf74fd7..e0bf98fbd 100644 --- a/docs/grpc-api.md +++ b/docs/grpc-api.md @@ -1,8 +1,8 @@ # gRPC API -xtcp2 exposes a gRPC server (default port `8889`) with three services: one to read and change daemon configuration at runtime, one to stream live TCP records, and one to inspect and administer the embedded link monitor. gRPC server reflection is enabled, so tools like the vendored `grpcurl` can introspect the API without the `.proto` files. +xtcp2 serves gRPC, on a listener configured for it, with three services: one to read and change daemon configuration at runtime, one to stream live TCP records, and one to inspect and administer the embedded link monitor. gRPC server reflection is enabled, so tools like the vendored `grpcurl` can introspect the API without the `.proto` files. -For protection defaults, read/admin credential setup, TTL/UDS tradeoffs, and recommended deployments, see the [listener security guide](security.md). Auth is disabled by default, and the server and built-in clients do not provide native TLS. +For protection defaults, read/admin credential setup, TTL/UDS tradeoffs, and recommended deployments, see the [listener security guide](security.md). No gRPC listener runs by default; listeners are authenticated by default, and the server and built-in clients do not provide native TLS. ## Table of contents @@ -20,7 +20,13 @@ For protection defaults, read/admin credential setup, TTL/UDS tradeoffs, and rec ## The server -`pkg/xtcp/grpc_server.go` listens on `:` by default and registers the three services plus gRPC health and reflection. It can also listen on a Unix domain socket (UDS) for local-only operation. Each service has its own implementation file: +`pkg/xtcp/grpc_server.go` serves each listener whose classes are `grpc-read` and/or `grpc-admin` ([listeners](security.md#listeners)), with gRPC health and reflection. A `grpc-admin` listener registers all three services; a `grpc-read` listener registers read-only versions whose admin RPCs answer `Unimplemented`, whatever the credential. The clients' default, and the documented place, is a Unix socket: + +```sh +xtcp2 -listener name=grpc,serves=grpc-read+grpc-admin,address=/run/xtcp2/grpc.sock,tokenFile=/run/secrets/xtcp2-read,adminTokenFile=/run/secrets/xtcp2-admin +``` + +Each service has its own implementation file: - `pkg/xtcp/grpc_configService.go` — `ConfigService`. - `pkg/xtcp/grpc_flatRecordService.go` — `XTCPFlatRecordService`. @@ -164,7 +170,7 @@ xtcp2ctl reconfigure -file cfg.new.json | `link status\|interfaces\|collectors` | `-format text\|json`; `interfaces`: `-name`, `-eligible-only` | none | | `link rebaseline\|resync` | `-reason` (required), `-wait` | hot | -`link` takes the common flags *before* its subcommand, so the subcommand's own flags stay separate: `xtcp2ctl link -port 8889 rebaseline -reason "cabling fixed" -wait 30s`. It allows 75s per call, so the 60s maximum `-wait` fits. +`link` takes the common flags *before* its subcommand, so the subcommand's own flags stay separate: `xtcp2ctl link -unixSocket /run/xtcp2/grpc.sock rebaseline -reason "cabling fixed" -wait 30s`. It allows 75s per call, so the 60s maximum `-wait` fits. ## The xtcp2client binary @@ -173,11 +179,12 @@ xtcp2ctl reconfigure -file cfg.new.json ```sh nix build .#xtcp2client -# Listen mode over TCP: stream records the daemon collects on its own schedule -./result/bin/xtcp2client -target 127.0.0.1 -port 8889 +# Listen mode: stream records the daemon collects on its own schedule, from +# /run/xtcp2/grpc.sock +XTCP2_GRPC_AUTH_TOKEN_FILE=/run/secrets/xtcp2-read ./result/bin/xtcp2client -# Listen mode over a Unix domain socket -./result/bin/xtcp2client -network unix -unixSocket /run/xtcp2/grpc.sock +# Over TCP +./result/bin/xtcp2client -network tcp -target 127.0.0.1 -port 8889 # Poll mode: drive collection from the client, as JSON ./result/bin/xtcp2client -poll -pollFrequency 2s -json @@ -185,10 +192,10 @@ nix build .#xtcp2client | Flag | Default | Purpose | |---|---|---| -| `-network` | `tcp` | gRPC transport network: `tcp` or `unix`. | -| `-target` | (daemon host) | Target hostname. | -| `-port` | `8889` | Target gRPC port; must match the daemon's `-grpcPort`. | -| `-unixSocket` | — | UDS path when `-network unix`. | +| `-network` | `unix` | gRPC transport network: `unix` or `tcp`. | +| `-unixSocket` | `/run/xtcp2/grpc.sock` | Socket path when `-network unix`. | +| `-target` | `localhost` | Target hostname when `-network tcp`. | +| `-port` | `8889` | Target gRPC port when `-network tcp`. | | `-poll` | `false` | Use `PollFlatRecords` (client-driven) instead of `FlatRecords`. | | `-pollFrequency` | — | Poll interval in poll mode. | | `-workers` | `10` | Concurrent stream workers. | @@ -197,7 +204,7 @@ nix build .#xtcp2client ## Using grpcurl -Because reflection is on, the vendored `grpcurl` (`cmd/grpcurl`) can list and call methods directly: +Because reflection is on, the vendored `grpcurl` (`cmd/grpcurl`) can list and call methods directly. The examples assume a TCP listener on `127.0.0.1:8889` and a token in `$TOKEN` (`-H "authorization: Bearer $TOKEN"`, left out below); for the socket, add `-unix` and give `/run/xtcp2/grpc.sock` as the address: ```sh grpcurl -plaintext 127.0.0.1:8889 list @@ -226,14 +233,17 @@ grpcurl -plaintext 127.0.0.1:8889 xtcp_config.v1.ConfigService/Get \ Each RPC carries an access class, declared as the `(xtcp_auth.v1.access)` method option in the proto (`proto/xtcp_auth/v1/xtcp_auth.proto`). `XTCPFlatRecordService` is also ClickHouse's format schema, so its two classes are declared in `pkg/xtcp/grpc_access.go` instead. A method with no class is treated as **admin**, and a test fails the build if any registered method lacks an explicit one. Health checking and server reflection are read. +Per listener: + | Configured credentials | Read RPCs, `/metrics`, health | Admin RPCs, `/debug/pprof/` | |---|---|---| -| none | open | open | -| shared only (`-listenerAuthMode`) | shared credential | shared credential (unchanged behaviour) | -| shared + admin (`-listenerAdminAuthMode`) | shared or admin credential | admin credential only | -| admin only | open | admin credential only | +| read only | read credential | read credential, on a listener serving only admin classes | +| read + admin | read or admin credential | admin credential only | +| none (`auth=disabled`, UDS or loopback) | open | refused at startup without an admin credential | -Once an admin credential is configured, the shared credential becomes read-only: a valid shared credential presented to an admin RPC gets `PermissionDenied` (HTTP `403`), while a missing or wrong credential gets `Unauthenticated` (HTTP `401`) after the failure jitter. The method table is built once at startup; each call does one map lookup. +Once an admin credential is configured, the read credential becomes read-only: a valid shared credential presented to an admin RPC gets `PermissionDenied` (HTTP `403`), while a missing or wrong credential gets `Unauthenticated` (HTTP `401`) after the failure jitter. The method table is built once at startup; each call does one map lookup. + +A listener's own admin credential is `adminTokenFile=` / `adminHmacKeyFile=` (and `adminAuth=`) in its spec; these are the daemon-wide ones, for listeners without: | Daemon flag | Environment fallback | Purpose | |---|---|---| @@ -247,24 +257,16 @@ Clients keep their existing `-auth-*` flags and `XTCP2_GRPC_AUTH_TOKEN[_FILE]` / ## Configuration -| Flag | Default | Purpose | -|---|---|---| -| `-grpcPort` | `8889` | Port the gRPC server listens on. | -| `-grpcListenNetwork` | `tcp` | Listener network: `tcp` or `unix` (`GRPC_LISTEN_NETWORK`). | -| `-grpcListenAddress` | — | Full listener address. For UDS, the socket path (`GRPC_LISTEN_ADDRESS`). For TCP, overrides `-grpcPort` when set. | -| `-grpcUnixSocketMode` | `0600` | UDS permission bits after bind (`GRPC_UNIX_SOCKET_MODE`: octal with a leading `0`, e.g. `0660`, or decimal; above `0777` is ignored). | -| `-grpcUnlinkStaleUnixSocket` | `true` | Remove an existing socket at startup if it is a socket (`GRPC_UNLINK_STALE_UNIX_SOCKET`). | - -Example: +gRPC listeners are `-listener` entries ([listeners](security.md#listeners)). The `-grpcPort`, `-grpcListenNetwork`, `-grpcListenAddress`, `-grpcUnixSocketMode` and `-grpcUnlinkStaleUnixSocket` flags (and `GRPC_*` variables) are deprecated: they still expand to a listener named `grpc`, serving `grpc-admin` under the one credential, or `grpc-read+grpc-admin` when an admin credential is set. ```sh -xtcp2 -grpcListenNetwork unix -grpcListenAddress /run/xtcp2/grpc.sock -grpcUnixSocketMode 432 -xtcp2ctl get -network unix -unixSocket /run/xtcp2/grpc.sock +xtcp2 -listener name=grpc,serves=grpc-read+grpc-admin,address=/run/xtcp2/grpc.sock,mode=0660,tokenFile=/run/secrets/xtcp2-read,adminTokenFile=/run/secrets/xtcp2-admin +xtcp2ctl get ``` -`432` is decimal for `0660`; use `384` for `0600`. The socket parent directory must already exist and should be owned so only trusted local users can traverse it. +xtcp2 creates a missing socket directory `0750`; own it so only trusted local users can traverse it. -The configuration protobuf also exposes `grpc_listener`, `prometheus_listener`, `listener_auth`, `admin_listener_auth`, and `link_monitor` (field 250, see [LinkMonitorService](#linkmonitorservice)). Secret fields in both auth blocks are redacted from every `ConfigService` response and preserved by `ConfigService.Set` when omitted from an update. Enforcement is described in [Access control](#access-control). +The configuration protobuf carries the listeners as `listeners` (field 162), with `listener_auth`, `admin_listener_auth` and `link_monitor` (field 250, see [LinkMonitorService](#linkmonitorservice)); `ConfigService.Set` refuses a listener set startup would refuse. Secret fields in both auth blocks are redacted from every `ConfigService` response and preserved by `ConfigService.Set` when omitted from an update. Enforcement is described in [Access control](#access-control). ## See also diff --git a/docs/integration-testing.md b/docs/integration-testing.md index 3764c5539..38a36994d 100644 --- a/docs/integration-testing.md +++ b/docs/integration-testing.md @@ -477,7 +477,7 @@ The `#` column mirrors the check labels in `self-test.nix`, which are lettered ( | 2 | `METRICS` | `curl /metrics` returns `xtcp_*` rows | all | | 3 | `NETLINK` | `xtcp_counts{variable="p"}` advances → daemon parsed ≥1 inet_diag socket end-to-end | all | | 4 | `BINARIES_HELP` | All **11** cmd binaries respond to `-help` (xtcp2, xtcp2client, **xtcp2ctl**, xtcp2_kafka_client, clickhouse_protobuflist[_db], clickhouse_http_insert_protobuflist, kafka_to_clickhouse, ns, nsTest, register_schema) | all | -| 5 | `GRPC_ROUNDTRIP` | `xtcp2client -target 127.0.0.1 -port 8889` connects and produces output | all | +| 5 | `GRPC_ROUNDTRIP` | `xtcp2client -network tcp -target 127.0.0.1 -port 8889` with the guest token connects and produces output | all | | 5b | `POLL_STREAM` | `xtcp2client -poll` (PollFlatRecords bidi stream) delivers ≥1 record **and** the `pfrSent` counter grows | all | | 5c | `HEALTH` | `/healthz` + `/readyz` return 200 **and** `xtcp2 -healthcheck` exits 0 (the container-orchestration path) | all | | 5d | `OUTPUT_CONTENT` | the daemon's serialized `jsonl` file output has ≥1 line, each valid JSON with a non-empty `.hostname` | minimal | @@ -537,6 +537,8 @@ Not every guard needs a VM. `nix flake check` runs the fast, hermetic checks (`n `microvm.forwardPorts` plumbs each port through QEMU's SLiRP hostfwd, and `networking.firewall.allowedTCPPorts` opens the matching guest ports. All bindings are gated on the flavor predicate. +Every guest's xtcp2 listens on TCP `:9088` (`health+metrics+metrics-detail`) and `:8889` (`grpc-admin`) through explicit `-listener` args (`mkTcpListenerArgs` in `nix/microvms/mkVm.nix`), both checking the fixed test token in `/etc/xtcp2/listener-token` (`xtcp2-vm-integration-test-token`; test data, not a secret). Send it to reach them from the host: `curl -H 'Authorization: Bearer xtcp2-vm-integration-test-token' http://127.0.0.1:9088/metrics`. The `uds-security` flavor instead serves the default metrics socket and `/run/xtcp2/grpc.sock`. + | Host | Guest | Service | Flavors | |---|---|---|---| | `127.0.0.1:9088` | `:9088` | xtcp2 `/metrics` | tcp-stress, clickhouse-pipeline | diff --git a/docs/metrics.md b/docs/metrics.md index 263d3ba11..fd04c3961 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -323,7 +323,7 @@ grep -rnoE '\.(pC|pH|pG|pGV)\.WithLabelValues\([^)]*\)' --include=*.go pkg/xtcp To see what a running daemon exports, including the dynamic label values: ```sh -curl -s localhost:9088/metrics | grep -E '^xtcp_' +curl -s --unix-socket /run/xtcp2/metrics.sock -H "Authorization: Bearer $(cat /etc/xtcp2/token)" http://xtcp2/metrics | grep -E '^xtcp_' ``` ## See also diff --git a/docs/observability.md b/docs/observability.md index 3eed005f0..58a4590f3 100644 --- a/docs/observability.md +++ b/docs/observability.md @@ -16,15 +16,15 @@ xtcp2 is built to run as a long-lived daemon, so it ships first-class observabil ## Prometheus metrics -`pkg/xtcp/prometheus.go` registers the daemon's metrics and serves them over HTTP. By default they are exposed at `:9088/metrics` (`-promListen`, `-promPath`). The same HTTP server can listen on a Unix domain socket by setting `-promListenNetwork unix` and using `-promListen` as the socket path. Metrics cover the collection pipeline — netlink reads, deserialization, envelope rows flushed, destination sends, and namespace counts — which is what you scrape to alarm on a stalled collector or a destination backpressure problem. The `metrics-audit` tool/check (`nix build .#test-tools-metrics-audit`) guards metric registration. +`pkg/xtcp/prometheus.go` registers the daemon's metrics, served at `-promPath` (default `/metrics`) on the listener serving the `metrics` class: by default the Unix socket `/run/xtcp2/metrics.sock`, with a bearer token ([listeners](security.md#listeners)). Metrics cover the collection pipeline — netlink reads, deserialization, envelope rows flushed, destination sends, and namespace counts — which is what you scrape to alarm on a stalled collector or a destination backpressure problem. The `metrics-audit` tool/check (`nix build .#test-tools-metrics-audit`) guards metric registration. -The listener is bound before the daemon starts, so a bad address, a port in use or an invalid listener auth config fails startup with an error. On shutdown the server drains in-flight requests for up to 3 s, then closes. +Every listener is bound before the daemon starts, so a bad address, a port in use or an invalid listener config fails startup with an error. On shutdown the server drains in-flight requests for up to 3 s, then closes. Two per-record series are off by default because at 100k sockets they cost more CPU than the decode: `xtcp_counts{function="Deserialize", variable="n"}` and `xtcp_histograms{function="Deserialize", variable="nlPacketComplete"}`. Turn them on with `-debugPrometheus` (or `DEBUG_PROMETHEUS=true`). `flatRecordServiceSend`'s `start` and `complete` series only move while a gRPC client is streaming records. For records decoded, use `xtcp_counts{variable="p"}` (per decoder) or `Deserialize` `envelopeAppend`. See [metrics on the decode path](performance.md#metrics-on-the-decode-path), and the [metrics reference](metrics.md) for every series, what it counts and which ones are on by default. ## Scraping with listener auth -With `-listenerAuthMode raw` every path on the listener, `/metrics` included, needs `Authorization: Bearer `; without it the reply is `401`. Set `-listenerAdminAuthMode raw` too, with a different token, and the first token becomes read-only: it can scrape `/metrics` and the link monitor paths, but `/debug/pprof/` answers `403`. The design is in [design-listener-security-hardening.md](design-listener-security-hardening.md). +Every path on an authenticated listener, `/metrics` included, needs `Authorization: Bearer `; without it the reply is `401`. Listeners are authenticated by default. Give a listener an admin token too, different from its read token, and the read token becomes read-only: it can scrape `/metrics` and the link monitor paths, but `/debug/pprof/` (on a listener serving `debug`) answers `403`. See [listeners](security.md#listeners). Give xtcp2 the tokens as files, so they stay out of `ps` and `docker inspect`: @@ -35,12 +35,16 @@ head -c 32 /dev/urandom | base64 | tr -d '\n=' > /etc/xtcp2/listener_admin_token ``` ```sh -LISTENER_AUTH_MODE=raw LISTENER_RAW_TOKEN_FILE=/etc/xtcp2/listener_read_token -LISTENER_ADMIN_AUTH_MODE=raw LISTENER_ADMIN_RAW_TOKEN_FILE=/etc/xtcp2/listener_admin_token ``` +A scraper that cannot use a Unix socket needs a TCP listener, for example on loopback: + +```sh +-listener name=metrics,serves=health+metrics+metrics-detail,address=127.0.0.1:9088,network=tcp +``` + The scraper only needs the read token. vmagent and Prometheus take it with `credentials_file`: ```yaml @@ -56,12 +60,12 @@ scrape_configs: vmagent re-reads `credentials_file` on each scrape (cached for at most 1 s), so rotating a token is: write the new file for both, then restart xtcp2, which reads its token file at startup. The scrape fails between the two steps, so do them together. `xtcp2 -healthcheck` reads the same settings and sends the token, over TCP or a Unix socket. -The default TCP listener sends replies with TTL / hop limit 3 (`-ipv4Ttl`, `-ipv6HopLimit`), so a scraper more than three hops away gets no answer. Raise them only for a scraper that really is further away. +A TCP listener sends replies with TTL / hop limit 3 (`-ipv4Ttl`, `-ipv6HopLimit`), so a scraper more than three hops away gets no answer. Raise them only for a scraper that really is further away. ## Health & readiness -For container / Kubernetes deployment the metrics HTTP server also serves two -probe endpoints (same listener as `-promListen`): +For container / Kubernetes deployment the listener serving the `health` class +(the default socket, by default) serves two probe endpoints: - **`/healthz`** — liveness. Returns `200` as soon as the HTTP server is up. Use it for a Docker `HEALTHCHECK` or a k8s `livenessProbe`. @@ -70,7 +74,7 @@ probe endpoints (same listener as `-promListen`): during shutdown. Use it for a k8s `readinessProbe` / `startupProbe` so traffic and rollouts wait until xtcp2 is actually collecting. -The gRPC port additionally serves the standard `grpc.health.v1` service, which +A gRPC listener additionally serves the standard `grpc.health.v1` service, which reports `SERVING` on the same readiness condition (for native k8s gRPC probes). Readiness doesn't depend on the link monitor: a monitor still settling, or one @@ -79,16 +83,17 @@ that has failed, leaves `/readyz` alone. ## Link monitor xtcp2 runs the link monitor by default ([design](design-linkmonitor-in-xtcp2.md)). -It serves go-link-monitor's paths on the same listener: `/metrics/[/]` -and `/metrics-all[/]`, plus `/ip` and `/i` with `-linkMonitorIPPaths` -(off by default, since they expose host addresses). Each detail path has an -in-flight limit and a 10 s timeout. `/metrics` carries only the problem summary. - -`-linkMonitorIPListen 127.0.0.1:9089` serves `/ip` and `/i` on a loopback -listener of their own instead, without listener auth, so a shell on the host -can `curl http://127.0.0.1:9089/i/a/s` without a token. It closes connections -from any non-loopback peer, such as a container on a Docker bridge with -`route_localnet` set ([design](design-linkmonitor-in-xtcp2.md#http-paths)). +It serves go-link-monitor's paths: `/metrics/[/]` and +`/metrics-all[/]` on the listener serving `metrics-detail`, and `/ip` and +`/i` on one serving `ip`, with `-linkMonitorIPPaths` (off by default, since they +expose host addresses). Each detail path has an in-flight limit and a 10 s +timeout. `/metrics` carries only the problem summary. + +`-listener name=ip,serves=ip,address=127.0.0.1:9089,network=tcp,auth=disabled` +serves `/ip` and `/i` on a loopback listener of their own, without a token, so +a shell on the host can `curl http://127.0.0.1:9089/i/a/s`. It closes +connections from any non-loopback peer, such as a container on a Docker bridge +with `route_localnet` set ([security](security.md#optional-loopback-inspection-listener)). - **SIGUSR1** (`systemctl reload xtcp2` under the NixOS module) relearns the expected up-link count, as for go-link-monitor. @@ -98,7 +103,7 @@ from any non-loopback peer, such as a container on a Docker bridge with ## pprof -The standard Go `net/http/pprof` endpoints are mounted on the metrics HTTP server, so `/debug/pprof/*` is available on the same Prometheus listener for live CPU, heap, goroutine, mutex, and block profiles. For one-shot file-based profiling, `-profile.mode` enables a profiling session of mode `cpu`, `mem`, `mutex`, or `block`. +The standard Go `net/http/pprof` endpoints are served only on a listener serving the `debug` class, which needs an admin credential, for example `-listener name=debug,serves=debug,address=/run/xtcp2/debug.sock,tokenFile=/run/secrets/xtcp2-admin`. They give live CPU, heap, goroutine, mutex, and block profiles; `/debug/pprof/cmdline` is never served. For one-shot file-based profiling, `-profile.mode` enables a profiling session of mode `cpu`, `mem`, `mutex`, or `block`. ## Pyroscope continuous profiling @@ -122,10 +127,7 @@ In practice this means running xtcp2 as root or under `sudo`. The capability beh | Flag | Default | Purpose | |---|---|---| -| `-promListen` | `:9088` | Prometheus / pprof HTTP listen address. | -| `-promListenNetwork` | `tcp` | Listener network: `tcp` or `unix` (`PROM_LISTEN_NETWORK`). | -| `-promUnixSocketMode` | `0600` | UDS permission bits after bind (`PROM_UNIX_SOCKET_MODE`: octal with a leading `0`, e.g. `0660`, or decimal; above `0777` is ignored). | -| `-promUnlinkStaleUnixSocket` | `true` | Remove an existing socket at startup if it is a socket (`PROM_UNLINK_STALE_UNIX_SOCKET`). | +| `-listener` | the default socket | A listener, repeatable (`LISTENERS`); see [listeners](security.md#listeners). Replaces the deprecated `-promListen*` flags. | | `-promPath` | `/metrics` | Prometheus metrics path. | | `-debugPrometheus` | `false` | Also record the per-record series (`DEBUG_PROMETHEUS`). | | `-profile.mode` | `` | One-shot profiling mode: `cpu`, `mem`, `mutex`, `block`. | @@ -134,21 +136,14 @@ In practice this means running xtcp2 as root or under `sudo`. The capability beh | `-pyroscopeSampleHz` | — | CPU sampling rate in Hz. | | `-pyroscopeUploadSec` | — | Seconds between profile uploads. | -Example local-only metrics listener: - -```sh -xtcp2 -promListenNetwork unix -promListen /run/xtcp2/prometheus.sock -promUnixSocketMode 432 -curl --unix-socket /run/xtcp2/prometheus.sock http://xtcp2/metrics -``` - -When listener authentication is enabled, add the bearer header: +Scraping the default socket: ```sh -curl --unix-socket /run/xtcp2/prometheus.sock \ - -H 'Authorization: Bearer ' http://xtcp2/metrics +curl --unix-socket /run/xtcp2/metrics.sock \ + -H "Authorization: Bearer $(cat /etc/xtcp2/listener_read_token)" http://xtcp2/metrics ``` -`432` is decimal for `0660`; use `384` for `0600`. The built-in `-healthcheck` mode also understands `PROM_LISTEN_NETWORK=unix` and probes `/readyz` through the socket. +The built-in `-healthcheck` mode reads the same listener settings and probes `/readyz` on the listener serving `health`, over its socket or TCP. ## See also diff --git a/docs/operations.md b/docs/operations.md index b5849c93b..70de03c23 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -66,7 +66,7 @@ xtcp2 runs the link monitor by default ([design](design-linkmonitor-in-xtcp2.md) | Task | Command | |---|---| | Relearn the count after a planned link change | `systemctl reload xtcp2` (SIGUSR1), or `xtcp2ctl link rebaseline -reason "…"` | -| Check the monitor | `curl -s localhost:9088/metrics \| grep -E '^go_link_monitor_\|linkMonitor'` | +| Check the monitor | `curl -s --unix-socket /run/xtcp2/metrics.sock -H "Authorization: Bearer $(cat )" http://xtcp2/metrics \| grep -E '^go_link_monitor_\|linkMonitor'` | | Read the recorded count | `jq . /var/lib/xtcp2/link-monitor-baseline.json` | | Turn the monitor off | `-linkMonitor=false`, `LINK_MONITOR=false` or `services.xtcp2.linkMonitor.enable = false` | diff --git a/docs/security.md b/docs/security.md index c12700c52..79cb7e70d 100644 --- a/docs/security.md +++ b/docs/security.md @@ -1,21 +1,21 @@ # Listener security and deployment guidance -xtcp2 protects its Prometheus/HTTP and gRPC interfaces with configurable bind -addresses, outgoing IPv4 TTL/IPv6 hop limits, Unix domain sockets (UDS), bearer -or HMAC authentication, and separate read/admin credentials. This guide -describes the current implementation, its defaults, tradeoffs, and recommended -deployment settings. The older [hardening design](design-listener-security-hardening.md) +xtcp2 serves its HTTP and gRPC endpoints from **listeners**: each one a Unix +domain socket (UDS) or TCP address, its credentials, and the endpoint classes +it serves. This guide describes the listener model, its defaults, tradeoffs, +and recommended deployment settings. The older [hardening design](design-listener-security-hardening.md) contains proposals as well as implemented features; it is not a configuration reference. -**Recommended starting point:** use UDS for local administration, loopback HTTP -for a local metrics agent, and distinct read/admin secrets loaded from files. -For remote access, add authenticated encryption through a trusted TLS proxy or -encrypted tunnel and restrict access to the backend listeners. Keep the TTL/hop -limit at 3 where the topology permits it. Authentication is **off by default**; -the default TCP listeners are not restricted to loopback. +**By default xtcp2 opens no TCP port.** It serves health, metrics and the link +monitor's detail paths on `/run/xtcp2/metrics.sock` (mode `0600`) with a raw +bearer token, and refuses to start without one. gRPC, pprof and `/ip` are +served only by a listener configured for them. For remote access, add +authenticated encryption through a trusted TLS proxy or encrypted tunnel in +front of a socket or loopback listener. ## Contents +- [Listeners](#listeners) - [Interfaces and defaults](#interfaces-and-defaults) - [Choosing a deployment](#choosing-a-deployment) - [Network reach and TTL](#network-reach-and-ttl) @@ -30,6 +30,75 @@ the default TCP listeners are not restricted to loopback. - [Verification and troubleshooting](#verification-and-troubleshooting) - [Implementation and test references](#implementation-and-test-references) +## Listeners + +A listener is given with `-listener` (repeatable) or `LISTENERS` (specs +separated by `;`, overriding the flag), as `key=value` pairs: + +```sh +xtcp2 \ + -listener name=metrics,serves=health+metrics+metrics-detail,address=/run/xtcp2/metrics.sock \ + -listener name=grpc,serves=grpc-read+grpc-admin,address=/run/xtcp2/grpc.sock,tokenFile=/run/secrets/xtcp2-read,adminTokenFile=/run/secrets/xtcp2-admin +``` + +| Key | Meaning | +|---|---| +| `name` | Required; unique. Names the listener in logs, errors and `xtcp2_listener_active` | +| `serves` | Required; classes joined by `+` (below) | +| `address` | Required; an absolute path (a UDS) or `host:port` | +| `network` | `unix` or `tcp`. A path is a UDS; **TCP must be typed** (`network=tcp`), so a listener never lands on an interface by accident | +| `mode` | UDS file mode, default `0600` | +| `unlinkStale` | Remove an existing socket at bind (default `true`); `false` refuses any existing path | +| `auth`, `tokenFile`, `hmacKeyFile` | The listener's credential. Without them it uses the daemon-wide one (`LISTENER_*`). An unset mode follows the file given (`tokenFile` raw, `hmacKeyFile` HMAC), and is otherwise **raw**: `auth=disabled` has to be typed | +| `adminAuth`, `adminTokenFile`, `adminHmacKeyFile` | The listener's admin credential; without them, the daemon-wide `LISTENER_ADMIN_*` | + +Credentials are files only: a listener carrying a token inline is refused, so +the configuration, `ConfigService.Get` and a soft restart's carried config hold +paths, never secrets. + +| Class | Serves | Access | +|---|---|---| +| `health` | `/healthz`, `/readyz` | read | +| `metrics` | `-promPath` (default `/metrics`): the core metrics and the link monitor's problem summary | read | +| `metrics-detail` | the link monitor's `/metrics/[/]` and `/metrics-all` | read | +| `ip` | `/ip`, `/i`: read-only `ip … show` (needs `-linkMonitorIPPaths`) | read | +| `debug` | `/debug/pprof/` (never `/debug/pprof/cmdline`, the process's argv) | admin | +| `grpc-read` | gRPC health, reflection, `ConfigService.Get`, `FlatRecords`, link monitor reads | read | +| `grpc-admin` | every gRPC method, including the setters, `PollFlatRecords`, `Rebaseline`, `Resync` | admin | + +A path or method of a class a listener does not serve is HTTP 404 / gRPC +`Unimplemented` there, whatever the credential. Startup (and +`ConfigService.Set`) refuses, with exit 64: + +- a class served by two listeners, a duplicate name, or a listener serving nothing; +- HTTP and gRPC classes on one listener; +- `auth=disabled` except on a UDS, a loopback address (allowed with a startup + warning), or a listener serving `health` alone; +- `debug` or `grpc-admin` without an admin credential, unless the listener + serves only admin classes and has a credential (its own or the daemon-wide one); +- `ip` without `-linkMonitorIPPaths`; a credential inline; a token file that is + missing, not a regular file, or readable by group or others; +- `-listener`/`LISTENERS` together with the deprecated per-listener flags. + +With no listener configured the daemon serves one: `name=metrics`, +`serves=health+metrics+metrics-detail`, `address=/run/xtcp2/metrics.sock`, +`mode=0600`, raw auth from `LISTENER_RAW_TOKEN_FILE`. Without a token it exits +64 with a hint; `LISTENER_AUTH_MODE=disabled` is allowed there, since a UDS. +xtcp2 creates the socket's directory (`0750`) when it is missing. The NixOS +module (`services.xtcp2.listeners`, `listenerTokenFile`) generates a random +token once under `/var/lib/xtcp2` when none is given. + +Each listener is logged at startup and reported by +`xtcp2_listener_active{name,network,class} 1`. `xtcp2ctl` and `xtcp2client` +dial `/run/xtcp2/grpc.sock` unless given `-network tcp`. + +**Deprecated flags.** `-promListen`, `-promListenNetwork`, +`-promUnixSocketMode`, `-promUnlinkStaleUnixSocket`, the five `-grpc*` listener +flags (`-grpcPort` included), `-linkMonitorIPListen` and their environment +variables still work: they expand to listeners with a `DEPRECATED` log line +giving the `-listener` equivalent. The Prometheus listener they describe no +longer serves pprof, and TCP still needs a credential. Move to `-listener`. + ## Interfaces and defaults These are the **xtcp2 executable's defaults**. Environment, full configuration, @@ -38,25 +107,20 @@ the deployed host. | Surface or setting | Default | Implication | |---|---|---| -| Prometheus HTTP | TCP `:9088`, summary at `/metrics` | Wildcard bind, not loopback-only; address-family reachability depends on the host | -| gRPC | TCP `:8889` | Configuration, socket streams, monitor administration, health, and reflection share a listener | -| IPv4 TTL / IPv6 unicast hop limit | `3` / `3` | Restricts replies on the Prometheus and gRPC TCP listeners; the optional separate inspection listener uses `1` / `1` | -| Shared/read auth | Disabled | Supplying a secret alone does not enable authentication | -| Separate admin auth | Disabled | Without a separate admin credential, the shared credential also grants admin access | +| Listeners | `/run/xtcp2/metrics.sock`: health, metrics, metrics-detail | No TCP port; gRPC, pprof and `/ip` off | +| Listener auth | Raw bearer token, required | No token, no start; `disabled` only where the rules above allow | +| Separate admin auth | Off | `debug` and `grpc-admin` need one, or a listener of their own | +| IPv4 TTL / IPv6 unicast hop limit | `3` / `3` | Restricts replies on TCP listeners; a loopback listener uses `1` / `1` | | HMAC clock skew | ±1 minute | Previous, current, and next UTC-minute tokens are accepted; configurable from 0 to 5 | | Failed-auth delay | Random 20–200 ms | Applied on auth/authorization failures; context cancellation can end the delay early | -| UDS mode, when selected | `0600` | Socket owner only; parent directory must already exist | +| UDS mode | `0600` | Socket owner only | | Remove existing UDS at bind | Enabled | An existing socket path is removed; there is no probe to prove the other listener is dead | | TLS/mTLS | Not implemented in these listeners | HTTP and gRPC TCP payloads are plaintext | -| Embedded goip HTTP paths | Disabled | `-linkMonitorIPPaths` enables read-only network inspection | -| Separate goip HTTP listener | Disabled (empty `-linkMonitorIPListen`) | When enabled, serves only `/ip`/`/i` without bearer auth, with loopback bind and peer checks | -HTTP authentication wraps the entire Prometheus mux: `/metrics`, monitor category and -interface paths, `/metrics-all`, `/healthz`, `/readyz`, optional `/ip`/`/i` -inspection, and `/debug/pprof/`. Health endpoints have no unauthenticated -exception. gRPC policy covers unary and streaming RPCs, including health and -reflection. The optional separate loopback inspection listener is an explicit -exception to HTTP authentication, described below. +Authentication wraps each HTTP listener's whole mux, so `/healthz` and +`/readyz` need the credential too, and covers unary and streaming gRPC, +including health and reflection. A listener with `auth=disabled` is the +exception, allowed only on a UDS, a loopback address or for health alone. Read access can disclose socket addresses, workload/topology metadata, host configuration, routes, and interface statistics. Admin access can change daemon @@ -67,8 +131,8 @@ data. Treat both as privileged interfaces, with admin credentials more restricte | Deployment | Recommended configuration | Benefits and tradeoffs | |---|---|---| -| Local metrics agent and local operators | HTTP on `127.0.0.1:9088`; gRPC on a protected UDS; distinct raw read/admin credentials | Simple scraper integration; no remote backend listeners. Loopback still permits connections from other processes in that network namespace | -| Local access with filesystem isolation for both APIs | Separate HTTP/gRPC UDS paths, restrictive directories/modes, and read/admin auth | No TCP exposure; requires clients or a local proxy that can connect to UDS and careful socket-group management | +| Local metrics agent and local operators | The default metrics socket, or HTTP on `127.0.0.1:9088`; gRPC on `/run/xtcp2/grpc.sock`; distinct raw read/admin credentials | Simple scraper integration; no remote backend listeners. Loopback still permits connections from other processes in that network namespace | +| Local access with filesystem isolation for both APIs | The default metrics socket plus a gRPC socket, restrictive directories/modes, and read/admin auth | No TCP exposure; requires clients or a local proxy that can connect to UDS and careful socket-group management | | Central scrapers or remote operators | TLS/mTLS proxy or encrypted tunnel; backend on loopback/UDS; source restrictions and distinct credentials | Protects credentials and telemetry in transit; adds certificate/tunnel operations and proxy configuration | | Direct TCP on an isolated management network | Bind the specific management address, allowlist clients, enable read/admin auth, retain a suitable TTL | Fewer components, but no native encryption or server authentication; acceptable only if the surrounding transport/network supplies the required protection | @@ -96,58 +160,44 @@ who may send requests. Keep both defaults when scrapers are nearby. If a legitimate remote client times out, check routing and the reply path, then choose the smallest TTL/hop limit that supports the intended topology. Changing only IPv4 leaves IPv6 independent. -For precise exposure control, bind explicitly with `-promListen` and -`-grpcListenAddress`, and apply host/network firewall rules. +For precise exposure control, give each TCP listener a specific `address`, and +apply host/network firewall rules. ## Optional loopback inspection listener -With the embedded monitor and `-linkMonitorIPPaths` enabled, -`-linkMonitorIPListen 127.0.0.1:9089` (or `LINK_MONITOR_IP_LISTEN`) moves `/ip` -and `/i` off the Prometheus listener onto a dedicated TCP listener. It serves -only inspection routes, **without bearer/HMAC authentication**, even when -read/admin auth is enabled for the main interfaces. Requests to the old paths -on the Prometheus listener no longer reach inspection handlers. - -Startup requires a loopback IP literal and port 1–65535; hostnames including -`localhost`, wildcard addresses, and the option without `-linkMonitorIPPaths` -are rejected. Accepted connections are also checked: non-loopback peers are -closed, including neighbours that can reach a loopback bind through -`route_localnet`. Both outgoing TTL and hop limit are fixed at 1. Rejection logs -are rate-limited to at most once per minute and include a count; the logging -limit is not a connection-rate limit. +With the embedded monitor and `-linkMonitorIPPaths` enabled, a listener of its +own can serve `/ip` and `/i` **without bearer/HMAC authentication**: + +```sh +-listener name=ip,serves=ip,address=127.0.0.1:9089,network=tcp,auth=disabled +``` + +A TCP listener on a loopback IP literal (not `localhost`) is a loopback +listener: it closes connections from non-loopback peers, including neighbours +that reach a loopback bind through `route_localnet`, and replies with TTL and +hop limit 1. Rejection logs are rate-limited to at most once per minute and +include a count; the logging limit is not a connection-rate limit. Auth +disabled there logs a startup warning. This makes local inspection convenient without distributing tokens, but any process able to connect from loopback can inspect host networking. It does not provide per-user authorization, and a local proxy or compromised process could -relay that access. Leave `linkMonitorIPListen` unset when inspection should -require the main listener's credentials; leave `linkMonitorIPPaths` disabled -when inspection is unnecessary. Do not publish this listener through an -unauthenticated proxy or tunnel. See the [implementation](../cmd/xtcp2/ip_server.go) -and [loopback peer checks](../pkg/listener/loopback.go). +relay that access. Serve `ip` on an authenticated listener when inspection +should need a credential; leave `-linkMonitorIPPaths` off when it is +unnecessary. Do not publish this listener through an unauthenticated proxy or +tunnel. See the [loopback peer checks](../pkg/listener/loopback.go). ## Unix domain sockets -Each xtcp2 listener can independently use `tcp` or `unix`: - -| Interface | Network | Address | Socket permissions | Existing-socket policy | -|---|---|---|---|---| -| HTTP | `-promListenNetwork` / `PROM_LISTEN_NETWORK` | `-promListen` / `PROM_LISTEN` | `-promUnixSocketMode` / `PROM_UNIX_SOCKET_MODE` | `-promUnlinkStaleUnixSocket` / `PROM_UNLINK_STALE_UNIX_SOCKET` | -| gRPC | `-grpcListenNetwork` / `GRPC_LISTEN_NETWORK` | `-grpcListenAddress` / `GRPC_LISTEN_ADDRESS` | `-grpcUnixSocketMode` / `GRPC_UNIX_SOCKET_MODE` | `-grpcUnlinkStaleUnixSocket` / `GRPC_UNLINK_STALE_UNIX_SOCKET` | - -For TCP, an explicit `grpcListenAddress` overrides the `grpcPort` address. -For UDS, supply a filesystem path and provision its parent directory before -starting the daemon. Use separate paths for HTTP and gRPC. - -Use `0600` for owner-only access, or `0660` with a deliberately assigned group -for a local agent. For xtcp2, decimal `384` means `0600` and `432` means `0660`; -flags and environment variables also accept octal `0600`/`0660` (or `0o600`/ -`0o660`). Use decimal numbers in protobuf JSON. Invalid environment modes or -values above `0777` are logged and ignored, retaining the previous setting. -The daemon sets the -socket mode after bind but does not create its parent or configure socket -ownership/group. A protected parent directory also prevents other users from -replacing the path during creation or cleanup. Plan container bind mounts and -UID/GID mapping explicitly. +A listener whose `address` is an absolute path is a UDS; each listener needs its +own path. Use `mode=0600` (the default) for owner-only access, or `mode=0660` +with a deliberately assigned group for a local agent; in protobuf JSON the mode +is decimal (`384` = `0600`). The daemon creates a missing parent directory +`0750` and sets the socket mode after bind, but does not set socket ownership +or group. A protected parent directory also prevents other users from replacing +the path during creation or cleanup. In a container, mount `/run/xtcp2` (it is +also how a host scraper reaches the socket) and plan UID/GID mapping +explicitly. Existing regular files and symlinks are refused. The default unlink behavior removes an existing socket without checking whether it is active; setting the @@ -198,18 +248,19 @@ tunnel for remote traffic; see the [gRPC transport-authentication reference](htt ## Read and admin authorization -The shared `listener_auth` credential becomes read-only **only when an enabled -`admin_listener_auth` credential is also configured**. +On each listener, its credential becomes read-only **only when an admin +credential is also configured** (the listener's `adminAuth`/`adminTokenFile`, +or the daemon-wide `LISTENER_ADMIN_*`). | Enabled credentials | Read access | Admin access | |---|---|---| -| Neither | Open | Open | -| Shared/read only | Shared credential | Shared credential | -| Shared/read and admin | Either credential | Admin credential | -| Admin only | Open | Admin credential | +| Read only | Read credential | Read credential | +| Read and admin | Either credential | Admin credential | +| Neither (`auth=disabled`; UDS or loopback only) | Open | Open, but `debug`/`grpc-admin` are refused without an admin credential | -Configure both for production, with different tokens/keys. Using the same secret -for both defeats the separation. A valid read credential on an admin operation +Configure both where a listener serves read and admin classes, with different +tokens/keys; the rules above refuse `debug` or `grpc-admin` beside read +classes without one. Using the same secret for both defeats the separation. A valid read credential on an admin operation returns HTTP 403 / gRPC `PermissionDenied`; missing or invalid credentials return HTTP 401 (with `WWW-Authenticate: Bearer`) / gRPC `Unauthenticated`. @@ -219,9 +270,9 @@ HTTP 401 (with `WWW-Authenticate: Bearer`) / gRPC `Unauthenticated`. | Admin | `/debug/pprof/`, `ConfigService.Set`, poll-frequency/poll/burst/S3-flush/envelope controls, `PollFlatRecords`, monitor `Rebaseline` and `Resync` | Unknown/unclassified gRPC methods require admin access when the split is enabled. -New HTTP paths default to read unless explicitly classified otherwise. The two -credentials are shared across HTTP and gRPC, not separate per-interface accounts. -There is no per-user RBAC, per-namespace policy, or individual-token revocation. +New HTTP paths default to read unless explicitly classified otherwise. Listeners +can carry different credentials, but there is no per-user RBAC, per-namespace +policy, or individual-token revocation. Monitor `Rebaseline` and `Resync` requests that pass service availability and request validation produce structured audit logs with the RPC, supplied reason, @@ -233,6 +284,10 @@ to your operational policy without logging bearer values. ## Secret handling and rotation +Per-listener credentials are `tokenFile=`, `hmacKeyFile=`, `adminTokenFile=` and +`adminHmacKeyFile=` in the listener spec. The daemon-wide credentials, used by +listeners without their own: + | Purpose | Mode flag / environment | Preferred secret-file environment | |---|---|---| | Shared/read raw token | `-listenerAuthMode raw` / `LISTENER_AUTH_MODE=raw` | `LISTENER_RAW_TOKEN_FILE` | @@ -257,6 +312,8 @@ rather than leaving the credential empty. Mount secrets mode `0400` (Kubernetes: followed, so Kubernetes secret volumes work. Do not put literal secrets into Nix expressions or derivations that enter the store. +An empty `-listenerAuthMode` or `LISTENER_AUTH_MODE=` is unset, not disabled. + `-listenerSignedSkewMinutes` / `LISTENER_SIGNED_SKEW_MINUTES` and `-listenerAuthFailureJitterMin` / `LISTENER_AUTH_FAILURE_JITTER_MIN` plus `-listenerAuthFailureJitterMax` / `LISTENER_AUTH_FAILURE_JITTER_MAX` configure @@ -295,19 +352,19 @@ the example; choose your production destination separately. ```sh sudo env \ - LISTENER_AUTH_MODE=raw \ LISTENER_RAW_TOKEN_FILE=/run/secrets/xtcp2-read \ - LISTENER_ADMIN_AUTH_MODE=raw \ LISTENER_ADMIN_RAW_TOKEN_FILE=/run/secrets/xtcp2-admin \ ./result/bin/xtcp2 -dest null \ - -promListen 127.0.0.1:9088 \ - -grpcListenNetwork unix -grpcListenAddress /run/xtcp2/grpc.sock \ - -grpcUnixSocketMode 384 -ipv4Ttl 3 -ipv6HopLimit 3 + -listener name=metrics,serves=health+metrics+metrics-detail,address=127.0.0.1:9088,network=tcp \ + -listener name=grpc,serves=grpc-read+grpc-admin,address=/run/xtcp2/grpc.sock ``` -For UDS on both interfaces, replace `-promListen 127.0.0.1:9088` with -`-promListenNetwork unix -promListen /run/xtcp2/prometheus.sock -promUnixSocketMode 384`. -A scraper must support that socket directly or reach it through a local proxy. +The daemon-wide `LISTENER_*` files supply both listeners' credentials; an unset +mode with a token file is raw. For a socket instead of loopback HTTP, drop the +first `-listener` (the default socket) or give it +`address=/run/xtcp2/metrics.sock`. A scraper must support that socket directly +or reach it through a local proxy. Add `debug` to a listener only for a +profiling session, with an admin credential. ### Prometheus scraper @@ -353,14 +410,15 @@ Raw-token and HMAC-key inputs for the same client role are mutually exclusive. ```sh sudo env XTCP2_GRPC_AUTH_TOKEN_FILE=/run/secrets/xtcp2-read \ - xtcp2ctl get -network unix -unixSocket /run/xtcp2/grpc.sock + xtcp2ctl get sudo env XTCP2_GRPC_ADMIN_TOKEN_FILE=/run/secrets/xtcp2-admin \ - xtcp2ctl link -network unix -unixSocket /run/xtcp2/grpc.sock status + xtcp2ctl link status ``` -The second example safely verifies that an admin credential also grants read -access; it does not mutate the baseline. See the [control CLI](../cmd/xtcp2ctl/readme.md) +Both dial `/run/xtcp2/grpc.sock`, the clients' default. The second example +safely verifies that an admin credential also grants read access; it does not +mutate the baseline. See the [control CLI](../cmd/xtcp2ctl/readme.md) for intentional admin actions. `xtcp2client` uses read access for normal streams, but `-poll` requires admin access because it initiates collection. @@ -392,13 +450,11 @@ external connection/rate controls if needed. Native TLS/mTLS, Basic/OAuth/JWT validation, per-user identities, and automatic secret/key rotation are also not implemented here. -Configuration validation has important limits: a recognized raw/HMAC mode with -no usable secret is rejected, but an unrecognized CLI auth-mode string currently -becomes unspecified/disabled, and an invalid environment mode is ignored. -An unreadable `_FILE` value can leave a previously supplied credential in place. -Do not assume every typo or file error fails startup. Explicitly set the intended -mode, avoid fallback secret sources, and prove unauthenticated access is denied -before exposing a deployment. `-conf` output alone is not that proof. +Configuration validation has limits: a raw/HMAC mode with no usable secret and +an unusable `_FILE` path stop startup, but an unrecognized auth-mode string +becomes unspecified (raw, for a listener's read credential), and an invalid +environment mode is ignored. Prove unauthenticated access is denied before +exposing a deployment. `-conf` output alone is not that proof. ## Standalone go-link-monitor @@ -415,9 +471,9 @@ TTL/hop-limit implementation, with different options: Metrics auth also applies to detail, health, and enabled `/ip` paths. Non-loopback TCP administration requires admin auth unless `-admin.insecure` is explicitly -set. **xtcp2 has no equivalent non-loopback startup guard**, so configure its -listener exposure and authentication explicitly. Do not assume standalone flags -or defaults apply to the embedded monitor; see [standalone usage](../cmd/go-link-monitor/README.md) +set. go-link-monitor does not use xtcp2's listener model yet: its defaults +still listen on TCP. Do not assume standalone flags or defaults apply to the +embedded monitor; see [standalone usage](../cmd/go-link-monitor/README.md) and the [read/admin design](design-admin-access.md). The standalone Unix admin listener additionally records Linux `SO_PEERCRED` @@ -447,13 +503,15 @@ authenticated requests; avoid expanding secret bytes into command arguments. An unauthenticated HTTP probe is safe to inspect directly: ```sh -curl -sS -o /dev/null -w '%{http_code}\n' http://127.0.0.1:9088/metrics +curl -sS -o /dev/null -w '%{http_code}\n' --unix-socket /run/xtcp2/metrics.sock http://xtcp2/metrics +ss -ltnp | grep xtcp2 # no output with the default listener ``` -Expect 401 for the authenticated loopback example. HTTP/gRPC health probes need -the read credential too; xtcp2's `-healthcheck` helper supports TCP/UDS and shared -auth when given the same relevant listener/auth settings. A probe system that -cannot attach credentials needs an appropriate local adapter or exec probe. +Expect 401 without the token. HTTP/gRPC health probes need the read credential +too; `xtcp2 -healthcheck` finds the listener serving `health` from the same +`-listener`/`LISTENERS` and `LISTENER_*` settings as the daemon and sends its +credential. A probe system that cannot attach credentials can be given a +listener serving `health` alone, which may run without auth. A timeout can mean firewall/bind/TTL trouble rather than bad auth. A 401 points to credential/mode/header or HMAC clock mismatch; 403 means the credential lacks @@ -466,7 +524,7 @@ profile as an authentication issue. - [Socket TTL/hop-limit options](../pkg/ipsockopt/ipsockopt.go), [listener creation and UDS](../pkg/listener/listener.go). - [Token validation and client helpers](../pkg/listenerauth/listenerauth.go), [read/admin policy](../pkg/listenerauth/policy.go). -- [HTTP handler and timeouts](../cmd/xtcp2/prom_server.go), [gRPC server](../pkg/xtcp/grpc_server.go), [RPC access classes](../pkg/xtcp/grpc_access.go). +- [Listener model and rules](../pkg/listeners/listeners.go), [listener spec syntax](../pkg/listeners/spec.go), [HTTP listeners](../cmd/xtcp2/listeners.go), [gRPC server](../pkg/xtcp/grpc_server.go), [RPC access classes](../pkg/xtcp/grpc_access.go). - [gRPC API](grpc-api.md), [observability](observability.md), [read/admin design](design-admin-access.md). - [Nix test guide](../nix/README.md): `test-listener-security` runs focused auth/listener tests; `test-microvm-lifecycle-x86_64-uds-security` is a runnable integration package (building it alone does not boot the guest). - `checks.x86_64-linux.vm-xtcp2-scrape-auth` verifies authenticated scraping, health checks, and rotation; `checks.x86_64-linux.vm-xtcp2-ip-listen` verifies the separate inspection listener and non-loopback peer rejection. Fresh runners are `test-xtcp2-scrape-auth-vm` and `test-xtcp2-ip-listen-vm`. diff --git a/gen/cpp/xtcp_config/v1/xtcp_config.pb.cc b/gen/cpp/xtcp_config/v1/xtcp_config.pb.cc index 8082851e1..78c354c4d 100644 --- a/gen/cpp/xtcp_config/v1/xtcp_config.pb.cc +++ b/gen/cpp/xtcp_config/v1/xtcp_config.pb.cc @@ -61,6 +61,8 @@ PROTOBUF_CONSTINIT ::google::protobuf::internal::ReflectionData {&::_pbi::kDescriptorMethods, &::descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto, /* tracker*/ nullptr,}, // ::xtcp_config::v1::ListenerAuth {&::_pbi::kDescriptorMethods, &::descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto, /* tracker*/ nullptr,}, + // ::xtcp_config::v1::Listener + {&::_pbi::kDescriptorMethods, &::descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto, /* tracker*/ nullptr,}, // ::xtcp_config::v1::LinkMonitorConfig {&::_pbi::kDescriptorMethods, &::descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto, /* tracker*/ nullptr,}, // ::xtcp_config::v1::XtcpConfig @@ -867,7 +869,7 @@ constexpr auto EnabledDeserializers_EnabledEntry_DoNotUse::InternalGenerateClass false, }, #ifdef PROTOBUF_MESSAGE_GLOBALS - &file_reflection_data[18], + &file_reflection_data[19], #else // !PROTOBUF_MESSAGE_GLOBALS &::_pbi::kDescriptorMethods, &descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto, @@ -1555,11 +1557,11 @@ constexpr ListenerAuth::ParseTableT_ ListenerAuth::InternalGenerateParseTable_(c { PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_._has_bits_), 0, // no _extensions_ - 6, 56, // max_field_number, fast_idx_mask + 8, 56, // max_field_number, fast_idx_mask offsetof(ParseTableT_, field_lookup_table), - 4294967232, // skipmap + 4294967040, // skipmap offsetof(ParseTableT_, field_entries), - 6, // num_field_entries + 8, // num_field_entries 2, // num_aux_entries offsetof(ParseTableT_, aux_entries), class_data, @@ -1569,10 +1571,13 @@ constexpr ListenerAuth::ParseTableT_ ListenerAuth::InternalGenerateParseTable_(c ::_pbi::TcParser::GetTable<::xtcp_config::v1::ListenerAuth>(), // to_prefetch #endif // PROTOBUF_PREFETCH_PARSE_TABLE }, {{ - {::_pbi::TcParser::MiniParse, {}}, + // string hmac_shared_key_file = 8 [json_name = "hmacSharedKeyFile", (.buf.validate.field) = { + {::_pbi::TcParser::FastUS1, + {66, 3, 0, + PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.hmac_shared_key_file_)}}, // .xtcp_config.v1.ListenerAuthMode mode = 1 [json_name = "mode", (.buf.validate.field) = { - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ListenerAuth, _impl_.mode_), 4>(), - {8, 4, 0, + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ListenerAuth, _impl_.mode_), 6>(), + {8, 6, 0, PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.mode_)}}, // string raw_token = 2 [json_name = "rawToken", (.buf.validate.field) = { {::_pbi::TcParser::FastUS1, @@ -1583,33 +1588,40 @@ constexpr ListenerAuth::ParseTableT_ ListenerAuth::InternalGenerateParseTable_(c {26, 1, 0, PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.hmac_shared_key_)}}, // optional uint32 signed_token_skew_minutes = 4 [json_name = "signedTokenSkewMinutes", (.buf.validate.field) = { - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ListenerAuth, _impl_.signed_token_skew_minutes_), 5>(), - {32, 5, 0, + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ListenerAuth, _impl_.signed_token_skew_minutes_), 7>(), + {32, 7, 0, PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.signed_token_skew_minutes_)}}, // .google.protobuf.Duration failure_jitter_min = 5 [json_name = "failureJitterMin", (.buf.validate.field) = { {::_pbi::TcParser::FastMtS1, - {42, 2, 0, + {42, 4, 0, PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.failure_jitter_min_)}}, // .google.protobuf.Duration failure_jitter_max = 6 [json_name = "failureJitterMax", (.buf.validate.field) = { {::_pbi::TcParser::FastMtS1, - {50, 3, 1, + {50, 5, 1, PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.failure_jitter_max_)}}, - {::_pbi::TcParser::MiniParse, {}}, + // string raw_token_file = 7 [json_name = "rawTokenFile", (.buf.validate.field) = { + {::_pbi::TcParser::FastUS1, + {58, 2, 0, + PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.raw_token_file_)}}, }}, {{ 65535, 65535 }}, {{ // .xtcp_config.v1.ListenerAuthMode mode = 1 [json_name = "mode", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.mode_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + {PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.mode_), _Internal::kHasBitsOffset + 6, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, // string raw_token = 2 [json_name = "rawToken", (.buf.validate.field) = { {PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.raw_token_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string hmac_shared_key = 3 [json_name = "hmacSharedKey", (.buf.validate.field) = { {PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.hmac_shared_key_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // optional uint32 signed_token_skew_minutes = 4 [json_name = "signedTokenSkewMinutes", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.signed_token_skew_minutes_), _Internal::kHasBitsOffset + 5, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.signed_token_skew_minutes_), _Internal::kHasBitsOffset + 7, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // .google.protobuf.Duration failure_jitter_min = 5 [json_name = "failureJitterMin", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.failure_jitter_min_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.failure_jitter_min_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // .google.protobuf.Duration failure_jitter_max = 6 [json_name = "failureJitterMax", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.failure_jitter_max_), _Internal::kHasBitsOffset + 3, 1, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.failure_jitter_max_), _Internal::kHasBitsOffset + 5, 1, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // string raw_token_file = 7 [json_name = "rawTokenFile", (.buf.validate.field) = { + {PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.raw_token_file_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string hmac_shared_key_file = 8 [json_name = "hmacSharedKeyFile", (.buf.validate.field) = { + {PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.hmac_shared_key_file_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, }}, {{ #ifndef PROTOBUF_MESSAGE_GLOBALS @@ -1624,10 +1636,12 @@ constexpr ListenerAuth::ParseTableT_ ListenerAuth::InternalGenerateParseTable_(c #endif }}, {{ - "\33\0\11\17\0\0\0\0" + "\33\0\11\17\0\0\0\16\24\0\0\0\0\0\0\0" "xtcp_config.v1.ListenerAuth" "raw_token" "hmac_shared_key" + "raw_token_file" + "hmac_shared_key_file" }}, }; } @@ -1642,6 +1656,12 @@ inline constexpr ListenerAuth::Impl_::Impl_( hmac_shared_key_( &::google::protobuf::internal::fixed_address_empty_string, ::_pbi::ConstantInitialized()), + raw_token_file_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + hmac_shared_key_file_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), failure_jitter_min_{nullptr}, failure_jitter_max_{nullptr}, mode_{static_cast< ::xtcp_config::v1::ListenerAuthMode >(0)}, @@ -2115,7 +2135,7 @@ constexpr auto LinkMonitorConfig::InternalGenerateClassData_( false, }, #ifdef PROTOBUF_MESSAGE_GLOBALS - &file_reflection_data[16], + &file_reflection_data[17], #else // !PROTOBUF_MESSAGE_GLOBALS &::_pbi::kDescriptorMethods, &descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto, @@ -2267,7 +2287,7 @@ constexpr auto EnabledDeserializers::InternalGenerateClassData_( false, }, #ifdef PROTOBUF_MESSAGE_GLOBALS - &file_reflection_data[19], + &file_reflection_data[20], #else // !PROTOBUF_MESSAGE_GLOBALS &::_pbi::kDescriptorMethods, &descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto, @@ -2318,6 +2338,202 @@ const ::_pbi::ClassData* EnabledDeserializers_get_class_data() { } } // namespace #endif // PROTOBUF_CUSTOM_VTABLE +class Listener::_Internal { + public: + using HasBits = decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Listener, _impl_._has_bits_); +}; + +constexpr Listener::ParseTableT_ Listener::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) { + return ParseTableT_{ + { + PROTOBUF_FIELD_OFFSET(Listener, _impl_._has_bits_), + 0, // no _extensions_ + 5, 56, // max_field_number, fast_idx_mask + offsetof(ParseTableT_, field_lookup_table), + 4294967264, // skipmap + offsetof(ParseTableT_, field_entries), + 5, // num_field_entries + 3, // num_aux_entries + offsetof(ParseTableT_, aux_entries), + class_data, + nullptr, // post_loop_handler + ::_pbi::TcParser::MpUnknownFields, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::xtcp_config::v1::Listener>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // string name = 1 [json_name = "name", (.buf.validate.field) = { + {::_pbi::TcParser::FastUS1, + {10, 1, 0, + PROTOBUF_FIELD_OFFSET(Listener, _impl_.name_)}}, + // .xtcp_config.v1.ListenerEndpoint endpoint = 2 [json_name = "endpoint", (.buf.validate.field) = { + {::_pbi::TcParser::FastMtS1, + {18, 2, 0, + PROTOBUF_FIELD_OFFSET(Listener, _impl_.endpoint_)}}, + // .xtcp_config.v1.ListenerAuth auth = 3 [json_name = "auth"]; + {::_pbi::TcParser::FastMtS1, + {26, 3, 1, + PROTOBUF_FIELD_OFFSET(Listener, _impl_.auth_)}}, + // .xtcp_config.v1.ListenerAuth admin_auth = 4 [json_name = "adminAuth"]; + {::_pbi::TcParser::FastMtS1, + {34, 4, 2, + PROTOBUF_FIELD_OFFSET(Listener, _impl_.admin_auth_)}}, + // repeated .xtcp_config.v1.EndpointClass serves = 5 [json_name = "serves", (.buf.validate.field) = { + {::_pbi::TcParser::FastV32P1, + {42, 0, 0, + PROTOBUF_FIELD_OFFSET(Listener, _impl_.serves_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // string name = 1 [json_name = "name", (.buf.validate.field) = { + {PROTOBUF_FIELD_OFFSET(Listener, _impl_.name_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .xtcp_config.v1.ListenerEndpoint endpoint = 2 [json_name = "endpoint", (.buf.validate.field) = { + {PROTOBUF_FIELD_OFFSET(Listener, _impl_.endpoint_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // .xtcp_config.v1.ListenerAuth auth = 3 [json_name = "auth"]; + {PROTOBUF_FIELD_OFFSET(Listener, _impl_.auth_), _Internal::kHasBitsOffset + 3, 1, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // .xtcp_config.v1.ListenerAuth admin_auth = 4 [json_name = "adminAuth"]; + {PROTOBUF_FIELD_OFFSET(Listener, _impl_.admin_auth_), _Internal::kHasBitsOffset + 4, 2, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // repeated .xtcp_config.v1.EndpointClass serves = 5 [json_name = "serves", (.buf.validate.field) = { + {PROTOBUF_FIELD_OFFSET(Listener, _impl_.serves_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kPackedOpenEnum)}, + }}, + {{ + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::xtcp_config::v1::ListenerEndpoint>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::xtcp_config::v1::ListenerEndpoint_globals_}, + #endif + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::xtcp_config::v1::ListenerAuth>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::xtcp_config::v1::ListenerAuth_globals_}, + #endif + #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::xtcp_config::v1::ListenerAuth>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::xtcp_config::v1::ListenerAuth_globals_}, + #endif + }}, + {{ + "\27\4\0\0\0\0\0\0" + "xtcp_config.v1.Listener" + "name" + }}, + }; +} + + +inline constexpr Listener::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : serves_ { visibility, ::_pbi::InternalMetadataOffset::Build< + ::xtcp_config::v1::Listener, + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::Listener, _impl_.serves_)>() + } + , + name_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + endpoint_{nullptr}, + auth_{nullptr}, + admin_auth_{nullptr} {} + +template +constexpr Listener::Listener(::_pbi::ConstantInitialized, + const ::_pbi::ClassData* PROTOBUF_NONNULL class_data) + : Super_( +#if defined(PROTOBUF_CUSTOM_VTABLE) + class_data +#endif // PROTOBUF_CUSTOM_VTABLE + ), + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +inline void* PROTOBUF_NONNULL Listener::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) Listener(arena); +} +constexpr auto Listener::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(Listener), alignof(Listener)); +} +constexpr auto Listener::InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* tc_table) { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &prototype, +#ifndef PROTOBUF_MESSAGE_GLOBALS + &_table_.header, +#else + tc_table, +#endif + nullptr, // IsInitialized + &Listener::MergeImpl, + Super_::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &Listener::SharedDtor, + Super_::GetClearImpl(), &Listener::ByteSizeLong, + &Listener::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Listener, _impl_._cached_size_), + false, + }, +#ifdef PROTOBUF_MESSAGE_GLOBALS + &file_reflection_data[16], +#else // !PROTOBUF_MESSAGE_GLOBALS + &::_pbi::kDescriptorMethods, + &descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto, + nullptr, // tracker +#endif // PROTOBUF_MESSAGE_GLOBALS + }; +} +struct ListenerGlobalsTypeInternal : ::_pbi::MessageGlobalsBase { + constexpr ListenerGlobalsTypeInternal() + : +#ifndef PROTOBUF_MESSAGE_GLOBALS + _default(::_pbi::ConstantInitialized{}, + Listener_class_data_.base()) +#else // !PROTOBUF_MESSAGE_GLOBALS + MessageGlobalsBase(Listener::InternalGenerateClassData_( + _default, &Listener_globals_._table.header)), + _default(::_pbi::ConstantInitialized{}, GetClassData()), + _table(::_pbi::PrivateAccess::GenerateParseTable( + GetClassData())) +#endif // PROTOBUF_MESSAGE_GLOBALS + { + } + ~ListenerGlobalsTypeInternal() {} + union { + alignas(::_pbi::kMaxMessageAlignment) Listener _default; + }; +#ifdef PROTOBUF_MESSAGE_GLOBALS + decltype(::_pbi::PrivateAccess::GenerateParseTable( + ::std::declval())) _table; +#endif +}; +#ifdef PROTOBUF_MESSAGE_GLOBALS +static_assert(PROTOBUF_FIELD_OFFSET(ListenerGlobalsTypeInternal, _default) == + ::_pbi::MessageGlobalsBase::OffsetToDefault()); +#endif // PROTOBUF_MESSAGE_GLOBALS + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST ListenerGlobalsTypeInternal Listener_globals_ + PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro); +#if defined(PROTOBUF_CUSTOM_VTABLE) +namespace { +const ::_pbi::ClassData* Listener_get_class_data() { +#ifdef PROTOBUF_MESSAGE_GLOBALS + return Listener_globals_.GetClassData(); +#else + return Listener_class_data_.base(); +#endif // PROTOBUF_MESSAGE_GLOBALS +} +} // namespace +#endif // PROTOBUF_CUSTOM_VTABLE class XtcpConfig::_Internal { public: using HasBits = decltype(::std::declval()._impl_._has_bits_); @@ -2334,8 +2550,8 @@ constexpr XtcpConfig::ParseTableT_ XtcpConfig::InternalGenerateParseTable_(const offsetof(ParseTableT_, field_lookup_table), 4278190591, // skipmap offsetof(ParseTableT_, field_entries), - 82, // num_field_entries - 14, // num_aux_entries + 83, // num_field_entries + 15, // num_aux_entries offsetof(ParseTableT_, aux_entries), class_data, nullptr, // post_loop_handler @@ -2451,13 +2667,13 @@ constexpr XtcpConfig::ParseTableT_ XtcpConfig::InternalGenerateParseTable_(const 61472, 36, 33791, 47, 16383, 52, - 64760, 54, - 65475, 59, - 65535, 63, - 58360, 63, - 49039, 69, - 255, 73, - 65531, 81, + 63736, 54, + 65475, 60, + 65535, 64, + 58360, 64, + 49039, 70, + 255, 74, + 65531, 82, 65535, 65535 }}, {{ // uint64 nl_timeout_milliseconds = 10 [json_name = "nlTimeoutMilliseconds", (.buf.validate.field) = { @@ -2491,19 +2707,19 @@ constexpr XtcpConfig::ParseTableT_ XtcpConfig::InternalGenerateParseTable_(const // uint32 io_uring_cqe_batch_size = 24 [json_name = "ioUringCqeBatchSize", (.buf.validate.field) = { {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.io_uring_cqe_batch_size_), _Internal::kHasBitsOffset + 17, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // .google.protobuf.Duration reconcile_frequency = 40 [json_name = "reconcileFrequency", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.reconcile_frequency_), _Internal::kHasBitsOffset + 47, 3, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.reconcile_frequency_), _Internal::kHasBitsOffset + 48, 3, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // bool reconcile_before_poll = 41 [json_name = "reconcileBeforePoll"]; {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.reconcile_before_poll_), _Internal::kHasBitsOffset + 19, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // uint32 write_files = 50 [json_name = "writeFiles", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.write_files_), _Internal::kHasBitsOffset + 58, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.write_files_), _Internal::kHasBitsOffset + 59, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // string capture_path = 51 [json_name = "capturePath", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.capture_path_), _Internal::kHasBitsOffset + 23, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.capture_path_), _Internal::kHasBitsOffset + 24, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // uint32 dest_write_files = 52 [json_name = "destWriteFiles", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.dest_write_files_), _Internal::kHasBitsOffset + 59, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.dest_write_files_), _Internal::kHasBitsOffset + 60, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // uint32 debug_level = 53 [json_name = "debugLevel", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.debug_level_), _Internal::kHasBitsOffset + 60, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.debug_level_), _Internal::kHasBitsOffset + 61, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // bool debug_prometheus = 54 [json_name = "debugPrometheus", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.debug_prometheus_), _Internal::kHasBitsOffset + 70, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.debug_prometheus_), _Internal::kHasBitsOffset + 71, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // string dest = 60 [json_name = "dest", (.buf.validate.field) = { {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.dest_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string marshal_to = 61 [json_name = "marshalTo", (.buf.validate.field) = { @@ -2513,117 +2729,119 @@ constexpr XtcpConfig::ParseTableT_ XtcpConfig::InternalGenerateParseTable_(const // string xtcp_proto_file = 63 [json_name = "xtcpProtoFile", (.buf.validate.field) = { {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.xtcp_proto_file_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // uint32 envelope_flush_threshold_bytes = 64 [json_name = "envelopeFlushThresholdBytes", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.envelope_flush_threshold_bytes_), _Internal::kHasBitsOffset + 61, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.envelope_flush_threshold_bytes_), _Internal::kHasBitsOffset + 62, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // uint32 envelope_flush_threshold_rows = 65 [json_name = "envelopeFlushThresholdRows", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.envelope_flush_threshold_rows_), _Internal::kHasBitsOffset + 62, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.envelope_flush_threshold_rows_), _Internal::kHasBitsOffset + 63, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // string topic = 80 [json_name = "topic", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.topic_), _Internal::kHasBitsOffset + 24, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.topic_), _Internal::kHasBitsOffset + 25, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string kafka_schema_url = 81 [json_name = "kafkaSchemaUrl", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.kafka_schema_url_), _Internal::kHasBitsOffset + 25, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.kafka_schema_url_), _Internal::kHasBitsOffset + 26, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // .google.protobuf.Duration kafka_produce_timeout = 82 [json_name = "kafkaProduceTimeout", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.kafka_produce_timeout_), _Internal::kHasBitsOffset + 48, 4, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.kafka_produce_timeout_), _Internal::kHasBitsOffset + 49, 4, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // string kafka_compression = 83 [json_name = "kafkaCompression", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.kafka_compression_), _Internal::kHasBitsOffset + 26, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.kafka_compression_), _Internal::kHasBitsOffset + 27, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string s3_endpoint = 100 [json_name = "s3Endpoint", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_endpoint_), _Internal::kHasBitsOffset + 27, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_endpoint_), _Internal::kHasBitsOffset + 28, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string s3_region = 101 [json_name = "s3Region", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_region_), _Internal::kHasBitsOffset + 28, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_region_), _Internal::kHasBitsOffset + 29, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string s3_bucket = 102 [json_name = "s3Bucket", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_bucket_), _Internal::kHasBitsOffset + 29, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_bucket_), _Internal::kHasBitsOffset + 30, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string s3_prefix = 103 [json_name = "s3Prefix", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_prefix_), _Internal::kHasBitsOffset + 30, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_prefix_), _Internal::kHasBitsOffset + 31, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string s3_access_key = 104 [json_name = "s3AccessKey", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_access_key_), _Internal::kHasBitsOffset + 31, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_access_key_), _Internal::kHasBitsOffset + 32, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string s3_secret_key = 105 [json_name = "s3SecretKey", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_secret_key_), _Internal::kHasBitsOffset + 32, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_secret_key_), _Internal::kHasBitsOffset + 33, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // bool s3_skip_bucket_probe = 106 [json_name = "s3SkipBucketProbe", (.buf.validate.field) = { {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_skip_bucket_probe_), _Internal::kHasBitsOffset + 20, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // bool s3_allow_insecure = 107 [json_name = "s3AllowInsecure", (.buf.validate.field) = { {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_allow_insecure_), _Internal::kHasBitsOffset + 21, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // string s3_ca_file = 108 [json_name = "s3CaFile", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_ca_file_), _Internal::kHasBitsOffset + 33, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_ca_file_), _Internal::kHasBitsOffset + 34, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // uint32 s3_parquet_flush_threshold_bytes = 110 [json_name = "s3ParquetFlushThresholdBytes", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_parquet_flush_threshold_bytes_), _Internal::kHasBitsOffset + 63, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_parquet_flush_threshold_bytes_), _Internal::kHasBitsOffset + 64, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // .google.protobuf.Duration s3_flush_interval = 111 [json_name = "s3FlushInterval", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_flush_interval_), _Internal::kHasBitsOffset + 49, 5, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_flush_interval_), _Internal::kHasBitsOffset + 50, 5, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // uint32 s3_flush_jitter_pct = 112 [json_name = "s3FlushJitterPct", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_flush_jitter_pct_), _Internal::kHasBitsOffset + 64, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_flush_jitter_pct_), _Internal::kHasBitsOffset + 65, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // uint32 s3_flush_threshold_jitter_pct = 113 [json_name = "s3FlushThresholdJitterPct", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_flush_threshold_jitter_pct_), _Internal::kHasBitsOffset + 65, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_flush_threshold_jitter_pct_), _Internal::kHasBitsOffset + 66, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // uint32 s3_upload_max_attempts = 114 [json_name = "s3UploadMaxAttempts", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_upload_max_attempts_), _Internal::kHasBitsOffset + 66, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_upload_max_attempts_), _Internal::kHasBitsOffset + 67, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // .google.protobuf.Duration s3_upload_backoff_cap = 115 [json_name = "s3UploadBackoffCap", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_upload_backoff_cap_), _Internal::kHasBitsOffset + 50, 6, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.s3_upload_backoff_cap_), _Internal::kHasBitsOffset + 51, 6, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // string hostname = 130 [json_name = "hostname", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.hostname_), _Internal::kHasBitsOffset + 34, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.hostname_), _Internal::kHasBitsOffset + 35, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string location = 131 [json_name = "location", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.location_), _Internal::kHasBitsOffset + 35, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.location_), _Internal::kHasBitsOffset + 36, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string label = 132 [json_name = "label", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.label_), _Internal::kHasBitsOffset + 36, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.label_), _Internal::kHasBitsOffset + 37, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string tag = 133 [json_name = "tag", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.tag_), _Internal::kHasBitsOffset + 37, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.tag_), _Internal::kHasBitsOffset + 38, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string daemon_version = 134 [json_name = "daemonVersion", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.daemon_version_), _Internal::kHasBitsOffset + 38, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.daemon_version_), _Internal::kHasBitsOffset + 39, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // uint32 ipv4_ttl = 150 [json_name = "ipv4Ttl", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.ipv4_ttl_), _Internal::kHasBitsOffset + 67, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.ipv4_ttl_), _Internal::kHasBitsOffset + 68, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // uint32 ipv6_hop_limit = 151 [json_name = "ipv6HopLimit", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.ipv6_hop_limit_), _Internal::kHasBitsOffset + 68, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.ipv6_hop_limit_), _Internal::kHasBitsOffset + 69, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // .xtcp_config.v1.ListenerAuth listener_auth = 152 [json_name = "listenerAuth", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.listener_auth_), _Internal::kHasBitsOffset + 51, 7, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.listener_auth_), _Internal::kHasBitsOffset + 52, 7, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // .xtcp_config.v1.ListenerEndpoint prometheus_listener = 153 [json_name = "prometheusListener", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.prometheus_listener_), _Internal::kHasBitsOffset + 52, 8, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.prometheus_listener_), _Internal::kHasBitsOffset + 53, 8, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // .xtcp_config.v1.ListenerAuth admin_listener_auth = 154 [json_name = "adminListenerAuth", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.admin_listener_auth_), _Internal::kHasBitsOffset + 53, 9, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.admin_listener_auth_), _Internal::kHasBitsOffset + 54, 9, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // uint32 grpc_port = 160 [json_name = "grpcPort", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.grpc_port_), _Internal::kHasBitsOffset + 69, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.grpc_port_), _Internal::kHasBitsOffset + 70, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // .xtcp_config.v1.ListenerEndpoint grpc_listener = 161 [json_name = "grpcListener", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.grpc_listener_), _Internal::kHasBitsOffset + 54, 10, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.grpc_listener_), _Internal::kHasBitsOffset + 55, 10, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // repeated .xtcp_config.v1.Listener listeners = 162 [json_name = "listeners", (.buf.validate.field) = { + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.listeners_), _Internal::kHasBitsOffset + 22, 11, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, // string pyroscope_url = 170 [json_name = "pyroscopeUrl", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.pyroscope_url_), _Internal::kHasBitsOffset + 39, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.pyroscope_url_), _Internal::kHasBitsOffset + 40, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string pyroscope_app_name = 171 [json_name = "pyroscopeAppName", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.pyroscope_app_name_), _Internal::kHasBitsOffset + 40, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.pyroscope_app_name_), _Internal::kHasBitsOffset + 41, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // uint32 pyroscope_sample_hz = 172 [json_name = "pyroscopeSampleHz", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.pyroscope_sample_hz_), _Internal::kHasBitsOffset + 74, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.pyroscope_sample_hz_), _Internal::kHasBitsOffset + 75, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // uint32 pyroscope_upload_interval_sec = 173 [json_name = "pyroscopeUploadIntervalSec", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.pyroscope_upload_interval_sec_), _Internal::kHasBitsOffset + 75, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.pyroscope_upload_interval_sec_), _Internal::kHasBitsOffset + 76, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // bool resolve_container_id = 200 [json_name = "resolveContainerId", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.resolve_container_id_), _Internal::kHasBitsOffset + 71, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.resolve_container_id_), _Internal::kHasBitsOffset + 72, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // bool enrich_container_enable = 201 [json_name = "enrichContainerEnable"]; - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.enrich_container_enable_), _Internal::kHasBitsOffset + 72, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.enrich_container_enable_), _Internal::kHasBitsOffset + 73, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // string docker_socket_path = 202 [json_name = "dockerSocketPath", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.docker_socket_path_), _Internal::kHasBitsOffset + 41, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.docker_socket_path_), _Internal::kHasBitsOffset + 42, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // bool enrich_lldp_enable = 210 [json_name = "enrichLldpEnable"]; - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.enrich_lldp_enable_), _Internal::kHasBitsOffset + 73, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.enrich_lldp_enable_), _Internal::kHasBitsOffset + 74, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // string lldpd_socket_path = 211 [json_name = "lldpdSocketPath", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.lldpd_socket_path_), _Internal::kHasBitsOffset + 42, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.lldpd_socket_path_), _Internal::kHasBitsOffset + 43, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string lldpd_version_hint = 212 [json_name = "lldpdVersionHint", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.lldpd_version_hint_), _Internal::kHasBitsOffset + 43, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.lldpd_version_hint_), _Internal::kHasBitsOffset + 44, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // bool enrich_nic_enable = 220 [json_name = "enrichNicEnable"]; - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.enrich_nic_enable_), _Internal::kHasBitsOffset + 77, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.enrich_nic_enable_), _Internal::kHasBitsOffset + 78, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // uint32 uplink_count = 221 [json_name = "uplinkCount", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.uplink_count_), _Internal::kHasBitsOffset + 76, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.uplink_count_), _Internal::kHasBitsOffset + 77, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, // repeated string uplink_interfaces = 222 [json_name = "uplinkInterfaces", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.uplink_interfaces_), _Internal::kHasBitsOffset + 22, 0, (0 | ::_fl::kFcRepeated | ::_fl::kUtf8String | ::_fl::kRepSString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.uplink_interfaces_), _Internal::kHasBitsOffset + 23, 0, (0 | ::_fl::kFcRepeated | ::_fl::kUtf8String | ::_fl::kRepSString)}, // bool populate_nsid = 230 [json_name = "populateNsid"]; - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.populate_nsid_), _Internal::kHasBitsOffset + 78, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.populate_nsid_), _Internal::kHasBitsOffset + 79, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // bool enrich_asn_enable = 240 [json_name = "enrichAsnEnable"]; - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.enrich_asn_enable_), _Internal::kHasBitsOffset + 79, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.enrich_asn_enable_), _Internal::kHasBitsOffset + 80, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // string asn_db_path = 241 [json_name = "asnDbPath", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.asn_db_path_), _Internal::kHasBitsOffset + 44, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.asn_db_path_), _Internal::kHasBitsOffset + 45, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // .google.protobuf.Duration asn_refresh_interval = 242 [json_name = "asnRefreshInterval"]; - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.asn_refresh_interval_), _Internal::kHasBitsOffset + 55, 11, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.asn_refresh_interval_), _Internal::kHasBitsOffset + 56, 12, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // string ipmeta_bootstrap_path = 243 [json_name = "ipmetaBootstrapPath", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.ipmeta_bootstrap_path_), _Internal::kHasBitsOffset + 45, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.ipmeta_bootstrap_path_), _Internal::kHasBitsOffset + 46, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string ipmeta_cache_path = 244 [json_name = "ipmetaCachePath", (.buf.validate.field) = { - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.ipmeta_cache_path_), _Internal::kHasBitsOffset + 46, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.ipmeta_cache_path_), _Internal::kHasBitsOffset + 47, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // bool enrich_locality_enable = 245 [json_name = "enrichLocalityEnable"]; - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.enrich_locality_enable_), _Internal::kHasBitsOffset + 80, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.enrich_locality_enable_), _Internal::kHasBitsOffset + 81, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // .google.protobuf.Duration locality_refresh_interval = 246 [json_name = "localityRefreshInterval"]; - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.locality_refresh_interval_), _Internal::kHasBitsOffset + 56, 12, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.locality_refresh_interval_), _Internal::kHasBitsOffset + 57, 13, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // bool locality_events_enable = 247 [json_name = "localityEventsEnable"]; - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.locality_events_enable_), _Internal::kHasBitsOffset + 81, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.locality_events_enable_), _Internal::kHasBitsOffset + 82, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // .xtcp_config.v1.LinkMonitorConfig link_monitor = 250 [json_name = "linkMonitor"]; - {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.link_monitor_), _Internal::kHasBitsOffset + 57, 13, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.link_monitor_), _Internal::kHasBitsOffset + 58, 14, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ #ifndef PROTOBUF_MESSAGE_GLOBALS @@ -2682,6 +2900,11 @@ constexpr XtcpConfig::ParseTableT_ XtcpConfig::InternalGenerateParseTable_(const {::_pbi::FieldAuxMessageGlobals(), &::xtcp_config::v1::ListenerEndpoint_globals_}, #endif #ifndef PROTOBUF_MESSAGE_GLOBALS + {::_pbi::TcParser::GetTable<::xtcp_config::v1::Listener>()}, + #else + {::_pbi::FieldAuxMessageGlobals(), &::xtcp_config::v1::Listener_globals_}, + #endif + #ifndef PROTOBUF_MESSAGE_GLOBALS {::_pbi::TcParser::GetTable<::google::protobuf::Duration>()}, #else {::_pbi::FieldAuxMessageGlobals(), &::google::protobuf::Duration_globals_}, @@ -2698,7 +2921,7 @@ constexpr XtcpConfig::ParseTableT_ XtcpConfig::InternalGenerateParseTable_(const #endif }}, {{ - "\31\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\14\0\0\0\4\12\13\17\0\0\5\20\0\21\13\11\11\11\15\15\0\0\12\0\0\0\0\0\0\10\10\5\3\16\0\0\0\0\0\0\0\15\22\0\0\0\0\22\0\21\22\0\0\21\0\0\13\0\25\21\0\0\0\0\0\0\0\0\0" + "\31\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\14\0\0\0\4\12\13\17\0\0\5\20\0\21\13\11\11\11\15\15\0\0\12\0\0\0\0\0\0\10\10\5\3\16\0\0\0\0\0\0\0\0\15\22\0\0\0\0\22\0\21\22\0\0\21\0\0\13\0\25\21\0\0\0\0\0\0\0\0" "xtcp_config.v1.XtcpConfig" "capture_path" "dest" @@ -2767,6 +2990,11 @@ inline constexpr XtcpConfig::Impl_::Impl_( reconcile_before_poll_{false}, s3_skip_bucket_probe_{false}, s3_allow_insecure_{false}, + listeners_ { visibility, ::_pbi::InternalMetadataOffset::Build< + ::xtcp_config::v1::XtcpConfig, + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.listeners_)>() + } + , uplink_interfaces_ { visibility, ::_pbi::InternalMetadataOffset::Build< ::xtcp_config::v1::XtcpConfig, PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.uplink_interfaces_)>() @@ -2921,7 +3149,7 @@ constexpr auto XtcpConfig::InternalGenerateClassData_( false, }, #ifdef PROTOBUF_MESSAGE_GLOBALS - &file_reflection_data[17], + &file_reflection_data[18], #else // !PROTOBUF_MESSAGE_GLOBALS &::_pbi::kDescriptorMethods, &descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto, @@ -3851,7 +4079,7 @@ const ::_pbi::ClassData* GetResponse_get_class_data() { } // namespace v1 } // namespace xtcp_config static const ::_pb::EnumDescriptor* PROTOBUF_NONNULL - file_level_enum_descriptors_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto[2]; + file_level_enum_descriptors_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto[3]; static constexpr const ::_pb::ServiceDescriptor* PROTOBUF_NONNULL* PROTOBUF_NULLABLE file_level_service_descriptors_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto = nullptr; const ::uint32_t @@ -3944,20 +4172,37 @@ const ::uint32_t 6, 0x081, // bitmap PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::ListenerAuth, _impl_._has_bits_), - 9, // hasbit index offset + 11, // hasbit index offset PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::ListenerAuth, _impl_.mode_), PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::ListenerAuth, _impl_.raw_token_), PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::ListenerAuth, _impl_.hmac_shared_key_), PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::ListenerAuth, _impl_.signed_token_skew_minutes_), PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::ListenerAuth, _impl_.failure_jitter_min_), PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::ListenerAuth, _impl_.failure_jitter_max_), - 4, + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::ListenerAuth, _impl_.raw_token_file_), + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::ListenerAuth, _impl_.hmac_shared_key_file_), + 6, 0, 1, + 7, + 4, 5, 2, 3, 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::Listener, _impl_._has_bits_), + 8, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::Listener, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::Listener, _impl_.endpoint_), + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::Listener, _impl_.auth_), + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::Listener, _impl_.admin_auth_), + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::Listener, _impl_.serves_), + 1, + 2, + 3, + 4, + 0, + 0x081, // bitmap PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::LinkMonitorConfig, _impl_._has_bits_), 31, // hasbit index offset PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::LinkMonitorConfig, _impl_.enable_), @@ -4018,7 +4263,7 @@ const ::uint32_t 22, 0x081, // bitmap PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_._has_bits_), - 85, // hasbit index offset + 86, // hasbit index offset PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.nl_timeout_milliseconds_), PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.poll_frequency_), PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.poll_timeout_), @@ -4078,6 +4323,7 @@ const ::uint32_t PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.admin_listener_auth_), PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.grpc_port_), PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.grpc_listener_), + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.listeners_), PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.pyroscope_url_), PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.pyroscope_app_name_), PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.pyroscope_sample_hz_), @@ -4116,73 +4362,74 @@ const ::uint32_t 18, 16, 17, - 47, + 48, 19, - 58, - 23, 59, + 24, 60, - 70, + 61, + 71, 0, 1, 2, 3, - 61, 62, - 24, + 63, 25, - 48, 26, + 49, 27, 28, 29, 30, 31, 32, + 33, 20, 21, - 33, - 63, - 49, + 34, 64, + 50, 65, 66, - 50, - 34, + 67, + 51, 35, 36, 37, 38, - 67, + 39, 68, - 51, + 69, 52, 53, - 69, 54, - 39, + 70, + 55, + 22, 40, - 74, + 41, 75, - 71, + 76, 72, - 41, 73, 42, + 74, 43, - 77, - 76, - 22, + 44, 78, + 77, + 23, 79, - 44, - 55, - 45, - 46, 80, + 45, 56, + 46, + 47, 81, 57, + 82, + 58, 0x081, // bitmap PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::EnabledDeserializers_EnabledEntry_DoNotUse, _impl_._has_bits_), 5, // hasbit index offset @@ -4215,10 +4462,11 @@ static const ::_pbi::MigrationSchema {63, sizeof(::xtcp_config::v1::SetEnvelopeFlushResponse)}, {68, sizeof(::xtcp_config::v1::ListenerEndpoint)}, {85, sizeof(::xtcp_config::v1::ListenerAuth)}, - {100, sizeof(::xtcp_config::v1::LinkMonitorConfig)}, - {159, sizeof(::xtcp_config::v1::XtcpConfig)}, - {326, sizeof(::xtcp_config::v1::EnabledDeserializers_EnabledEntry_DoNotUse)}, - {333, sizeof(::xtcp_config::v1::EnabledDeserializers)}, + {104, sizeof(::xtcp_config::v1::Listener)}, + {117, sizeof(::xtcp_config::v1::LinkMonitorConfig)}, + {176, sizeof(::xtcp_config::v1::XtcpConfig)}, + {345, sizeof(::xtcp_config::v1::EnabledDeserializers_EnabledEntry_DoNotUse)}, + {352, sizeof(::xtcp_config::v1::EnabledDeserializers)}, }; static const ::_pbi::MessageGlobalsBase* PROTOBUF_NONNULL const file_message_globals[] = { @@ -4238,6 +4486,7 @@ static const ::_pbi::MessageGlobalsBase* PROTOBUF_NONNULL const &::xtcp_config::v1::SetEnvelopeFlushResponse_globals_, &::xtcp_config::v1::ListenerEndpoint_globals_, &::xtcp_config::v1::ListenerAuth_globals_, + &::xtcp_config::v1::Listener_globals_, &::xtcp_config::v1::LinkMonitorConfig_globals_, &::xtcp_config::v1::XtcpConfig_globals_, &::xtcp_config::v1::EnabledDeserializers_EnabledEntry_DoNotUse_globals_, @@ -4303,7 +4552,7 @@ const char descriptor_table_protodef_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto[ "nections\030\005 \001(\rB\t\272H\006*\004\030\240\215\006R\016maxConnection" "s\022>\n\026accept_rate_per_second\030\006 \001(\rB\t\272H\006*\004" "\030\240\215\006R\023acceptRatePerSecond\022,\n\014accept_burs" - "t\030\007 \001(\rB\t\272H\006*\004\030\240\215\006R\013acceptBurst\"\230\005\n\014List" + "t\030\007 \001(\rB\t\272H\006*\004\030\240\215\006R\013acceptBurst\"\203\006\n\014List" "enerAuth\022>\n\004mode\030\001 \001(\0162 .xtcp_config.v1." "ListenerAuthModeB\010\272H\005\202\001\002\020\001R\004mode\022%\n\traw_" "token\030\002 \001(\tB\010\272H\005r\003\030\200 R\010rawToken\0220\n\017hmac_" @@ -4314,218 +4563,237 @@ const char descriptor_table_protodef_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto[ ".DurationB\010\272H\005\252\001\0022\000R\020failureJitterMin\022Q\n" "\022failure_jitter_max\030\006 \001(\0132\031.google.proto" "buf.DurationB\010\272H\005\252\001\0022\000R\020failureJitterMax" - ":\341\001\272H\335\001\032\332\001\n\032ListenerAuth.failureJitter\022F" - "failure_jitter_max must be greater than " - "or equal to failure_jitter_min\032t!has(thi" - "s.failure_jitter_min) || !has(this.failu" - "re_jitter_max) || this.failure_jitter_ma" - "x >= this.failure_jitter_minB\034\n\032_signed_" - "token_skew_minutes\"\232\016\n\021LinkMonitorConfig" - "\022\026\n\006enable\030\001 \001(\010R\006enable\022-\n\rbaseline_fil" - "e\030\002 \001(\tB\010\272H\005r\003\030\200 R\014baselineFile\022A\n\006settl" - "e\030\003 \001(\0132\031.google.protobuf.DurationB\016\272H\013\252" - "\001\010\"\004\010\200\243\0052\000R\006settle\022A\n\006resync\030\004 \001(\0132\031.goo" - "gle.protobuf.DurationB\016\272H\013\252\001\010\"\004\010\200\365$*\000R\006r" - "esync\022P\n\016stats_interval\030\005 \001(\0132\031.google.p" - "rotobuf.DurationB\016\272H\013\252\001\010\"\004\010\200\243\005*\000R\rstatsI" - "nterval\022-\n\rstats_include\030\006 \001(\tB\010\272H\005r\003\030\200 " - "R\014statsInclude\022-\n\rstats_exclude\030\007 \001(\tB\010\272" - "H\005r\003\030\200 R\014statsExclude\022/\n\016netstat_fields\030" - "\010 \001(\tB\010\272H\005r\003\030\200 R\rnetstatFields\022D\n\024max_sp" - "eed_exceptions\030\t \003(\tB\022\272H\017\222\001\014\020\200\002\"\007r\005\020\001\030\200\001" - "R\022maxSpeedExceptions\022:\n\024metrics_core_inc" - "lude\030\n \001(\tB\010\272H\005r\003\030\200 R\022metricsCoreInclude" - "\022:\n\024metrics_core_exclude\030\013 \001(\tB\010\272H\005r\003\030\200 " - "R\022metricsCoreExclude\022\037\n\013metrics_all\030\014 \001(" - "\010R\nmetricsAll\022A\n\017collection_mode\030\r \001(\tB\030" - "\272H\025r\023R\000R\004pollR\ton-demandR\016collectionMode" - "\022P\n\016watch_interval\030\016 \001(\0132\031.google.protob" - "uf.DurationB\016\272H\013\252\001\010\"\004\010\200\243\005*\000R\rwatchInterv" - "al\022N\n\rslow_interval\030\017 \001(\0132\031.google.proto" - "buf.DurationB\016\272H\013\252\001\010\"\004\010\200\243\005*\000R\014slowInterv" - "al\022M\n\ron_demand_ttl\030\020 \001(\0132\031.google.proto" - "buf.DurationB\016\272H\013\252\001\010\"\004\010\200\243\0052\000R\013onDemandTt" - "l\022M\n\016on_demand_wait\030\021 \001(\0132\031.google.proto" - "buf.DurationB\014\272H\t\252\001\006\032\002\010\n*\000R\014onDemandWait" - "\022L\n\014error_window\030\022 \001(\0132\031.google.protobuf" - ".DurationB\016\272H\013\252\001\010\"\004\010\200\365$2\000R\013errorWindow\022J" - "\n\013flap_window\030\023 \001(\0132\031.google.protobuf.Du" - "rationB\016\272H\013\252\001\010\"\004\010\200\365$2\000R\nflapWindow\022\\\n\rer" - "ror_classes\030\024 \001(\tB2\272H/r-\030@2)^((link|rdma" - "|drop)(,(link|rdma|drop))*)\?$H\000R\014errorCl" - "asses\210\001\001\022-\n\rerror_exclude\030\025 \001(\tB\010\272H\005r\003\030\200" - " R\014errorExclude\022<\n\022metrics_categories\030\026 " - "\001(\tB\010\272H\005r\003\030\200\002H\001R\021metricsCategories\210\001\001\022;\n" - "\027metrics_interface_paths\030\027 \001(\010H\002R\025metric" - "sInterfacePaths\210\001\001\0227\n\020metrics_all_path\030\030" - " \001(\tB\010\272H\005r\003\030\200\002H\003R\016metricsAllPath\210\001\001\022\031\n\010i" - "p_paths\030\031 \001(\010R\007ipPaths\022-\n\014ip_max_bytes\030\032" - " \001(\rB\013\272H\010*\006\030\200\200\200\200\004R\nipMaxBytes\022$\n\tip_list" - "en\030\033 \001(\tB\007\272H\004r\002\030@R\010ipListen\022P\n\016learn_dea" - "dline\030\034 \001(\0132\031.google.protobuf.DurationB\016" - "\272H\013\252\001\010\"\004\010\200\243\0052\000R\rlearnDeadlineB\020\n\016_error_" - "classesB\025\n\023_metrics_categoriesB\032\n\030_metri" - "cs_interface_pathsB\023\n\021_metrics_all_path\"" - "\352%\n\nXtcpConfig\022F\n\027nl_timeout_millisecond" - "s\030\n \001(\004B\016\272H\0132\006\030\240\215\006(\000\310\001\001R\025nlTimeoutMillis" - "econds\022S\n\016poll_frequency\030\013 \001(\0132\031.google." - "protobuf.DurationB\021\272H\016\252\001\010\"\004\010\200\365$*\000\310\001\001R\rpo" - "llFrequency\022O\n\014poll_timeout\030\014 \001(\0132\031.goog" - "le.protobuf.DurationB\021\272H\016\252\001\010\"\004\010\200\365$*\000\310\001\001R" - "\013pollTimeout\0222\n\017poll_jitter_pct\030\r \001(\rB\n\272" - "H\007*\002\030d\310\001\000R\rpollJitterPct\022+\n\tmax_loops\030\016 " - "\001(\004B\016\272H\0132\006\030\240\215\006(\000\310\001\000R\010maxLoops\022,\n\nnetlink" - "ers\030\017 \001(\rB\014\272H\t*\004\030d(\001\310\001\001R\nnetlinkers\022H\n\031n" - "etlinkers_done_chan_size\030\020 \001(\rB\r\272H\n*\005\030\350\007" - "(\001\310\001\001R\026netlinkersDoneChanSize\022*\n\tnlmsg_s" - "eq\030\021 \001(\rB\r\272H\n*\005\030\220N(\000\310\001\001R\010nlmsgSeq\022/\n\013pac" - "ket_size\030\022 \001(\004B\016\272H\0132\006\030\300\204=(\000\310\001\000R\npacketSi" - "ze\0226\n\020packet_size_mply\030\023 \001(\rB\014\272H\t*\004\030d(\000\310" - "\001\000R\016packetSizeMply\022(\n\007modulus\030\024 \001(\004B\016\272H\013" - "2\006\030\300\204=(\001\310\001\001R\007modulus\022a\n\025enabled_deserial" - "izers\030\025 \001(\0132$.xtcp_config.v1.EnabledDese" - "rializersB\006\272H\003\310\001\000R\024enabledDeserializers\022" - "!\n\010io_uring\030\026 \001(\010B\006\272H\003\310\001\000R\007ioUring\022E\n\030io" - "_uring_recv_batch_size\030\027 \001(\rB\r\272H\n*\005\030\200 (\001" - "\310\001\000R\024ioUringRecvBatchSize\022C\n\027io_uring_cq" - "e_batch_size\030\030 \001(\rB\r\272H\n*\005\030\200 (\001\310\001\000R\023ioUri" - "ngCqeBatchSize\022W\n\023reconcile_frequency\030( " - "\001(\0132\031.google.protobuf.DurationB\013\272H\010\252\001\0022\000" - "\310\001\000R\022reconcileFrequency\0222\n\025reconcile_bef" - "ore_poll\030) \001(\010R\023reconcileBeforePoll\022.\n\013w" - "rite_files\0302 \001(\rB\r\272H\n*\005\030\350\007(\000\310\001\000R\nwriteFi" - "les\022/\n\014capture_path\0303 \001(\tB\014\272H\tr\004\020\001\030P\310\001\000R" - "\013capturePath\0227\n\020dest_write_files\0304 \001(\rB\r" - "\272H\n*\005\030\350\007(\000\310\001\000R\016destWriteFiles\022.\n\013debug_l" - "evel\0305 \001(\rB\r\272H\n*\005\030\350\007(\000\310\001\001R\ndebugLevel\0221\n" - "\020debug_prometheus\0306 \001(\010B\006\272H\003\310\001\000R\017debugPr" - "ometheus\022!\n\004dest\030< \001(\tB\r\272H\nr\005\020\004\030\200\004\310\001\001R\004d" - "est\022+\n\nmarshal_to\030= \001(\tB\014\272H\tr\004\020\003\030(\310\001\001R\tm" - "arshalTo\022\'\n\013csv_columns\030> \001(\tB\006\272H\003\310\001\000R\nc" - "svColumns\0224\n\017xtcp_proto_file\030\? \001(\tB\014\272H\tr" - "\004\020\001\030P\310\001\000R\rxtcpProtoFile\022K\n\036envelope_flus" - "h_threshold_bytes\030@ \001(\rB\006\272H\003\310\001\000R\033envelop" - "eFlushThresholdBytes\022I\n\035envelope_flush_t" - "hreshold_rows\030A \001(\rB\006\272H\003\310\001\000R\032envelopeFlu" - "shThresholdRows\022\"\n\005topic\030P \001(\tB\014\272H\tr\004\020\001\030" - "(\310\001\000R\005topic\0226\n\020kafka_schema_url\030Q \001(\tB\014\272" - "H\tr\004\020\001\030<\310\001\000R\016kafkaSchemaUrl\022_\n\025kafka_pro" - "duce_timeout\030R \001(\0132\031.google.protobuf.Dur" - "ationB\020\272H\r\252\001\007\"\003\010\330\0042\000\310\001\000R\023kafkaProduceTim" - "eout\0223\n\021kafka_compression\030S \001(\tB\006\272H\003\310\001\000R" - "\020kafkaCompression\022\'\n\013s3_endpoint\030d \001(\tB\006" - "\272H\003\310\001\000R\ns3Endpoint\022#\n\ts3_region\030e \001(\tB\006\272" - "H\003\310\001\000R\010s3Region\022#\n\ts3_bucket\030f \001(\tB\006\272H\003\310" - "\001\000R\010s3Bucket\022#\n\ts3_prefix\030g \001(\tB\006\272H\003\310\001\000R" - "\010s3Prefix\022*\n\rs3_access_key\030h \001(\tB\006\272H\003\310\001\000" - "R\013s3AccessKey\022*\n\rs3_secret_key\030i \001(\tB\006\272H" - "\003\310\001\000R\013s3SecretKey\0227\n\024s3_skip_bucket_prob" - "e\030j \001(\010B\006\272H\003\310\001\000R\021s3SkipBucketProbe\0222\n\021s3" - "_allow_insecure\030k \001(\010B\006\272H\003\310\001\000R\017s3AllowIn" - "secure\022)\n\ns3_ca_file\030l \001(\tB\013\272H\010r\003\030\200 \310\001\000R" - "\010s3CaFile\022N\n s3_parquet_flush_threshold_" - "bytes\030n \001(\rB\006\272H\003\310\001\000R\034s3ParquetFlushThres" - "holdBytes\022R\n\021s3_flush_interval\030o \001(\0132\031.g" - "oogle.protobuf.DurationB\013\272H\010\252\001\0022\000\310\001\000R\017s3" - "FlushInterval\0229\n\023s3_flush_jitter_pct\030p \001" - "(\rB\n\272H\007*\002\030d\310\001\000R\020s3FlushJitterPct\022L\n\035s3_f" - "lush_threshold_jitter_pct\030q \001(\rB\n\272H\007*\002\030d" - "\310\001\000R\031s3FlushThresholdJitterPct\022A\n\026s3_upl" - "oad_max_attempts\030r \001(\rB\014\272H\t*\004\030d(\001\310\001\000R\023s3" - "UploadMaxAttempts\022Y\n\025s3_upload_backoff_c" - "ap\030s \001(\0132\031.google.protobuf.DurationB\013\272H\010" - "\252\001\0022\000\310\001\000R\022s3UploadBackoffCap\022(\n\010hostname" - "\030\202\001 \001(\tB\013\272H\010r\003\030\375\001\310\001\000R\010hostname\022(\n\010locati" - "on\030\203\001 \001(\tB\013\272H\010r\003\030\375\001\310\001\000R\010location\022!\n\005labe" - "l\030\204\001 \001(\tB\n\272H\007r\002\030(\310\001\000R\005label\022\035\n\003tag\030\205\001 \001(" - "\tB\n\272H\007r\002\030(\310\001\000R\003tag\0223\n\016daemon_version\030\206\001 " - "\001(\tB\013\272H\010r\003\030\375\001\310\001\000R\rdaemonVersion\022\'\n\010ipv4_" - "ttl\030\226\001 \001(\rB\013\272H\010*\003\030\377\001\310\001\000R\007ipv4Ttl\0222\n\016ipv6" - "_hop_limit\030\227\001 \001(\rB\013\272H\010*\003\030\377\001\310\001\000R\014ipv6HopL" - "imit\022J\n\rlistener_auth\030\230\001 \001(\0132\034.xtcp_conf" - "ig.v1.ListenerAuthB\006\272H\003\310\001\000R\014listenerAuth" - "\022Z\n\023prometheus_listener\030\231\001 \001(\0132 .xtcp_co" - "nfig.v1.ListenerEndpointB\006\272H\003\310\001\000R\022promet" - "heusListener\022U\n\023admin_listener_auth\030\232\001 \001" - "(\0132\034.xtcp_config.v1.ListenerAuthB\006\272H\003\310\001\000" - "R\021adminListenerAuth\022,\n\tgrpc_port\030\240\001 \001(\rB" - "\016\272H\013*\006\030\377\377\003(\001\310\001\001R\010grpcPort\022N\n\rgrpc_listen" - "er\030\241\001 \001(\0132 .xtcp_config.v1.ListenerEndpo" - "intB\006\272H\003\310\001\000R\014grpcListener\022,\n\rpyroscope_u" - "rl\030\252\001 \001(\tB\006\272H\003\310\001\000R\014pyroscopeUrl\0225\n\022pyros" - "cope_app_name\030\253\001 \001(\tB\006\272H\003\310\001\000R\020pyroscopeA" - "ppName\0227\n\023pyroscope_sample_hz\030\254\001 \001(\rB\006\272H" - "\003\310\001\000R\021pyroscopeSampleHz\022J\n\035pyroscope_upl" - "oad_interval_sec\030\255\001 \001(\rB\006\272H\003\310\001\000R\032pyrosco" - "peUploadIntervalSec\0229\n\024resolve_container" - "_id\030\310\001 \001(\010B\006\272H\003\310\001\000R\022resolveContainerId\0227" - "\n\027enrich_container_enable\030\311\001 \001(\010R\025enrich" - "ContainerEnable\0227\n\022docker_socket_path\030\312\001" - " \001(\tB\010\272H\005r\003\030\377\001R\020dockerSocketPath\022-\n\022enri" - "ch_lldp_enable\030\322\001 \001(\010R\020enrichLldpEnable\022" - "5\n\021lldpd_socket_path\030\323\001 \001(\tB\010\272H\005r\003\030\377\001R\017l" - "ldpdSocketPath\0226\n\022lldpd_version_hint\030\324\001 " - "\001(\tB\007\272H\004r\002\030\020R\020lldpdVersionHint\022+\n\021enrich" - "_nic_enable\030\334\001 \001(\010R\017enrichNicEnable\022+\n\014u" - "plink_count\030\335\001 \001(\rB\007\272H\004*\002\030\002R\013uplinkCount" - "\0226\n\021uplink_interfaces\030\336\001 \003(\tB\010\272H\005\222\001\002\020\002R\020" - "uplinkInterfaces\022$\n\rpopulate_nsid\030\346\001 \001(\010" - "R\014populateNsid\022+\n\021enrich_asn_enable\030\360\001 \001" - "(\010R\017enrichAsnEnable\022)\n\013asn_db_path\030\361\001 \001(" - "\tB\010\272H\005r\003\030\377\001R\tasnDbPath\022L\n\024asn_refresh_in" - "terval\030\362\001 \001(\0132\031.google.protobuf.Duration" - "R\022asnRefreshInterval\022=\n\025ipmeta_bootstrap" - "_path\030\363\001 \001(\tB\010\272H\005r\003\030\377\001R\023ipmetaBootstrapP" - "ath\0225\n\021ipmeta_cache_path\030\364\001 \001(\tB\010\272H\005r\003\030\377" - "\001R\017ipmetaCachePath\0225\n\026enrich_locality_en" - "able\030\365\001 \001(\010R\024enrichLocalityEnable\022V\n\031loc" - "ality_refresh_interval\030\366\001 \001(\0132\031.google.p" - "rotobuf.DurationR\027localityRefreshInterva" - "l\0225\n\026locality_events_enable\030\367\001 \001(\010R\024loca" - "lityEventsEnable\022E\n\014link_monitor\030\372\001 \001(\0132" - "!.xtcp_config.v1.LinkMonitorConfigR\013link" - "Monitor:s\272Hp\032n\n\017XtcpConfig.poll\0222Poll ti" - "meout must be less than poll poll_freque" - "ncy\032\'this.poll_frequency > this.poll_tim" - "eout\"\237\001\n\024EnabledDeserializers\022K\n\007enabled" - "\030\001 \003(\01321.xtcp_config.v1.EnabledDeseriali" - "zers.EnabledEntryR\007enabled\032:\n\014EnabledEnt" - "ry\022\020\n\003key\030\001 \001(\tR\003key\022\024\n\005value\030\002 \001(\010R\005val" - "ue:\0028\001*h\n\017ListenerNetwork\022 \n\034LISTENER_NE" - "TWORK_UNSPECIFIED\020\000\022\030\n\024LISTENER_NETWORK_" - "TCP\020\001\022\031\n\025LISTENER_NETWORK_UNIX\020\002*\241\001\n\020Lis" - "tenerAuthMode\022\"\n\036LISTENER_AUTH_MODE_UNSP" - "ECIFIED\020\000\022\037\n\033LISTENER_AUTH_MODE_DISABLED" - "\020\001\022 \n\034LISTENER_AUTH_MODE_RAW_TOKEN\020\002\022&\n\"" - "LISTENER_AUTH_MODE_HMAC_UTC_MINUTE\020\0032\245\007\n" - "\rConfigService\022a\n\003Get\022\032.xtcp_config.v1.G" - "etRequest\032\033.xtcp_config.v1.GetResponse\"!" - "\310\363\030\001\202\323\344\223\002\027\032\022/ConfigService/Get:\001*\022a\n\003Set" - "\022\032.xtcp_config.v1.SetRequest\032\033.xtcp_conf" - "ig.v1.SetResponse\"!\310\363\030\002\202\323\344\223\002\027\032\022/ConfigSe" - "rvice/Set:\001*\022\225\001\n\020SetPollFrequency\022\'.xtcp" - "_config.v1.SetPollFrequencyRequest\032(.xtc" - "p_config.v1.SetPollFrequencyResponse\".\310\363" - "\030\002\202\323\344\223\002$\032\037/ConfigService/SetPollFrequenc" - "y:\001*\022\201\001\n\013TriggerPoll\022\".xtcp_config.v1.Tr" - "iggerPollRequest\032#.xtcp_config.v1.Trigge" - "rPollResponse\")\310\363\030\002\202\323\344\223\002\037\032\032/ConfigServic" - "e/TriggerPoll:\001*\022\225\001\n\020TriggerPollBurst\022\'." - "xtcp_config.v1.TriggerPollBurstRequest\032(" - ".xtcp_config.v1.TriggerPollBurstResponse" - "\".\310\363\030\002\202\323\344\223\002$\032\037/ConfigService/TriggerPoll" - "Burst:\001*\022\201\001\n\013SetS3Upload\022\".xtcp_config.v" - "1.SetS3UploadRequest\032#.xtcp_config.v1.Se" - "tS3UploadResponse\")\310\363\030\002\202\323\344\223\002\037\032\032/ConfigSe" - "rvice/SetS3Upload:\001*\022\225\001\n\020SetEnvelopeFlus" - "h\022\'.xtcp_config.v1.SetEnvelopeFlushReque" - "st\032(.xtcp_config.v1.SetEnvelopeFlushResp" - "onse\".\310\363\030\002\202\323\344\223\002$\032\037/ConfigService/SetEnve" - "lopeFlush:\001*B\257\001\n\022com.xtcp_config.v1B\017Xtc" - "pConfigProtoP\001Z3github.com/randomizedcod" - "er/xtcp2/gen/go/xtcp_config\242\002\003XXX\252\002\rXtcp" - "Config.V1\312\002\rXtcpConfig\\V1\342\002\031XtcpConfig\\V" - "1\\GPBMetadata\352\002\016XtcpConfig::V1b\006proto3" + "\022.\n\016raw_token_file\030\007 \001(\tB\010\272H\005r\003\030\200 R\014rawT" + "okenFile\0229\n\024hmac_shared_key_file\030\010 \001(\tB\010" + "\272H\005r\003\030\200 R\021hmacSharedKeyFile:\341\001\272H\335\001\032\332\001\n\032L" + "istenerAuth.failureJitter\022Ffailure_jitte" + "r_max must be greater than or equal to f" + "ailure_jitter_min\032t!has(this.failure_jit" + "ter_min) || !has(this.failure_jitter_max" + ") || this.failure_jitter_max >= this.fai" + "lure_jitter_minB\034\n\032_signed_token_skew_mi" + "nutes\"\277\002\n\010Listener\0220\n\004name\030\001 \001(\tB\034\272H\031r\027\020" + "\001\030 2\021^[a-z][a-z0-9-]*$R\004name\022D\n\010endpoint" + "\030\002 \001(\0132 .xtcp_config.v1.ListenerEndpoint" + "B\006\272H\003\310\001\001R\010endpoint\0220\n\004auth\030\003 \001(\0132\034.xtcp_" + "config.v1.ListenerAuthR\004auth\022;\n\nadmin_au" + "th\030\004 \001(\0132\034.xtcp_config.v1.ListenerAuthR\t" + "adminAuth\022L\n\006serves\030\005 \003(\0162\035.xtcp_config." + "v1.EndpointClassB\025\272H\022\222\001\017\010\001\020\007\030\001\"\007\202\001\004\020\001 \000R" + "\006serves\"\232\016\n\021LinkMonitorConfig\022\026\n\006enable\030" + "\001 \001(\010R\006enable\022-\n\rbaseline_file\030\002 \001(\tB\010\272H" + "\005r\003\030\200 R\014baselineFile\022A\n\006settle\030\003 \001(\0132\031.g" + "oogle.protobuf.DurationB\016\272H\013\252\001\010\"\004\010\200\243\0052\000R" + "\006settle\022A\n\006resync\030\004 \001(\0132\031.google.protobu" + "f.DurationB\016\272H\013\252\001\010\"\004\010\200\365$*\000R\006resync\022P\n\016st" + "ats_interval\030\005 \001(\0132\031.google.protobuf.Dur" + "ationB\016\272H\013\252\001\010\"\004\010\200\243\005*\000R\rstatsInterval\022-\n\r" + "stats_include\030\006 \001(\tB\010\272H\005r\003\030\200 R\014statsIncl" + "ude\022-\n\rstats_exclude\030\007 \001(\tB\010\272H\005r\003\030\200 R\014st" + "atsExclude\022/\n\016netstat_fields\030\010 \001(\tB\010\272H\005r" + "\003\030\200 R\rnetstatFields\022D\n\024max_speed_excepti" + "ons\030\t \003(\tB\022\272H\017\222\001\014\020\200\002\"\007r\005\020\001\030\200\001R\022maxSpeedE" + "xceptions\022:\n\024metrics_core_include\030\n \001(\tB" + "\010\272H\005r\003\030\200 R\022metricsCoreInclude\022:\n\024metrics" + "_core_exclude\030\013 \001(\tB\010\272H\005r\003\030\200 R\022metricsCo" + "reExclude\022\037\n\013metrics_all\030\014 \001(\010R\nmetricsA" + "ll\022A\n\017collection_mode\030\r \001(\tB\030\272H\025r\023R\000R\004po" + "llR\ton-demandR\016collectionMode\022P\n\016watch_i" + "nterval\030\016 \001(\0132\031.google.protobuf.Duration" + "B\016\272H\013\252\001\010\"\004\010\200\243\005*\000R\rwatchInterval\022N\n\rslow_" + "interval\030\017 \001(\0132\031.google.protobuf.Duratio" + "nB\016\272H\013\252\001\010\"\004\010\200\243\005*\000R\014slowInterval\022M\n\ron_de" + "mand_ttl\030\020 \001(\0132\031.google.protobuf.Duratio" + "nB\016\272H\013\252\001\010\"\004\010\200\243\0052\000R\013onDemandTtl\022M\n\016on_dem" + "and_wait\030\021 \001(\0132\031.google.protobuf.Duratio" + "nB\014\272H\t\252\001\006\032\002\010\n*\000R\014onDemandWait\022L\n\014error_w" + "indow\030\022 \001(\0132\031.google.protobuf.DurationB\016" + "\272H\013\252\001\010\"\004\010\200\365$2\000R\013errorWindow\022J\n\013flap_wind" + "ow\030\023 \001(\0132\031.google.protobuf.DurationB\016\272H\013" + "\252\001\010\"\004\010\200\365$2\000R\nflapWindow\022\\\n\rerror_classes" + "\030\024 \001(\tB2\272H/r-\030@2)^((link|rdma|drop)(,(li" + "nk|rdma|drop))*)\?$H\000R\014errorClasses\210\001\001\022-\n" + "\rerror_exclude\030\025 \001(\tB\010\272H\005r\003\030\200 R\014errorExc" + "lude\022<\n\022metrics_categories\030\026 \001(\tB\010\272H\005r\003\030" + "\200\002H\001R\021metricsCategories\210\001\001\022;\n\027metrics_in" + "terface_paths\030\027 \001(\010H\002R\025metricsInterfaceP" + "aths\210\001\001\0227\n\020metrics_all_path\030\030 \001(\tB\010\272H\005r\003" + "\030\200\002H\003R\016metricsAllPath\210\001\001\022\031\n\010ip_paths\030\031 \001" + "(\010R\007ipPaths\022-\n\014ip_max_bytes\030\032 \001(\rB\013\272H\010*\006" + "\030\200\200\200\200\004R\nipMaxBytes\022$\n\tip_listen\030\033 \001(\tB\007\272" + "H\004r\002\030@R\010ipListen\022P\n\016learn_deadline\030\034 \001(\013" + "2\031.google.protobuf.DurationB\016\272H\013\252\001\010\"\004\010\200\243" + "\0052\000R\rlearnDeadlineB\020\n\016_error_classesB\025\n\023" + "_metrics_categoriesB\032\n\030_metrics_interfac" + "e_pathsB\023\n\021_metrics_all_path\"\250&\n\nXtcpCon" + "fig\022F\n\027nl_timeout_milliseconds\030\n \001(\004B\016\272H" + "\0132\006\030\240\215\006(\000\310\001\001R\025nlTimeoutMilliseconds\022S\n\016p" + "oll_frequency\030\013 \001(\0132\031.google.protobuf.Du" + "rationB\021\272H\016\252\001\010\"\004\010\200\365$*\000\310\001\001R\rpollFrequency" + "\022O\n\014poll_timeout\030\014 \001(\0132\031.google.protobuf" + ".DurationB\021\272H\016\252\001\010\"\004\010\200\365$*\000\310\001\001R\013pollTimeou" + "t\0222\n\017poll_jitter_pct\030\r \001(\rB\n\272H\007*\002\030d\310\001\000R\r" + "pollJitterPct\022+\n\tmax_loops\030\016 \001(\004B\016\272H\0132\006\030" + "\240\215\006(\000\310\001\000R\010maxLoops\022,\n\nnetlinkers\030\017 \001(\rB\014" + "\272H\t*\004\030d(\001\310\001\001R\nnetlinkers\022H\n\031netlinkers_d" + "one_chan_size\030\020 \001(\rB\r\272H\n*\005\030\350\007(\001\310\001\001R\026netl" + "inkersDoneChanSize\022*\n\tnlmsg_seq\030\021 \001(\rB\r\272" + "H\n*\005\030\220N(\000\310\001\001R\010nlmsgSeq\022/\n\013packet_size\030\022 " + "\001(\004B\016\272H\0132\006\030\300\204=(\000\310\001\000R\npacketSize\0226\n\020packe" + "t_size_mply\030\023 \001(\rB\014\272H\t*\004\030d(\000\310\001\000R\016packetS" + "izeMply\022(\n\007modulus\030\024 \001(\004B\016\272H\0132\006\030\300\204=(\001\310\001\001" + "R\007modulus\022a\n\025enabled_deserializers\030\025 \001(\013" + "2$.xtcp_config.v1.EnabledDeserializersB\006" + "\272H\003\310\001\000R\024enabledDeserializers\022!\n\010io_uring" + "\030\026 \001(\010B\006\272H\003\310\001\000R\007ioUring\022E\n\030io_uring_recv" + "_batch_size\030\027 \001(\rB\r\272H\n*\005\030\200 (\001\310\001\000R\024ioUrin" + "gRecvBatchSize\022C\n\027io_uring_cqe_batch_siz" + "e\030\030 \001(\rB\r\272H\n*\005\030\200 (\001\310\001\000R\023ioUringCqeBatchS" + "ize\022W\n\023reconcile_frequency\030( \001(\0132\031.googl" + "e.protobuf.DurationB\013\272H\010\252\001\0022\000\310\001\000R\022reconc" + "ileFrequency\0222\n\025reconcile_before_poll\030) " + "\001(\010R\023reconcileBeforePoll\022.\n\013write_files\030" + "2 \001(\rB\r\272H\n*\005\030\350\007(\000\310\001\000R\nwriteFiles\022/\n\014capt" + "ure_path\0303 \001(\tB\014\272H\tr\004\020\001\030P\310\001\000R\013capturePat" + "h\0227\n\020dest_write_files\0304 \001(\rB\r\272H\n*\005\030\350\007(\000\310" + "\001\000R\016destWriteFiles\022.\n\013debug_level\0305 \001(\rB" + "\r\272H\n*\005\030\350\007(\000\310\001\001R\ndebugLevel\0221\n\020debug_prom" + "etheus\0306 \001(\010B\006\272H\003\310\001\000R\017debugPrometheus\022!\n" + "\004dest\030< \001(\tB\r\272H\nr\005\020\004\030\200\004\310\001\001R\004dest\022+\n\nmars" + "hal_to\030= \001(\tB\014\272H\tr\004\020\003\030(\310\001\001R\tmarshalTo\022\'\n" + "\013csv_columns\030> \001(\tB\006\272H\003\310\001\000R\ncsvColumns\0224" + "\n\017xtcp_proto_file\030\? \001(\tB\014\272H\tr\004\020\001\030P\310\001\000R\rx" + "tcpProtoFile\022K\n\036envelope_flush_threshold" + "_bytes\030@ \001(\rB\006\272H\003\310\001\000R\033envelopeFlushThres" + "holdBytes\022I\n\035envelope_flush_threshold_ro" + "ws\030A \001(\rB\006\272H\003\310\001\000R\032envelopeFlushThreshold" + "Rows\022\"\n\005topic\030P \001(\tB\014\272H\tr\004\020\001\030(\310\001\000R\005topic" + "\0226\n\020kafka_schema_url\030Q \001(\tB\014\272H\tr\004\020\001\030<\310\001\000" + "R\016kafkaSchemaUrl\022_\n\025kafka_produce_timeou" + "t\030R \001(\0132\031.google.protobuf.DurationB\020\272H\r\252" + "\001\007\"\003\010\330\0042\000\310\001\000R\023kafkaProduceTimeout\0223\n\021kaf" + "ka_compression\030S \001(\tB\006\272H\003\310\001\000R\020kafkaCompr" + "ession\022\'\n\013s3_endpoint\030d \001(\tB\006\272H\003\310\001\000R\ns3E" + "ndpoint\022#\n\ts3_region\030e \001(\tB\006\272H\003\310\001\000R\010s3Re" + "gion\022#\n\ts3_bucket\030f \001(\tB\006\272H\003\310\001\000R\010s3Bucke" + "t\022#\n\ts3_prefix\030g \001(\tB\006\272H\003\310\001\000R\010s3Prefix\022*" + "\n\rs3_access_key\030h \001(\tB\006\272H\003\310\001\000R\013s3AccessK" + "ey\022*\n\rs3_secret_key\030i \001(\tB\006\272H\003\310\001\000R\013s3Sec" + "retKey\0227\n\024s3_skip_bucket_probe\030j \001(\010B\006\272H" + "\003\310\001\000R\021s3SkipBucketProbe\0222\n\021s3_allow_inse" + "cure\030k \001(\010B\006\272H\003\310\001\000R\017s3AllowInsecure\022)\n\ns" + "3_ca_file\030l \001(\tB\013\272H\010r\003\030\200 \310\001\000R\010s3CaFile\022N" + "\n s3_parquet_flush_threshold_bytes\030n \001(\r" + "B\006\272H\003\310\001\000R\034s3ParquetFlushThresholdBytes\022R" + "\n\021s3_flush_interval\030o \001(\0132\031.google.proto" + "buf.DurationB\013\272H\010\252\001\0022\000\310\001\000R\017s3FlushInterv" + "al\0229\n\023s3_flush_jitter_pct\030p \001(\rB\n\272H\007*\002\030d" + "\310\001\000R\020s3FlushJitterPct\022L\n\035s3_flush_thresh" + "old_jitter_pct\030q \001(\rB\n\272H\007*\002\030d\310\001\000R\031s3Flus" + "hThresholdJitterPct\022A\n\026s3_upload_max_att" + "empts\030r \001(\rB\014\272H\t*\004\030d(\001\310\001\000R\023s3UploadMaxAt" + "tempts\022Y\n\025s3_upload_backoff_cap\030s \001(\0132\031." + "google.protobuf.DurationB\013\272H\010\252\001\0022\000\310\001\000R\022s" + "3UploadBackoffCap\022(\n\010hostname\030\202\001 \001(\tB\013\272H" + "\010r\003\030\375\001\310\001\000R\010hostname\022(\n\010location\030\203\001 \001(\tB\013" + "\272H\010r\003\030\375\001\310\001\000R\010location\022!\n\005label\030\204\001 \001(\tB\n\272" + "H\007r\002\030(\310\001\000R\005label\022\035\n\003tag\030\205\001 \001(\tB\n\272H\007r\002\030(\310" + "\001\000R\003tag\0223\n\016daemon_version\030\206\001 \001(\tB\013\272H\010r\003\030" + "\375\001\310\001\000R\rdaemonVersion\022\'\n\010ipv4_ttl\030\226\001 \001(\rB" + "\013\272H\010*\003\030\377\001\310\001\000R\007ipv4Ttl\0222\n\016ipv6_hop_limit\030" + "\227\001 \001(\rB\013\272H\010*\003\030\377\001\310\001\000R\014ipv6HopLimit\022J\n\rlis" + "tener_auth\030\230\001 \001(\0132\034.xtcp_config.v1.Liste" + "nerAuthB\006\272H\003\310\001\000R\014listenerAuth\022Z\n\023prometh" + "eus_listener\030\231\001 \001(\0132 .xtcp_config.v1.Lis" + "tenerEndpointB\006\272H\003\310\001\000R\022prometheusListene" + "r\022U\n\023admin_listener_auth\030\232\001 \001(\0132\034.xtcp_c" + "onfig.v1.ListenerAuthB\006\272H\003\310\001\000R\021adminList" + "enerAuth\022\'\n\tgrpc_port\030\240\001 \001(\rB\t\272H\006*\004\030\377\377\003R" + "\010grpcPort\022N\n\rgrpc_listener\030\241\001 \001(\0132 .xtcp" + "_config.v1.ListenerEndpointB\006\272H\003\310\001\000R\014grp" + "cListener\022A\n\tlisteners\030\242\001 \003(\0132\030.xtcp_con" + "fig.v1.ListenerB\010\272H\005\222\001\002\020\020R\tlisteners\022,\n\r" + "pyroscope_url\030\252\001 \001(\tB\006\272H\003\310\001\000R\014pyroscopeU" + "rl\0225\n\022pyroscope_app_name\030\253\001 \001(\tB\006\272H\003\310\001\000R" + "\020pyroscopeAppName\0227\n\023pyroscope_sample_hz" + "\030\254\001 \001(\rB\006\272H\003\310\001\000R\021pyroscopeSampleHz\022J\n\035py" + "roscope_upload_interval_sec\030\255\001 \001(\rB\006\272H\003\310" + "\001\000R\032pyroscopeUploadIntervalSec\0229\n\024resolv" + "e_container_id\030\310\001 \001(\010B\006\272H\003\310\001\000R\022resolveCo" + "ntainerId\0227\n\027enrich_container_enable\030\311\001 " + "\001(\010R\025enrichContainerEnable\0227\n\022docker_soc" + "ket_path\030\312\001 \001(\tB\010\272H\005r\003\030\377\001R\020dockerSocketP" + "ath\022-\n\022enrich_lldp_enable\030\322\001 \001(\010R\020enrich" + "LldpEnable\0225\n\021lldpd_socket_path\030\323\001 \001(\tB\010" + "\272H\005r\003\030\377\001R\017lldpdSocketPath\0226\n\022lldpd_versi" + "on_hint\030\324\001 \001(\tB\007\272H\004r\002\030\020R\020lldpdVersionHin" + "t\022+\n\021enrich_nic_enable\030\334\001 \001(\010R\017enrichNic" + "Enable\022+\n\014uplink_count\030\335\001 \001(\rB\007\272H\004*\002\030\002R\013" + "uplinkCount\0226\n\021uplink_interfaces\030\336\001 \003(\tB" + "\010\272H\005\222\001\002\020\002R\020uplinkInterfaces\022$\n\rpopulate_" + "nsid\030\346\001 \001(\010R\014populateNsid\022+\n\021enrich_asn_" + "enable\030\360\001 \001(\010R\017enrichAsnEnable\022)\n\013asn_db" + "_path\030\361\001 \001(\tB\010\272H\005r\003\030\377\001R\tasnDbPath\022L\n\024asn" + "_refresh_interval\030\362\001 \001(\0132\031.google.protob" + "uf.DurationR\022asnRefreshInterval\022=\n\025ipmet" + "a_bootstrap_path\030\363\001 \001(\tB\010\272H\005r\003\030\377\001R\023ipmet" + "aBootstrapPath\0225\n\021ipmeta_cache_path\030\364\001 \001" + "(\tB\010\272H\005r\003\030\377\001R\017ipmetaCachePath\0225\n\026enrich_" + "locality_enable\030\365\001 \001(\010R\024enrichLocalityEn" + "able\022V\n\031locality_refresh_interval\030\366\001 \001(\013" + "2\031.google.protobuf.DurationR\027localityRef" + "reshInterval\0225\n\026locality_events_enable\030\367" + "\001 \001(\010R\024localityEventsEnable\022E\n\014link_moni" + "tor\030\372\001 \001(\0132!.xtcp_config.v1.LinkMonitorC" + "onfigR\013linkMonitor:s\272Hp\032n\n\017XtcpConfig.po" + "ll\0222Poll timeout must be less than poll " + "poll_frequency\032\'this.poll_frequency > th" + "is.poll_timeout\"\237\001\n\024EnabledDeserializers" + "\022K\n\007enabled\030\001 \003(\01321.xtcp_config.v1.Enabl" + "edDeserializers.EnabledEntryR\007enabled\032:\n" + "\014EnabledEntry\022\020\n\003key\030\001 \001(\tR\003key\022\024\n\005value" + "\030\002 \001(\010R\005value:\0028\001*h\n\017ListenerNetwork\022 \n\034" + "LISTENER_NETWORK_UNSPECIFIED\020\000\022\030\n\024LISTEN" + "ER_NETWORK_TCP\020\001\022\031\n\025LISTENER_NETWORK_UNI" + "X\020\002*\241\001\n\020ListenerAuthMode\022\"\n\036LISTENER_AUT" + "H_MODE_UNSPECIFIED\020\000\022\037\n\033LISTENER_AUTH_MO" + "DE_DISABLED\020\001\022 \n\034LISTENER_AUTH_MODE_RAW_" + "TOKEN\020\002\022&\n\"LISTENER_AUTH_MODE_HMAC_UTC_M" + "INUTE\020\003*\367\001\n\rEndpointClass\022\036\n\032ENDPOINT_CL" + "ASS_UNSPECIFIED\020\000\022\031\n\025ENDPOINT_CLASS_HEAL" + "TH\020\001\022\032\n\026ENDPOINT_CLASS_METRICS\020\002\022!\n\035ENDP" + "OINT_CLASS_METRICS_DETAIL\020\003\022\025\n\021ENDPOINT_" + "CLASS_IP\020\004\022\030\n\024ENDPOINT_CLASS_DEBUG\020\005\022\034\n\030" + "ENDPOINT_CLASS_GRPC_READ\020\006\022\035\n\031ENDPOINT_C" + "LASS_GRPC_ADMIN\020\0072\245\007\n\rConfigService\022a\n\003G" + "et\022\032.xtcp_config.v1.GetRequest\032\033.xtcp_co" + "nfig.v1.GetResponse\"!\310\363\030\001\202\323\344\223\002\027\032\022/Config" + "Service/Get:\001*\022a\n\003Set\022\032.xtcp_config.v1.S" + "etRequest\032\033.xtcp_config.v1.SetResponse\"!" + "\310\363\030\002\202\323\344\223\002\027\032\022/ConfigService/Set:\001*\022\225\001\n\020Se" + "tPollFrequency\022\'.xtcp_config.v1.SetPollF" + "requencyRequest\032(.xtcp_config.v1.SetPoll" + "FrequencyResponse\".\310\363\030\002\202\323\344\223\002$\032\037/ConfigSe" + "rvice/SetPollFrequency:\001*\022\201\001\n\013TriggerPol" + "l\022\".xtcp_config.v1.TriggerPollRequest\032#." + "xtcp_config.v1.TriggerPollResponse\")\310\363\030\002" + "\202\323\344\223\002\037\032\032/ConfigService/TriggerPoll:\001*\022\225\001" + "\n\020TriggerPollBurst\022\'.xtcp_config.v1.Trig" + "gerPollBurstRequest\032(.xtcp_config.v1.Tri" + "ggerPollBurstResponse\".\310\363\030\002\202\323\344\223\002$\032\037/Conf" + "igService/TriggerPollBurst:\001*\022\201\001\n\013SetS3U" + "pload\022\".xtcp_config.v1.SetS3UploadReques" + "t\032#.xtcp_config.v1.SetS3UploadResponse\")" + "\310\363\030\002\202\323\344\223\002\037\032\032/ConfigService/SetS3Upload:\001" + "*\022\225\001\n\020SetEnvelopeFlush\022\'.xtcp_config.v1." + "SetEnvelopeFlushRequest\032(.xtcp_config.v1" + ".SetEnvelopeFlushResponse\".\310\363\030\002\202\323\344\223\002$\032\037/" + "ConfigService/SetEnvelopeFlush:\001*B\257\001\n\022co" + "m.xtcp_config.v1B\017XtcpConfigProtoP\001Z3git" + "hub.com/randomizedcoder/xtcp2/gen/go/xtc" + "p_config\242\002\003XXX\252\002\rXtcpConfig.V1\312\002\rXtcpCon" + "fig\\V1\342\002\031XtcpConfig\\V1\\GPBMetadata\352\002\016Xtc" + "pConfig::V1b\006proto3" }; static const ::_pbi::DescriptorTable* PROTOBUF_NONNULL const descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto_deps[4] = { @@ -4538,13 +4806,13 @@ static ::absl::once_flag descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2ep PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto = { false, false, - 11238, + 11979, descriptor_table_protodef_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto, "xtcp_config/v1/xtcp_config.proto", &descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto_once, descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto_deps, 4, - 20, + 21, schemas, file_message_globals, TableStruct_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto::offsets, @@ -4567,6 +4835,13 @@ ListenerAuthMode_descriptor() { } PROTOBUF_CONSTINIT const uint32_t ListenerAuthMode_internal_data_[] = { 262144u, 0u, }; +[[nodiscard]] const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL +EndpointClass_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto); + return file_level_enum_descriptors_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto[2]; +} +PROTOBUF_CONSTINIT const uint32_t EndpointClass_internal_data_[] = { + 524288u, 0u, }; // =================================================================== GetRequest::GetRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) @@ -7597,12 +7872,12 @@ ::google::protobuf::Metadata ListenerEndpoint::GetMetadata() const { void ListenerAuth::clear_failure_jitter_min() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.failure_jitter_min_ != nullptr) _impl_.failure_jitter_min_->Clear(); - ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); } void ListenerAuth::clear_failure_jitter_max() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.failure_jitter_max_ != nullptr) _impl_.failure_jitter_max_->Clear(); - ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + ClearHasBit(_impl_._has_bits_[0], 0x00000020U); } ListenerAuth::ListenerAuth(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) #if defined(PROTOBUF_CUSTOM_VTABLE) @@ -7619,7 +7894,9 @@ PROTOBUF_NDEBUG_INLINE ListenerAuth::Impl_::Impl_( [[maybe_unused]] const ::xtcp_config::v1::ListenerAuth& from_msg) : _has_bits_{from._has_bits_}, raw_token_(arena, from.raw_token_), - hmac_shared_key_(arena, from.hmac_shared_key_) {} + hmac_shared_key_(arena, from.hmac_shared_key_), + raw_token_file_(arena, from.raw_token_file_), + hmac_shared_key_file_(arena, from.hmac_shared_key_file_) {} ListenerAuth::ListenerAuth( ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, @@ -7636,10 +7913,10 @@ ListenerAuth::ListenerAuth( from._internal_metadata_); new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.failure_jitter_min_ = (CheckHasBit(cached_has_bits, 0x00000004U)) + _impl_.failure_jitter_min_ = (CheckHasBit(cached_has_bits, 0x00000010U)) ? Super_::CopyConstruct(arena, *from._impl_.failure_jitter_min_) : nullptr; - _impl_.failure_jitter_max_ = (CheckHasBit(cached_has_bits, 0x00000008U)) + _impl_.failure_jitter_max_ = (CheckHasBit(cached_has_bits, 0x00000020U)) ? Super_::CopyConstruct(arena, *from._impl_.failure_jitter_max_) : nullptr; ::memcpy(reinterpret_cast(&_impl_) + @@ -7656,7 +7933,9 @@ PROTOBUF_NDEBUG_INLINE ListenerAuth::Impl_::Impl_( [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) : raw_token_(arena), - hmac_shared_key_(arena) {} + hmac_shared_key_(arena), + raw_token_file_(arena), + hmac_shared_key_file_(arena) {} inline void ListenerAuth::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { new (&_impl_) Impl_(internal_visibility(), arena); @@ -7680,6 +7959,8 @@ inline void ListenerAuth::SharedDtor(MessageLite& self) { ABSL_DCHECK(this_.GetArena() == nullptr); this_._impl_.raw_token_.Destroy(); this_._impl_.hmac_shared_key_.Destroy(); + this_._impl_.raw_token_file_.Destroy(); + this_._impl_.hmac_shared_key_file_.Destroy(); delete this_._impl_.failure_jitter_min_; delete this_._impl_.failure_jitter_max_; this_._impl_.~Impl_(); @@ -7718,7 +7999,7 @@ PROTOBUF_NOINLINE void ListenerAuth::Clear() { ::uint32_t cached_has_bits [[maybe_unused]] = 0; cached_has_bits = this_._impl_._has_bits_[0]; - if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + if (BatchCheckHasBit(cached_has_bits, 0x0000003fU)) { if (CheckHasBit(cached_has_bits, 0x00000001U)) { this_._impl_.raw_token_.ClearNonDefaultToEmpty(); } @@ -7726,15 +8007,21 @@ PROTOBUF_NOINLINE void ListenerAuth::Clear() { this_._impl_.hmac_shared_key_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000004U)) { + this_._impl_.raw_token_file_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + this_._impl_.hmac_shared_key_file_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000010U)) { ABSL_DCHECK(this_._impl_.failure_jitter_min_ != nullptr); this_._impl_.failure_jitter_min_->Clear(); } - if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (CheckHasBit(cached_has_bits, 0x00000020U)) { ABSL_DCHECK(this_._impl_.failure_jitter_max_ != nullptr); this_._impl_.failure_jitter_max_->Clear(); } } - if (BatchCheckHasBit(cached_has_bits, 0x00000030U)) { + if (BatchCheckHasBit(cached_has_bits, 0x000000c0U)) { ::memset(&this_._impl_.mode_, 0, static_cast<::size_t>( reinterpret_cast(&this_._impl_.signed_token_skew_minutes_) - @@ -7765,7 +8052,7 @@ ::uint8_t* PROTOBUF_NONNULL ListenerAuth::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[0]; // .xtcp_config.v1.ListenerAuthMode mode = 1 [json_name = "mode", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (this_._internal_mode() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( @@ -7794,26 +8081,46 @@ ::uint8_t* PROTOBUF_NONNULL ListenerAuth::_InternalSerialize( } // optional uint32 signed_token_skew_minutes = 4 [json_name = "signedTokenSkewMinutes", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( 4, this_._internal_signed_token_skew_minutes(), target); } // .google.protobuf.Duration failure_jitter_min = 5 [json_name = "failureJitterMin", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (CheckHasBit(cached_has_bits, 0x00000010U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 5, *this_._impl_.failure_jitter_min_, this_._impl_.failure_jitter_min_->GetCachedSize(), target, stream); } // .google.protobuf.Duration failure_jitter_max = 6 [json_name = "failureJitterMax", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (CheckHasBit(cached_has_bits, 0x00000020U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 6, *this_._impl_.failure_jitter_max_, this_._impl_.failure_jitter_max_->GetCachedSize(), target, stream); } + // string raw_token_file = 7 [json_name = "rawTokenFile", (.buf.validate.field) = { + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_raw_token_file().empty()) { + const ::std::string& _s = this_._internal_raw_token_file(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "xtcp_config.v1.ListenerAuth.raw_token_file"); + target = stream->WriteStringMaybeAliased(7, _s, target); + } + } + + // string hmac_shared_key_file = 8 [json_name = "hmacSharedKeyFile", (.buf.validate.field) = { + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (!this_._internal_hmac_shared_key_file().empty()) { + const ::std::string& _s = this_._internal_hmac_shared_key_file(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "xtcp_config.v1.ListenerAuth.hmac_shared_key_file"); + target = stream->WriteStringMaybeAliased(8, _s, target); + } + } + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( @@ -7837,7 +8144,7 @@ ::size_t ListenerAuth::ByteSizeLong() const { ::_pbi::Prefetch5LinesFrom7Lines(&this_); cached_has_bits = this_._impl_._has_bits_[0]; - if (BatchCheckHasBit(cached_has_bits, 0x0000003fU)) { + if (BatchCheckHasBit(cached_has_bits, 0x000000ffU)) { // string raw_token = 2 [json_name = "rawToken", (.buf.validate.field) = { if (CheckHasBit(cached_has_bits, 0x00000001U)) { if (!this_._internal_raw_token().empty()) { @@ -7852,25 +8159,39 @@ ::size_t ListenerAuth::ByteSizeLong() const { this_._internal_hmac_shared_key()); } } - // .google.protobuf.Duration failure_jitter_min = 5 [json_name = "failureJitterMin", (.buf.validate.field) = { + // string raw_token_file = 7 [json_name = "rawTokenFile", (.buf.validate.field) = { if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_raw_token_file().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_raw_token_file()); + } + } + // string hmac_shared_key_file = 8 [json_name = "hmacSharedKeyFile", (.buf.validate.field) = { + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (!this_._internal_hmac_shared_key_file().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_hmac_shared_key_file()); + } + } + // .google.protobuf.Duration failure_jitter_min = 5 [json_name = "failureJitterMin", (.buf.validate.field) = { + if (CheckHasBit(cached_has_bits, 0x00000010U)) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.failure_jitter_min_); } // .google.protobuf.Duration failure_jitter_max = 6 [json_name = "failureJitterMax", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (CheckHasBit(cached_has_bits, 0x00000020U)) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.failure_jitter_max_); } // .xtcp_config.v1.ListenerAuthMode mode = 1 [json_name = "mode", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (this_._internal_mode() != 0) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this_._internal_mode()); } } // optional uint32 signed_token_skew_minutes = 4 [json_name = "signedTokenSkewMinutes", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( this_._internal_signed_token_skew_minutes()); } @@ -7893,7 +8214,7 @@ void ListenerAuth::MergeImpl(::google::protobuf::MessageLite& to_msg, (void)cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (BatchCheckHasBit(cached_has_bits, 0x0000003fU)) { + if (BatchCheckHasBit(cached_has_bits, 0x000000ffU)) { if (CheckHasBit(cached_has_bits, 0x00000001U)) { if (!from._internal_raw_token().empty()) { _this->_internal_set_raw_token(from._internal_raw_token()); @@ -7913,6 +8234,24 @@ void ListenerAuth::MergeImpl(::google::protobuf::MessageLite& to_msg, } } if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!from._internal_raw_token_file().empty()) { + _this->_internal_set_raw_token_file(from._internal_raw_token_file()); + } else { + if (_this->_impl_.raw_token_file_.IsDefault()) { + _this->_internal_set_raw_token_file(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (!from._internal_hmac_shared_key_file().empty()) { + _this->_internal_set_hmac_shared_key_file(from._internal_hmac_shared_key_file()); + } else { + if (_this->_impl_.hmac_shared_key_file_.IsDefault()) { + _this->_internal_set_hmac_shared_key_file(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000010U)) { ABSL_DCHECK(from._impl_.failure_jitter_min_ != nullptr); if (_this->_impl_.failure_jitter_min_ == nullptr) { _this->_impl_.failure_jitter_min_ = Super_::CopyConstruct(arena, *from._impl_.failure_jitter_min_); @@ -7920,7 +8259,7 @@ void ListenerAuth::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.failure_jitter_min_->MergeFrom(*from._impl_.failure_jitter_min_); } } - if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (CheckHasBit(cached_has_bits, 0x00000020U)) { ABSL_DCHECK(from._impl_.failure_jitter_max_ != nullptr); if (_this->_impl_.failure_jitter_max_ == nullptr) { _this->_impl_.failure_jitter_max_ = Super_::CopyConstruct(arena, *from._impl_.failure_jitter_max_); @@ -7928,12 +8267,12 @@ void ListenerAuth::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.failure_jitter_max_->MergeFrom(*from._impl_.failure_jitter_max_); } } - if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (from._internal_mode() != 0) { _this->_impl_.mode_ = from._impl_.mode_; } } - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { _this->_impl_.signed_token_skew_minutes_ = from._impl_.signed_token_skew_minutes_; } } @@ -7958,6 +8297,8 @@ void ListenerAuth::InternalSwap(ListenerAuth* PROTOBUF_RESTRICT PROTOBUF_NONNULL swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.raw_token_, &other->_impl_.raw_token_, arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.hmac_shared_key_, &other->_impl_.hmac_shared_key_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.raw_token_file_, &other->_impl_.raw_token_file_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.hmac_shared_key_file_, &other->_impl_.hmac_shared_key_file_, arena); ::google::protobuf::internal::memswap< PROTOBUF_FIELD_OFFSET(ListenerAuth, _impl_.signed_token_skew_minutes_) + sizeof(ListenerAuth::_impl_.signed_token_skew_minutes_) @@ -7971,6 +8312,353 @@ ::google::protobuf::Metadata ListenerAuth::GetMetadata() const { } // =================================================================== +Listener::Listener(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : Super_(arena, Listener_get_class_data()) { +#else // PROTOBUF_CUSTOM_VTABLE + : Super_(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:xtcp_config.v1.Listener) +} +PROTOBUF_NDEBUG_INLINE Listener::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::xtcp_config::v1::Listener& from_msg) + : _has_bits_{from._has_bits_}, + serves_ { + visibility, ::_pbi::InternalMetadataOffset::Build< + ::xtcp_config::v1::Listener, + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::Listener, _impl_.serves_)>() + , arena, from.serves_ + } + , + name_(arena, from.name_) {} + +Listener::Listener( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const Listener& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : Super_(arena, Listener_get_class_data()) { + +#else // PROTOBUF_CUSTOM_VTABLE + : Super_(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + Listener* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.endpoint_ = (CheckHasBit(cached_has_bits, 0x00000004U)) + ? Super_::CopyConstruct(arena, *from._impl_.endpoint_) + : nullptr; + _impl_.auth_ = (CheckHasBit(cached_has_bits, 0x00000008U)) + ? Super_::CopyConstruct(arena, *from._impl_.auth_) + : nullptr; + _impl_.admin_auth_ = (CheckHasBit(cached_has_bits, 0x00000010U)) + ? Super_::CopyConstruct(arena, *from._impl_.admin_auth_) + : nullptr; + + // @@protoc_insertion_point(copy_constructor:xtcp_config.v1.Listener) +} +PROTOBUF_NDEBUG_INLINE Listener::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : serves_ { visibility, ::_pbi::InternalMetadataOffset::Build< + ::xtcp_config::v1::Listener, + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::Listener, _impl_.serves_)>() + } + , + name_(arena) {} + +inline void Listener::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, endpoint_), + 0, + offsetof(Impl_, admin_auth_) - + offsetof(Impl_, endpoint_) + + sizeof(Impl_::admin_auth_)); +} +Listener::~Listener() { + // @@protoc_insertion_point(destructor:xtcp_config.v1.Listener) + SharedDtor(*this); +} +inline void Listener::SharedDtor(MessageLite& self) { + Listener& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.name_.Destroy(); + delete this_._impl_.endpoint_; + delete this_._impl_.auth_; + delete this_._impl_.admin_auth_; + this_._impl_.~Impl_(); +} + +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Listener_class_data_ = + Listener::InternalGenerateClassData_(Listener_globals_._default); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Listener::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Listener_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(Listener_class_data_.tc_table); + return Listener_class_data_.base(); +} +#else +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Listener::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Listener_globals_); + ::google::protobuf::internal::PrefetchToLocalCache( + ::google::protobuf::internal::MessageGlobalsBase::ToParseTableBase(&Listener_globals_)); + return Listener_globals_.GetClassData(); +} +#endif // !PROTOBUF_MESSAGE_GLOBALS +#ifndef PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_CONSTINIT +PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const Listener::ParseTableT_ + Listener::_table_ = + Listener::InternalGenerateParseTable_(Listener_class_data_.base()); +#endif // !PROTOBUF_MESSAGE_GLOBALS +PROTOBUF_NOINLINE void Listener::Clear() { + auto& this_ [[maybe_unused]] = *this; + // @@protoc_insertion_point(message_clear_start:xtcp_config.v1.Listener) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits [[maybe_unused]] = 0; + + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000001fU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.serves_.Clear(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + this_._impl_.name_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + ABSL_DCHECK(this_._impl_.endpoint_ != nullptr); + this_._impl_.endpoint_->Clear(); + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + ABSL_DCHECK(this_._impl_.auth_ != nullptr); + this_._impl_.auth_->Clear(); + } + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + ABSL_DCHECK(this_._impl_.admin_auth_ != nullptr); + this_._impl_.admin_auth_->Clear(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL Listener::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const Listener& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL Listener::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const Listener& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:xtcp_config.v1.Listener) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string name = 1 [json_name = "name", (.buf.validate.field) = { + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_name().empty()) { + const ::std::string& _s = this_._internal_name(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "xtcp_config.v1.Listener.name"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // .xtcp_config.v1.ListenerEndpoint endpoint = 2 [json_name = "endpoint", (.buf.validate.field) = { + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 2, *this_._impl_.endpoint_, this_._impl_.endpoint_->GetCachedSize(), target, + stream); + } + + // .xtcp_config.v1.ListenerAuth auth = 3 [json_name = "auth"]; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 3, *this_._impl_.auth_, this_._impl_.auth_->GetCachedSize(), target, + stream); + } + + // .xtcp_config.v1.ListenerAuth admin_auth = 4 [json_name = "adminAuth"]; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 4, *this_._impl_.admin_auth_, this_._impl_.admin_auth_->GetCachedSize(), target, + stream); + } + + // repeated .xtcp_config.v1.EndpointClass serves = 5 [json_name = "serves", (.buf.validate.field) = { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + { + ::size_t byte_size = this_._impl_._serves_cached_byte_size_.Get(); + if (byte_size > 0) { + target = stream->WriteEnumPacked( + 5, this_._internal_serves(), byte_size, target); + } + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:xtcp_config.v1.Listener) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t Listener::ByteSizeLong(const MessageLite& base) { + const Listener& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t Listener::ByteSizeLong() const { + const Listener& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:xtcp_config.v1.Listener) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits [[maybe_unused]] = 0; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000001fU)) { + // repeated .xtcp_config.v1.EndpointClass serves = 5 [json_name = "serves", (.buf.validate.field) = { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + total_size += ::_pbi::WireFormatLite::EnumSizeWithPackedTagSize( + this_._internal_serves(), 1, this_._impl_._serves_cached_byte_size_); + } + // string name = 1 [json_name = "name", (.buf.validate.field) = { + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_name().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_name()); + } + } + // .xtcp_config.v1.ListenerEndpoint endpoint = 2 [json_name = "endpoint", (.buf.validate.field) = { + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.endpoint_); + } + // .xtcp_config.v1.ListenerAuth auth = 3 [json_name = "auth"]; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.auth_); + } + // .xtcp_config.v1.ListenerAuth admin_auth = 4 [json_name = "adminAuth"]; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.admin_auth_); + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void Listener::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:xtcp_config.v1.Listener) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000001fU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _this->_internal_mutable_serves()->MergeFrom(from._internal_serves()); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_name().empty()) { + _this->_internal_set_name(from._internal_name()); + } else { + if (_this->_impl_.name_.IsDefault()) { + _this->_internal_set_name(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + ABSL_DCHECK(from._impl_.endpoint_ != nullptr); + if (_this->_impl_.endpoint_ == nullptr) { + _this->_impl_.endpoint_ = Super_::CopyConstruct(arena, *from._impl_.endpoint_); + } else { + _this->_impl_.endpoint_->MergeFrom(*from._impl_.endpoint_); + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + ABSL_DCHECK(from._impl_.auth_ != nullptr); + if (_this->_impl_.auth_ == nullptr) { + _this->_impl_.auth_ = Super_::CopyConstruct(arena, *from._impl_.auth_); + } else { + _this->_impl_.auth_->MergeFrom(*from._impl_.auth_); + } + } + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + ABSL_DCHECK(from._impl_.admin_auth_ != nullptr); + if (_this->_impl_.admin_auth_ == nullptr) { + _this->_impl_.admin_auth_ = Super_::CopyConstruct(arena, *from._impl_.admin_auth_); + } else { + _this->_impl_.admin_auth_->MergeFrom(*from._impl_.admin_auth_); + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void Listener::CopyFrom(const Listener& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:xtcp_config.v1.Listener) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void Listener::InternalSwap(Listener* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.serves_.InternalSwap(&other->_impl_.serves_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.name_, &other->_impl_.name_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(Listener, _impl_.admin_auth_) + + sizeof(Listener::_impl_.admin_auth_) + - PROTOBUF_FIELD_OFFSET(Listener, _impl_.endpoint_)>( + reinterpret_cast(&_impl_.endpoint_), + reinterpret_cast(&other->_impl_.endpoint_)); +} + +::google::protobuf::Metadata Listener::GetMetadata() const { + return Super_::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + void LinkMonitorConfig::clear_settle() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.settle_ != nullptr) _impl_.settle_->Clear(); @@ -9038,32 +9726,32 @@ void XtcpConfig::clear_poll_timeout() { void XtcpConfig::clear_reconcile_frequency() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.reconcile_frequency_ != nullptr) _impl_.reconcile_frequency_->Clear(); - ClearHasBit(_impl_._has_bits_[1], 0x00008000U); + ClearHasBit(_impl_._has_bits_[1], 0x00010000U); } void XtcpConfig::clear_kafka_produce_timeout() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.kafka_produce_timeout_ != nullptr) _impl_.kafka_produce_timeout_->Clear(); - ClearHasBit(_impl_._has_bits_[1], 0x00010000U); + ClearHasBit(_impl_._has_bits_[1], 0x00020000U); } void XtcpConfig::clear_s3_flush_interval() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.s3_flush_interval_ != nullptr) _impl_.s3_flush_interval_->Clear(); - ClearHasBit(_impl_._has_bits_[1], 0x00020000U); + ClearHasBit(_impl_._has_bits_[1], 0x00040000U); } void XtcpConfig::clear_s3_upload_backoff_cap() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.s3_upload_backoff_cap_ != nullptr) _impl_.s3_upload_backoff_cap_->Clear(); - ClearHasBit(_impl_._has_bits_[1], 0x00040000U); + ClearHasBit(_impl_._has_bits_[1], 0x00080000U); } void XtcpConfig::clear_asn_refresh_interval() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.asn_refresh_interval_ != nullptr) _impl_.asn_refresh_interval_->Clear(); - ClearHasBit(_impl_._has_bits_[1], 0x00800000U); + ClearHasBit(_impl_._has_bits_[1], 0x01000000U); } void XtcpConfig::clear_locality_refresh_interval() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.locality_refresh_interval_ != nullptr) _impl_.locality_refresh_interval_->Clear(); - ClearHasBit(_impl_._has_bits_[1], 0x01000000U); + ClearHasBit(_impl_._has_bits_[1], 0x02000000U); } XtcpConfig::XtcpConfig(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) #if defined(PROTOBUF_CUSTOM_VTABLE) @@ -9083,6 +9771,13 @@ PROTOBUF_NDEBUG_INLINE XtcpConfig::Impl_::Impl_( marshal_to_(arena, from.marshal_to_), csv_columns_(arena, from.csv_columns_), xtcp_proto_file_(arena, from.xtcp_proto_file_), + listeners_ { + visibility, ::_pbi::InternalMetadataOffset::Build< + ::xtcp_config::v1::XtcpConfig, + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.listeners_)>() + , arena, from.listeners_ + } + , uplink_interfaces_ { visibility, ::_pbi::InternalMetadataOffset::Build< ::xtcp_config::v1::XtcpConfig, @@ -9147,37 +9842,37 @@ XtcpConfig::XtcpConfig( offsetof(Impl_, nl_timeout_milliseconds_) + sizeof(Impl_::s3_allow_insecure_)); cached_has_bits = _impl_._has_bits_[1]; - _impl_.reconcile_frequency_ = (CheckHasBit(cached_has_bits, 0x00008000U)) + _impl_.reconcile_frequency_ = (CheckHasBit(cached_has_bits, 0x00010000U)) ? Super_::CopyConstruct(arena, *from._impl_.reconcile_frequency_) : nullptr; - _impl_.kafka_produce_timeout_ = (CheckHasBit(cached_has_bits, 0x00010000U)) + _impl_.kafka_produce_timeout_ = (CheckHasBit(cached_has_bits, 0x00020000U)) ? Super_::CopyConstruct(arena, *from._impl_.kafka_produce_timeout_) : nullptr; - _impl_.s3_flush_interval_ = (CheckHasBit(cached_has_bits, 0x00020000U)) + _impl_.s3_flush_interval_ = (CheckHasBit(cached_has_bits, 0x00040000U)) ? Super_::CopyConstruct(arena, *from._impl_.s3_flush_interval_) : nullptr; - _impl_.s3_upload_backoff_cap_ = (CheckHasBit(cached_has_bits, 0x00040000U)) + _impl_.s3_upload_backoff_cap_ = (CheckHasBit(cached_has_bits, 0x00080000U)) ? Super_::CopyConstruct(arena, *from._impl_.s3_upload_backoff_cap_) : nullptr; - _impl_.listener_auth_ = (CheckHasBit(cached_has_bits, 0x00080000U)) + _impl_.listener_auth_ = (CheckHasBit(cached_has_bits, 0x00100000U)) ? Super_::CopyConstruct(arena, *from._impl_.listener_auth_) : nullptr; - _impl_.prometheus_listener_ = (CheckHasBit(cached_has_bits, 0x00100000U)) + _impl_.prometheus_listener_ = (CheckHasBit(cached_has_bits, 0x00200000U)) ? Super_::CopyConstruct(arena, *from._impl_.prometheus_listener_) : nullptr; - _impl_.admin_listener_auth_ = (CheckHasBit(cached_has_bits, 0x00200000U)) + _impl_.admin_listener_auth_ = (CheckHasBit(cached_has_bits, 0x00400000U)) ? Super_::CopyConstruct(arena, *from._impl_.admin_listener_auth_) : nullptr; - _impl_.grpc_listener_ = (CheckHasBit(cached_has_bits, 0x00400000U)) + _impl_.grpc_listener_ = (CheckHasBit(cached_has_bits, 0x00800000U)) ? Super_::CopyConstruct(arena, *from._impl_.grpc_listener_) : nullptr; - _impl_.asn_refresh_interval_ = (CheckHasBit(cached_has_bits, 0x00800000U)) + _impl_.asn_refresh_interval_ = (CheckHasBit(cached_has_bits, 0x01000000U)) ? Super_::CopyConstruct(arena, *from._impl_.asn_refresh_interval_) : nullptr; - _impl_.locality_refresh_interval_ = (CheckHasBit(cached_has_bits, 0x01000000U)) + _impl_.locality_refresh_interval_ = (CheckHasBit(cached_has_bits, 0x02000000U)) ? Super_::CopyConstruct(arena, *from._impl_.locality_refresh_interval_) : nullptr; - _impl_.link_monitor_ = (CheckHasBit(cached_has_bits, 0x02000000U)) + _impl_.link_monitor_ = (CheckHasBit(cached_has_bits, 0x04000000U)) ? Super_::CopyConstruct(arena, *from._impl_.link_monitor_) : nullptr; ::memcpy(reinterpret_cast(&_impl_) + @@ -9197,6 +9892,11 @@ PROTOBUF_NDEBUG_INLINE XtcpConfig::Impl_::Impl_( marshal_to_(arena), csv_columns_(arena), xtcp_proto_file_(arena), + listeners_ { visibility, ::_pbi::InternalMetadataOffset::Build< + ::xtcp_config::v1::XtcpConfig, + PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.listeners_)>() + } + , uplink_interfaces_ { visibility, ::_pbi::InternalMetadataOffset::Build< ::xtcp_config::v1::XtcpConfig, PROTOBUF_FIELD_OFFSET(::xtcp_config::v1::XtcpConfig, _impl_.uplink_interfaces_)>() @@ -9372,163 +10072,166 @@ PROTOBUF_NOINLINE void XtcpConfig::Clear() { reinterpret_cast(&this_._impl_.io_uring_recv_batch_size_)) + sizeof(_impl_.s3_allow_insecure_)); if (CheckHasBit(cached_has_bits, 0x00400000U)) { - _impl_.uplink_interfaces_.Clear(); + _impl_.listeners_.Clear(); } if (CheckHasBit(cached_has_bits, 0x00800000U)) { - this_._impl_.capture_path_.ClearNonDefaultToEmpty(); + _impl_.uplink_interfaces_.Clear(); } } if (BatchCheckHasBit(cached_has_bits, 0xff000000U)) { if (CheckHasBit(cached_has_bits, 0x01000000U)) { - this_._impl_.topic_.ClearNonDefaultToEmpty(); + this_._impl_.capture_path_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x02000000U)) { - this_._impl_.kafka_schema_url_.ClearNonDefaultToEmpty(); + this_._impl_.topic_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x04000000U)) { - this_._impl_.kafka_compression_.ClearNonDefaultToEmpty(); + this_._impl_.kafka_schema_url_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x08000000U)) { - this_._impl_.s3_endpoint_.ClearNonDefaultToEmpty(); + this_._impl_.kafka_compression_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x10000000U)) { - this_._impl_.s3_region_.ClearNonDefaultToEmpty(); + this_._impl_.s3_endpoint_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x20000000U)) { - this_._impl_.s3_bucket_.ClearNonDefaultToEmpty(); + this_._impl_.s3_region_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x40000000U)) { - this_._impl_.s3_prefix_.ClearNonDefaultToEmpty(); + this_._impl_.s3_bucket_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x80000000U)) { - this_._impl_.s3_access_key_.ClearNonDefaultToEmpty(); + this_._impl_.s3_prefix_.ClearNonDefaultToEmpty(); } } cached_has_bits = this_._impl_._has_bits_[1]; if (BatchCheckHasBit(cached_has_bits, 0x000000ffU)) { if (CheckHasBit(cached_has_bits, 0x00000001U)) { - this_._impl_.s3_secret_key_.ClearNonDefaultToEmpty(); + this_._impl_.s3_access_key_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000002U)) { - this_._impl_.s3_ca_file_.ClearNonDefaultToEmpty(); + this_._impl_.s3_secret_key_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000004U)) { - this_._impl_.hostname_.ClearNonDefaultToEmpty(); + this_._impl_.s3_ca_file_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000008U)) { - this_._impl_.location_.ClearNonDefaultToEmpty(); + this_._impl_.hostname_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000010U)) { - this_._impl_.label_.ClearNonDefaultToEmpty(); + this_._impl_.location_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000020U)) { - this_._impl_.tag_.ClearNonDefaultToEmpty(); + this_._impl_.label_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000040U)) { - this_._impl_.daemon_version_.ClearNonDefaultToEmpty(); + this_._impl_.tag_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000080U)) { - this_._impl_.pyroscope_url_.ClearNonDefaultToEmpty(); + this_._impl_.daemon_version_.ClearNonDefaultToEmpty(); } } if (BatchCheckHasBit(cached_has_bits, 0x0000ff00U)) { if (CheckHasBit(cached_has_bits, 0x00000100U)) { - this_._impl_.pyroscope_app_name_.ClearNonDefaultToEmpty(); + this_._impl_.pyroscope_url_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000200U)) { - this_._impl_.docker_socket_path_.ClearNonDefaultToEmpty(); + this_._impl_.pyroscope_app_name_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000400U)) { - this_._impl_.lldpd_socket_path_.ClearNonDefaultToEmpty(); + this_._impl_.docker_socket_path_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000800U)) { - this_._impl_.lldpd_version_hint_.ClearNonDefaultToEmpty(); + this_._impl_.lldpd_socket_path_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00001000U)) { - this_._impl_.asn_db_path_.ClearNonDefaultToEmpty(); + this_._impl_.lldpd_version_hint_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00002000U)) { - this_._impl_.ipmeta_bootstrap_path_.ClearNonDefaultToEmpty(); + this_._impl_.asn_db_path_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00004000U)) { - this_._impl_.ipmeta_cache_path_.ClearNonDefaultToEmpty(); + this_._impl_.ipmeta_bootstrap_path_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00008000U)) { - ABSL_DCHECK(this_._impl_.reconcile_frequency_ != nullptr); - this_._impl_.reconcile_frequency_->Clear(); + this_._impl_.ipmeta_cache_path_.ClearNonDefaultToEmpty(); } } if (BatchCheckHasBit(cached_has_bits, 0x00ff0000U)) { if (CheckHasBit(cached_has_bits, 0x00010000U)) { + ABSL_DCHECK(this_._impl_.reconcile_frequency_ != nullptr); + this_._impl_.reconcile_frequency_->Clear(); + } + if (CheckHasBit(cached_has_bits, 0x00020000U)) { ABSL_DCHECK(this_._impl_.kafka_produce_timeout_ != nullptr); this_._impl_.kafka_produce_timeout_->Clear(); } - if (CheckHasBit(cached_has_bits, 0x00020000U)) { + if (CheckHasBit(cached_has_bits, 0x00040000U)) { ABSL_DCHECK(this_._impl_.s3_flush_interval_ != nullptr); this_._impl_.s3_flush_interval_->Clear(); } - if (CheckHasBit(cached_has_bits, 0x00040000U)) { + if (CheckHasBit(cached_has_bits, 0x00080000U)) { ABSL_DCHECK(this_._impl_.s3_upload_backoff_cap_ != nullptr); this_._impl_.s3_upload_backoff_cap_->Clear(); } - if (CheckHasBit(cached_has_bits, 0x00080000U)) { + if (CheckHasBit(cached_has_bits, 0x00100000U)) { ABSL_DCHECK(this_._impl_.listener_auth_ != nullptr); this_._impl_.listener_auth_->Clear(); } - if (CheckHasBit(cached_has_bits, 0x00100000U)) { + if (CheckHasBit(cached_has_bits, 0x00200000U)) { ABSL_DCHECK(this_._impl_.prometheus_listener_ != nullptr); this_._impl_.prometheus_listener_->Clear(); } - if (CheckHasBit(cached_has_bits, 0x00200000U)) { + if (CheckHasBit(cached_has_bits, 0x00400000U)) { ABSL_DCHECK(this_._impl_.admin_listener_auth_ != nullptr); this_._impl_.admin_listener_auth_->Clear(); } - if (CheckHasBit(cached_has_bits, 0x00400000U)) { + if (CheckHasBit(cached_has_bits, 0x00800000U)) { ABSL_DCHECK(this_._impl_.grpc_listener_ != nullptr); this_._impl_.grpc_listener_->Clear(); } - if (CheckHasBit(cached_has_bits, 0x00800000U)) { + } + if (BatchCheckHasBit(cached_has_bits, 0x07000000U)) { + if (CheckHasBit(cached_has_bits, 0x01000000U)) { ABSL_DCHECK(this_._impl_.asn_refresh_interval_ != nullptr); this_._impl_.asn_refresh_interval_->Clear(); } - } - if (BatchCheckHasBit(cached_has_bits, 0x03000000U)) { - if (CheckHasBit(cached_has_bits, 0x01000000U)) { + if (CheckHasBit(cached_has_bits, 0x02000000U)) { ABSL_DCHECK(this_._impl_.locality_refresh_interval_ != nullptr); this_._impl_.locality_refresh_interval_->Clear(); } - if (CheckHasBit(cached_has_bits, 0x02000000U)) { + if (CheckHasBit(cached_has_bits, 0x04000000U)) { ABSL_DCHECK(this_._impl_.link_monitor_ != nullptr); this_._impl_.link_monitor_->Clear(); } } - if (BatchCheckHasBit(cached_has_bits, 0xfc000000U)) { + if (BatchCheckHasBit(cached_has_bits, 0xf8000000U)) { ::memset(&this_._impl_.write_files_, 0, static_cast<::size_t>( - reinterpret_cast(&this_._impl_.s3_parquet_flush_threshold_bytes_) - + reinterpret_cast(&this_._impl_.envelope_flush_threshold_rows_) - reinterpret_cast(&this_._impl_.write_files_)) + - sizeof(_impl_.s3_parquet_flush_threshold_bytes_)); + sizeof(_impl_.envelope_flush_threshold_rows_)); } cached_has_bits = this_._impl_._has_bits_[2]; if (BatchCheckHasBit(cached_has_bits, 0x000000ffU)) { - ::memset(&this_._impl_.s3_flush_jitter_pct_, 0, + ::memset(&this_._impl_.s3_parquet_flush_threshold_bytes_, 0, static_cast<::size_t>( - reinterpret_cast(&this_._impl_.resolve_container_id_) - - reinterpret_cast(&this_._impl_.s3_flush_jitter_pct_)) + - sizeof(_impl_.resolve_container_id_)); + reinterpret_cast(&this_._impl_.debug_prometheus_) - + reinterpret_cast(&this_._impl_.s3_parquet_flush_threshold_bytes_)) + + sizeof(_impl_.debug_prometheus_)); } if (BatchCheckHasBit(cached_has_bits, 0x0000ff00U)) { - ::memset(&this_._impl_.enrich_container_enable_, 0, + ::memset(&this_._impl_.resolve_container_id_, 0, static_cast<::size_t>( - reinterpret_cast(&this_._impl_.enrich_asn_enable_) - - reinterpret_cast(&this_._impl_.enrich_container_enable_)) + - sizeof(_impl_.enrich_asn_enable_)); + reinterpret_cast(&this_._impl_.populate_nsid_) - + reinterpret_cast(&this_._impl_.resolve_container_id_)) + + sizeof(_impl_.populate_nsid_)); } - if (BatchCheckHasBit(cached_has_bits, 0x00030000U)) { - ::memset(&this_._impl_.enrich_locality_enable_, 0, + if (BatchCheckHasBit(cached_has_bits, 0x00070000U)) { + ::memset(&this_._impl_.enrich_asn_enable_, 0, static_cast<::size_t>( reinterpret_cast(&this_._impl_.locality_events_enable_) - - reinterpret_cast(&this_._impl_.enrich_locality_enable_)) + + reinterpret_cast(&this_._impl_.enrich_asn_enable_)) + sizeof(_impl_.locality_events_enable_)); } _impl_._has_bits_.Clear(); @@ -9685,7 +10388,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // .google.protobuf.Duration reconcile_frequency = 40 [json_name = "reconcileFrequency", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00008000U)) { + if (CheckHasBit(cached_has_bits, 0x00010000U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 40, *this_._impl_.reconcile_frequency_, this_._impl_.reconcile_frequency_->GetCachedSize(), target, stream); @@ -9703,7 +10406,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // uint32 write_files = 50 [json_name = "writeFiles", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x04000000U)) { + if (CheckHasBit(cached_has_bits, 0x08000000U)) { if (this_._internal_write_files() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -9713,7 +10416,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[0]; // string capture_path = 51 [json_name = "capturePath", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00800000U)) { + if (CheckHasBit(cached_has_bits, 0x01000000U)) { if (!this_._internal_capture_path().empty()) { const ::std::string& _s = this_._internal_capture_path(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -9724,7 +10427,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // uint32 dest_write_files = 52 [json_name = "destWriteFiles", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x08000000U)) { + if (CheckHasBit(cached_has_bits, 0x10000000U)) { if (this_._internal_dest_write_files() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -9733,7 +10436,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // uint32 debug_level = 53 [json_name = "debugLevel", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x10000000U)) { + if (CheckHasBit(cached_has_bits, 0x20000000U)) { if (this_._internal_debug_level() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -9743,7 +10446,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[2]; // bool debug_prometheus = 54 [json_name = "debugPrometheus", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000040U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { if (this_._internal_debug_prometheus() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( @@ -9794,7 +10497,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // uint32 envelope_flush_threshold_bytes = 64 [json_name = "envelopeFlushThresholdBytes", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x20000000U)) { + if (CheckHasBit(cached_has_bits, 0x40000000U)) { if (this_._internal_envelope_flush_threshold_bytes() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -9803,7 +10506,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // uint32 envelope_flush_threshold_rows = 65 [json_name = "envelopeFlushThresholdRows", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x40000000U)) { + if (CheckHasBit(cached_has_bits, 0x80000000U)) { if (this_._internal_envelope_flush_threshold_rows() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -9813,7 +10516,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[0]; // string topic = 80 [json_name = "topic", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x01000000U)) { + if (CheckHasBit(cached_has_bits, 0x02000000U)) { if (!this_._internal_topic().empty()) { const ::std::string& _s = this_._internal_topic(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -9823,7 +10526,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // string kafka_schema_url = 81 [json_name = "kafkaSchemaUrl", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x02000000U)) { + if (CheckHasBit(cached_has_bits, 0x04000000U)) { if (!this_._internal_kafka_schema_url().empty()) { const ::std::string& _s = this_._internal_kafka_schema_url(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -9834,7 +10537,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // .google.protobuf.Duration kafka_produce_timeout = 82 [json_name = "kafkaProduceTimeout", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00010000U)) { + if (CheckHasBit(cached_has_bits, 0x00020000U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 82, *this_._impl_.kafka_produce_timeout_, this_._impl_.kafka_produce_timeout_->GetCachedSize(), target, stream); @@ -9842,7 +10545,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[0]; // string kafka_compression = 83 [json_name = "kafkaCompression", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x04000000U)) { + if (CheckHasBit(cached_has_bits, 0x08000000U)) { if (!this_._internal_kafka_compression().empty()) { const ::std::string& _s = this_._internal_kafka_compression(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -9852,7 +10555,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // string s3_endpoint = 100 [json_name = "s3Endpoint", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x08000000U)) { + if (CheckHasBit(cached_has_bits, 0x10000000U)) { if (!this_._internal_s3_endpoint().empty()) { const ::std::string& _s = this_._internal_s3_endpoint(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -9862,7 +10565,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // string s3_region = 101 [json_name = "s3Region", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x10000000U)) { + if (CheckHasBit(cached_has_bits, 0x20000000U)) { if (!this_._internal_s3_region().empty()) { const ::std::string& _s = this_._internal_s3_region(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -9872,7 +10575,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // string s3_bucket = 102 [json_name = "s3Bucket", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x20000000U)) { + if (CheckHasBit(cached_has_bits, 0x40000000U)) { if (!this_._internal_s3_bucket().empty()) { const ::std::string& _s = this_._internal_s3_bucket(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -9882,7 +10585,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // string s3_prefix = 103 [json_name = "s3Prefix", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x40000000U)) { + if (CheckHasBit(cached_has_bits, 0x80000000U)) { if (!this_._internal_s3_prefix().empty()) { const ::std::string& _s = this_._internal_s3_prefix(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -9891,8 +10594,9 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } } + cached_has_bits = this_._impl_._has_bits_[1]; // string s3_access_key = 104 [json_name = "s3AccessKey", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x80000000U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { if (!this_._internal_s3_access_key().empty()) { const ::std::string& _s = this_._internal_s3_access_key(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -9901,9 +10605,8 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } } - cached_has_bits = this_._impl_._has_bits_[1]; // string s3_secret_key = 105 [json_name = "s3SecretKey", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (CheckHasBit(cached_has_bits, 0x00000002U)) { if (!this_._internal_s3_secret_key().empty()) { const ::std::string& _s = this_._internal_s3_secret_key(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -9933,7 +10636,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // string s3_ca_file = 108 [json_name = "s3CaFile", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (CheckHasBit(cached_has_bits, 0x00000004U)) { if (!this_._internal_s3_ca_file().empty()) { const ::std::string& _s = this_._internal_s3_ca_file(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -9942,8 +10645,9 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } } + cached_has_bits = this_._impl_._has_bits_[2]; // uint32 s3_parquet_flush_threshold_bytes = 110 [json_name = "s3ParquetFlushThresholdBytes", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x80000000U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { if (this_._internal_s3_parquet_flush_threshold_bytes() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -9951,8 +10655,9 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } } + cached_has_bits = this_._impl_._has_bits_[1]; // .google.protobuf.Duration s3_flush_interval = 111 [json_name = "s3FlushInterval", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00020000U)) { + if (CheckHasBit(cached_has_bits, 0x00040000U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 111, *this_._impl_.s3_flush_interval_, this_._impl_.s3_flush_interval_->GetCachedSize(), target, stream); @@ -9960,7 +10665,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[2]; // uint32 s3_flush_jitter_pct = 112 [json_name = "s3FlushJitterPct", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (CheckHasBit(cached_has_bits, 0x00000002U)) { if (this_._internal_s3_flush_jitter_pct() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -9969,7 +10674,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // uint32 s3_flush_threshold_jitter_pct = 113 [json_name = "s3FlushThresholdJitterPct", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (CheckHasBit(cached_has_bits, 0x00000004U)) { if (this_._internal_s3_flush_threshold_jitter_pct() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -9978,7 +10683,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // uint32 s3_upload_max_attempts = 114 [json_name = "s3UploadMaxAttempts", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (CheckHasBit(cached_has_bits, 0x00000008U)) { if (this_._internal_s3_upload_max_attempts() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -9988,14 +10693,14 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // .google.protobuf.Duration s3_upload_backoff_cap = 115 [json_name = "s3UploadBackoffCap", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00040000U)) { + if (CheckHasBit(cached_has_bits, 0x00080000U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 115, *this_._impl_.s3_upload_backoff_cap_, this_._impl_.s3_upload_backoff_cap_->GetCachedSize(), target, stream); } // string hostname = 130 [json_name = "hostname", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (CheckHasBit(cached_has_bits, 0x00000008U)) { if (!this_._internal_hostname().empty()) { const ::std::string& _s = this_._internal_hostname(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10005,7 +10710,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // string location = 131 [json_name = "location", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (CheckHasBit(cached_has_bits, 0x00000010U)) { if (!this_._internal_location().empty()) { const ::std::string& _s = this_._internal_location(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10015,7 +10720,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // string label = 132 [json_name = "label", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (CheckHasBit(cached_has_bits, 0x00000020U)) { if (!this_._internal_label().empty()) { const ::std::string& _s = this_._internal_label(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10025,7 +10730,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // string tag = 133 [json_name = "tag", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (!this_._internal_tag().empty()) { const ::std::string& _s = this_._internal_tag(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10035,7 +10740,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // string daemon_version = 134 [json_name = "daemonVersion", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000040U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { if (!this_._internal_daemon_version().empty()) { const ::std::string& _s = this_._internal_daemon_version(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10046,7 +10751,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[2]; // uint32 ipv4_ttl = 150 [json_name = "ipv4Ttl", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (CheckHasBit(cached_has_bits, 0x00000010U)) { if (this_._internal_ipv4_ttl() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -10055,7 +10760,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // uint32 ipv6_hop_limit = 151 [json_name = "ipv6HopLimit", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (CheckHasBit(cached_has_bits, 0x00000020U)) { if (this_._internal_ipv6_hop_limit() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -10065,21 +10770,21 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // .xtcp_config.v1.ListenerAuth listener_auth = 152 [json_name = "listenerAuth", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00080000U)) { + if (CheckHasBit(cached_has_bits, 0x00100000U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 152, *this_._impl_.listener_auth_, this_._impl_.listener_auth_->GetCachedSize(), target, stream); } // .xtcp_config.v1.ListenerEndpoint prometheus_listener = 153 [json_name = "prometheusListener", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00100000U)) { + if (CheckHasBit(cached_has_bits, 0x00200000U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 153, *this_._impl_.prometheus_listener_, this_._impl_.prometheus_listener_->GetCachedSize(), target, stream); } // .xtcp_config.v1.ListenerAuth admin_listener_auth = 154 [json_name = "adminListenerAuth", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00200000U)) { + if (CheckHasBit(cached_has_bits, 0x00400000U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 154, *this_._impl_.admin_listener_auth_, this_._impl_.admin_listener_auth_->GetCachedSize(), target, stream); @@ -10087,7 +10792,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[2]; // uint32 grpc_port = 160 [json_name = "grpcPort", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (this_._internal_grpc_port() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -10097,14 +10802,28 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // .xtcp_config.v1.ListenerEndpoint grpc_listener = 161 [json_name = "grpcListener", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00400000U)) { + if (CheckHasBit(cached_has_bits, 0x00800000U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 161, *this_._impl_.grpc_listener_, this_._impl_.grpc_listener_->GetCachedSize(), target, stream); } + cached_has_bits = this_._impl_._has_bits_[0]; + // repeated .xtcp_config.v1.Listener listeners = 162 [json_name = "listeners", (.buf.validate.field) = { + if (CheckHasBit(cached_has_bits, 0x00400000U)) { + for (unsigned i = 0, n = static_cast( + this_._internal_listeners_size()); + i < n; i++) { + const auto& repfield = this_._internal_listeners().Get(i); + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 162, repfield, repfield.GetCachedSize(), target, + stream); + } + } + + cached_has_bits = this_._impl_._has_bits_[1]; // string pyroscope_url = 170 [json_name = "pyroscopeUrl", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000080U)) { + if (CheckHasBit(cached_has_bits, 0x00000100U)) { if (!this_._internal_pyroscope_url().empty()) { const ::std::string& _s = this_._internal_pyroscope_url(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10114,7 +10833,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // string pyroscope_app_name = 171 [json_name = "pyroscopeAppName", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000100U)) { + if (CheckHasBit(cached_has_bits, 0x00000200U)) { if (!this_._internal_pyroscope_app_name().empty()) { const ::std::string& _s = this_._internal_pyroscope_app_name(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10125,7 +10844,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[2]; // uint32 pyroscope_sample_hz = 172 [json_name = "pyroscopeSampleHz", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000400U)) { + if (CheckHasBit(cached_has_bits, 0x00000800U)) { if (this_._internal_pyroscope_sample_hz() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -10134,7 +10853,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // uint32 pyroscope_upload_interval_sec = 173 [json_name = "pyroscopeUploadIntervalSec", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000800U)) { + if (CheckHasBit(cached_has_bits, 0x00001000U)) { if (this_._internal_pyroscope_upload_interval_sec() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -10143,7 +10862,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // bool resolve_container_id = 200 [json_name = "resolveContainerId", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000080U)) { + if (CheckHasBit(cached_has_bits, 0x00000100U)) { if (this_._internal_resolve_container_id() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( @@ -10152,7 +10871,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // bool enrich_container_enable = 201 [json_name = "enrichContainerEnable"]; - if (CheckHasBit(cached_has_bits, 0x00000100U)) { + if (CheckHasBit(cached_has_bits, 0x00000200U)) { if (this_._internal_enrich_container_enable() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( @@ -10162,7 +10881,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // string docker_socket_path = 202 [json_name = "dockerSocketPath", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000200U)) { + if (CheckHasBit(cached_has_bits, 0x00000400U)) { if (!this_._internal_docker_socket_path().empty()) { const ::std::string& _s = this_._internal_docker_socket_path(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10173,7 +10892,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[2]; // bool enrich_lldp_enable = 210 [json_name = "enrichLldpEnable"]; - if (CheckHasBit(cached_has_bits, 0x00000200U)) { + if (CheckHasBit(cached_has_bits, 0x00000400U)) { if (this_._internal_enrich_lldp_enable() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( @@ -10183,7 +10902,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // string lldpd_socket_path = 211 [json_name = "lldpdSocketPath", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000400U)) { + if (CheckHasBit(cached_has_bits, 0x00000800U)) { if (!this_._internal_lldpd_socket_path().empty()) { const ::std::string& _s = this_._internal_lldpd_socket_path(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10193,7 +10912,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // string lldpd_version_hint = 212 [json_name = "lldpdVersionHint", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000800U)) { + if (CheckHasBit(cached_has_bits, 0x00001000U)) { if (!this_._internal_lldpd_version_hint().empty()) { const ::std::string& _s = this_._internal_lldpd_version_hint(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10204,7 +10923,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[2]; // bool enrich_nic_enable = 220 [json_name = "enrichNicEnable"]; - if (CheckHasBit(cached_has_bits, 0x00002000U)) { + if (CheckHasBit(cached_has_bits, 0x00004000U)) { if (this_._internal_enrich_nic_enable() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( @@ -10213,7 +10932,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // uint32 uplink_count = 221 [json_name = "uplinkCount", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00001000U)) { + if (CheckHasBit(cached_has_bits, 0x00002000U)) { if (this_._internal_uplink_count() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteUInt32ToArray( @@ -10223,7 +10942,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[0]; // repeated string uplink_interfaces = 222 [json_name = "uplinkInterfaces", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00400000U)) { + if (CheckHasBit(cached_has_bits, 0x00800000U)) { for (int i = 0, n = this_._internal_uplink_interfaces_size(); i < n; ++i) { const auto& s = this_._internal_uplink_interfaces().Get(i); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10234,7 +10953,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[2]; // bool populate_nsid = 230 [json_name = "populateNsid"]; - if (CheckHasBit(cached_has_bits, 0x00004000U)) { + if (CheckHasBit(cached_has_bits, 0x00008000U)) { if (this_._internal_populate_nsid() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( @@ -10243,7 +10962,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // bool enrich_asn_enable = 240 [json_name = "enrichAsnEnable"]; - if (CheckHasBit(cached_has_bits, 0x00008000U)) { + if (CheckHasBit(cached_has_bits, 0x00010000U)) { if (this_._internal_enrich_asn_enable() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( @@ -10253,7 +10972,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // string asn_db_path = 241 [json_name = "asnDbPath", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00001000U)) { + if (CheckHasBit(cached_has_bits, 0x00002000U)) { if (!this_._internal_asn_db_path().empty()) { const ::std::string& _s = this_._internal_asn_db_path(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10263,14 +10982,14 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // .google.protobuf.Duration asn_refresh_interval = 242 [json_name = "asnRefreshInterval"]; - if (CheckHasBit(cached_has_bits, 0x00800000U)) { + if (CheckHasBit(cached_has_bits, 0x01000000U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 242, *this_._impl_.asn_refresh_interval_, this_._impl_.asn_refresh_interval_->GetCachedSize(), target, stream); } // string ipmeta_bootstrap_path = 243 [json_name = "ipmetaBootstrapPath", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00002000U)) { + if (CheckHasBit(cached_has_bits, 0x00004000U)) { if (!this_._internal_ipmeta_bootstrap_path().empty()) { const ::std::string& _s = this_._internal_ipmeta_bootstrap_path(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10280,7 +10999,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( } // string ipmeta_cache_path = 244 [json_name = "ipmetaCachePath", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00004000U)) { + if (CheckHasBit(cached_has_bits, 0x00008000U)) { if (!this_._internal_ipmeta_cache_path().empty()) { const ::std::string& _s = this_._internal_ipmeta_cache_path(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -10291,7 +11010,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[2]; // bool enrich_locality_enable = 245 [json_name = "enrichLocalityEnable"]; - if (CheckHasBit(cached_has_bits, 0x00010000U)) { + if (CheckHasBit(cached_has_bits, 0x00020000U)) { if (this_._internal_enrich_locality_enable() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( @@ -10301,7 +11020,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // .google.protobuf.Duration locality_refresh_interval = 246 [json_name = "localityRefreshInterval"]; - if (CheckHasBit(cached_has_bits, 0x01000000U)) { + if (CheckHasBit(cached_has_bits, 0x02000000U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 246, *this_._impl_.locality_refresh_interval_, this_._impl_.locality_refresh_interval_->GetCachedSize(), target, stream); @@ -10309,7 +11028,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[2]; // bool locality_events_enable = 247 [json_name = "localityEventsEnable"]; - if (CheckHasBit(cached_has_bits, 0x00020000U)) { + if (CheckHasBit(cached_has_bits, 0x00040000U)) { if (this_._internal_locality_events_enable() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( @@ -10319,7 +11038,7 @@ ::uint8_t* PROTOBUF_NONNULL XtcpConfig::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[1]; // .xtcp_config.v1.LinkMonitorConfig link_monitor = 250 [json_name = "linkMonitor"]; - if (CheckHasBit(cached_has_bits, 0x02000000U)) { + if (CheckHasBit(cached_has_bits, 0x04000000U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 250, *this_._impl_.link_monitor_, this_._impl_.link_monitor_->GetCachedSize(), target, stream); @@ -10497,8 +11216,15 @@ ::size_t XtcpConfig::ByteSizeLong() const { total_size += 3; } } - // repeated string uplink_interfaces = 222 [json_name = "uplinkInterfaces", (.buf.validate.field) = { + // repeated .xtcp_config.v1.Listener listeners = 162 [json_name = "listeners", (.buf.validate.field) = { if (CheckHasBit(cached_has_bits, 0x00400000U)) { + total_size += 2UL * this_._internal_listeners_size(); + for (const auto& msg : this_._internal_listeners()) { + total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } + } + // repeated string uplink_interfaces = 222 [json_name = "uplinkInterfaces", (.buf.validate.field) = { + if (CheckHasBit(cached_has_bits, 0x00800000U)) { total_size += 2 * ::google::protobuf::internal::FromIntSize(this_._internal_uplink_interfaces().size()); for (int i = 0, n = this_._internal_uplink_interfaces().size(); i < n; ++i) { @@ -10506,402 +11232,402 @@ ::size_t XtcpConfig::ByteSizeLong() const { this_._internal_uplink_interfaces().Get(i)); } } + } + if (BatchCheckHasBit(cached_has_bits, 0xff000000U)) { // string capture_path = 51 [json_name = "capturePath", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00800000U)) { + if (CheckHasBit(cached_has_bits, 0x01000000U)) { if (!this_._internal_capture_path().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_capture_path()); } } - } - if (BatchCheckHasBit(cached_has_bits, 0xff000000U)) { // string topic = 80 [json_name = "topic", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x01000000U)) { + if (CheckHasBit(cached_has_bits, 0x02000000U)) { if (!this_._internal_topic().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_topic()); } } // string kafka_schema_url = 81 [json_name = "kafkaSchemaUrl", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x02000000U)) { + if (CheckHasBit(cached_has_bits, 0x04000000U)) { if (!this_._internal_kafka_schema_url().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_kafka_schema_url()); } } // string kafka_compression = 83 [json_name = "kafkaCompression", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x04000000U)) { + if (CheckHasBit(cached_has_bits, 0x08000000U)) { if (!this_._internal_kafka_compression().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_kafka_compression()); } } // string s3_endpoint = 100 [json_name = "s3Endpoint", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x08000000U)) { + if (CheckHasBit(cached_has_bits, 0x10000000U)) { if (!this_._internal_s3_endpoint().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_s3_endpoint()); } } // string s3_region = 101 [json_name = "s3Region", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x10000000U)) { + if (CheckHasBit(cached_has_bits, 0x20000000U)) { if (!this_._internal_s3_region().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_s3_region()); } } // string s3_bucket = 102 [json_name = "s3Bucket", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x20000000U)) { + if (CheckHasBit(cached_has_bits, 0x40000000U)) { if (!this_._internal_s3_bucket().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_s3_bucket()); } } // string s3_prefix = 103 [json_name = "s3Prefix", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x40000000U)) { + if (CheckHasBit(cached_has_bits, 0x80000000U)) { if (!this_._internal_s3_prefix().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_s3_prefix()); } } + } + cached_has_bits = this_._impl_._has_bits_[1]; + if (BatchCheckHasBit(cached_has_bits, 0x000000ffU)) { // string s3_access_key = 104 [json_name = "s3AccessKey", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x80000000U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { if (!this_._internal_s3_access_key().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_s3_access_key()); } } - } - cached_has_bits = this_._impl_._has_bits_[1]; - if (BatchCheckHasBit(cached_has_bits, 0x000000ffU)) { // string s3_secret_key = 105 [json_name = "s3SecretKey", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (CheckHasBit(cached_has_bits, 0x00000002U)) { if (!this_._internal_s3_secret_key().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_s3_secret_key()); } } // string s3_ca_file = 108 [json_name = "s3CaFile", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (CheckHasBit(cached_has_bits, 0x00000004U)) { if (!this_._internal_s3_ca_file().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_s3_ca_file()); } } // string hostname = 130 [json_name = "hostname", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (CheckHasBit(cached_has_bits, 0x00000008U)) { if (!this_._internal_hostname().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_hostname()); } } // string location = 131 [json_name = "location", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (CheckHasBit(cached_has_bits, 0x00000010U)) { if (!this_._internal_location().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_location()); } } // string label = 132 [json_name = "label", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (CheckHasBit(cached_has_bits, 0x00000020U)) { if (!this_._internal_label().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_label()); } } // string tag = 133 [json_name = "tag", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (!this_._internal_tag().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_tag()); } } // string daemon_version = 134 [json_name = "daemonVersion", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000040U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { if (!this_._internal_daemon_version().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_daemon_version()); } } + } + if (BatchCheckHasBit(cached_has_bits, 0x0000ff00U)) { // string pyroscope_url = 170 [json_name = "pyroscopeUrl", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000080U)) { + if (CheckHasBit(cached_has_bits, 0x00000100U)) { if (!this_._internal_pyroscope_url().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_pyroscope_url()); } } - } - if (BatchCheckHasBit(cached_has_bits, 0x0000ff00U)) { // string pyroscope_app_name = 171 [json_name = "pyroscopeAppName", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000100U)) { + if (CheckHasBit(cached_has_bits, 0x00000200U)) { if (!this_._internal_pyroscope_app_name().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_pyroscope_app_name()); } } // string docker_socket_path = 202 [json_name = "dockerSocketPath", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000200U)) { + if (CheckHasBit(cached_has_bits, 0x00000400U)) { if (!this_._internal_docker_socket_path().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_docker_socket_path()); } } // string lldpd_socket_path = 211 [json_name = "lldpdSocketPath", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000400U)) { + if (CheckHasBit(cached_has_bits, 0x00000800U)) { if (!this_._internal_lldpd_socket_path().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_lldpd_socket_path()); } } // string lldpd_version_hint = 212 [json_name = "lldpdVersionHint", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000800U)) { + if (CheckHasBit(cached_has_bits, 0x00001000U)) { if (!this_._internal_lldpd_version_hint().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_lldpd_version_hint()); } } // string asn_db_path = 241 [json_name = "asnDbPath", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00001000U)) { + if (CheckHasBit(cached_has_bits, 0x00002000U)) { if (!this_._internal_asn_db_path().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_asn_db_path()); } } // string ipmeta_bootstrap_path = 243 [json_name = "ipmetaBootstrapPath", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00002000U)) { + if (CheckHasBit(cached_has_bits, 0x00004000U)) { if (!this_._internal_ipmeta_bootstrap_path().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_ipmeta_bootstrap_path()); } } // string ipmeta_cache_path = 244 [json_name = "ipmetaCachePath", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00004000U)) { + if (CheckHasBit(cached_has_bits, 0x00008000U)) { if (!this_._internal_ipmeta_cache_path().empty()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_ipmeta_cache_path()); } } + } + if (BatchCheckHasBit(cached_has_bits, 0x00ff0000U)) { // .google.protobuf.Duration reconcile_frequency = 40 [json_name = "reconcileFrequency", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00008000U)) { + if (CheckHasBit(cached_has_bits, 0x00010000U)) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.reconcile_frequency_); } - } - if (BatchCheckHasBit(cached_has_bits, 0x00ff0000U)) { // .google.protobuf.Duration kafka_produce_timeout = 82 [json_name = "kafkaProduceTimeout", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00010000U)) { + if (CheckHasBit(cached_has_bits, 0x00020000U)) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.kafka_produce_timeout_); } // .google.protobuf.Duration s3_flush_interval = 111 [json_name = "s3FlushInterval", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00020000U)) { + if (CheckHasBit(cached_has_bits, 0x00040000U)) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.s3_flush_interval_); } // .google.protobuf.Duration s3_upload_backoff_cap = 115 [json_name = "s3UploadBackoffCap", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00040000U)) { + if (CheckHasBit(cached_has_bits, 0x00080000U)) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.s3_upload_backoff_cap_); } // .xtcp_config.v1.ListenerAuth listener_auth = 152 [json_name = "listenerAuth", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00080000U)) { + if (CheckHasBit(cached_has_bits, 0x00100000U)) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.listener_auth_); } // .xtcp_config.v1.ListenerEndpoint prometheus_listener = 153 [json_name = "prometheusListener", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00100000U)) { + if (CheckHasBit(cached_has_bits, 0x00200000U)) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.prometheus_listener_); } // .xtcp_config.v1.ListenerAuth admin_listener_auth = 154 [json_name = "adminListenerAuth", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00200000U)) { + if (CheckHasBit(cached_has_bits, 0x00400000U)) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.admin_listener_auth_); } // .xtcp_config.v1.ListenerEndpoint grpc_listener = 161 [json_name = "grpcListener", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00400000U)) { + if (CheckHasBit(cached_has_bits, 0x00800000U)) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.grpc_listener_); } + } + if (BatchCheckHasBit(cached_has_bits, 0xff000000U)) { // .google.protobuf.Duration asn_refresh_interval = 242 [json_name = "asnRefreshInterval"]; - if (CheckHasBit(cached_has_bits, 0x00800000U)) { + if (CheckHasBit(cached_has_bits, 0x01000000U)) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.asn_refresh_interval_); } - } - if (BatchCheckHasBit(cached_has_bits, 0xff000000U)) { // .google.protobuf.Duration locality_refresh_interval = 246 [json_name = "localityRefreshInterval"]; - if (CheckHasBit(cached_has_bits, 0x01000000U)) { + if (CheckHasBit(cached_has_bits, 0x02000000U)) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.locality_refresh_interval_); } // .xtcp_config.v1.LinkMonitorConfig link_monitor = 250 [json_name = "linkMonitor"]; - if (CheckHasBit(cached_has_bits, 0x02000000U)) { + if (CheckHasBit(cached_has_bits, 0x04000000U)) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.link_monitor_); } // uint32 write_files = 50 [json_name = "writeFiles", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x04000000U)) { + if (CheckHasBit(cached_has_bits, 0x08000000U)) { if (this_._internal_write_files() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_write_files()); } } // uint32 dest_write_files = 52 [json_name = "destWriteFiles", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x08000000U)) { + if (CheckHasBit(cached_has_bits, 0x10000000U)) { if (this_._internal_dest_write_files() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_dest_write_files()); } } // uint32 debug_level = 53 [json_name = "debugLevel", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x10000000U)) { + if (CheckHasBit(cached_has_bits, 0x20000000U)) { if (this_._internal_debug_level() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_debug_level()); } } // uint32 envelope_flush_threshold_bytes = 64 [json_name = "envelopeFlushThresholdBytes", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x20000000U)) { + if (CheckHasBit(cached_has_bits, 0x40000000U)) { if (this_._internal_envelope_flush_threshold_bytes() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_envelope_flush_threshold_bytes()); } } // uint32 envelope_flush_threshold_rows = 65 [json_name = "envelopeFlushThresholdRows", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x40000000U)) { + if (CheckHasBit(cached_has_bits, 0x80000000U)) { if (this_._internal_envelope_flush_threshold_rows() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_envelope_flush_threshold_rows()); } } + } + cached_has_bits = this_._impl_._has_bits_[2]; + if (BatchCheckHasBit(cached_has_bits, 0x000000ffU)) { // uint32 s3_parquet_flush_threshold_bytes = 110 [json_name = "s3ParquetFlushThresholdBytes", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x80000000U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { if (this_._internal_s3_parquet_flush_threshold_bytes() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_s3_parquet_flush_threshold_bytes()); } } - } - cached_has_bits = this_._impl_._has_bits_[2]; - if (BatchCheckHasBit(cached_has_bits, 0x000000ffU)) { // uint32 s3_flush_jitter_pct = 112 [json_name = "s3FlushJitterPct", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (CheckHasBit(cached_has_bits, 0x00000002U)) { if (this_._internal_s3_flush_jitter_pct() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_s3_flush_jitter_pct()); } } // uint32 s3_flush_threshold_jitter_pct = 113 [json_name = "s3FlushThresholdJitterPct", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (CheckHasBit(cached_has_bits, 0x00000004U)) { if (this_._internal_s3_flush_threshold_jitter_pct() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_s3_flush_threshold_jitter_pct()); } } // uint32 s3_upload_max_attempts = 114 [json_name = "s3UploadMaxAttempts", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (CheckHasBit(cached_has_bits, 0x00000008U)) { if (this_._internal_s3_upload_max_attempts() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_s3_upload_max_attempts()); } } // uint32 ipv4_ttl = 150 [json_name = "ipv4Ttl", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (CheckHasBit(cached_has_bits, 0x00000010U)) { if (this_._internal_ipv4_ttl() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_ipv4_ttl()); } } // uint32 ipv6_hop_limit = 151 [json_name = "ipv6HopLimit", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (CheckHasBit(cached_has_bits, 0x00000020U)) { if (this_._internal_ipv6_hop_limit() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_ipv6_hop_limit()); } } // uint32 grpc_port = 160 [json_name = "grpcPort", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (this_._internal_grpc_port() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_grpc_port()); } } // bool debug_prometheus = 54 [json_name = "debugPrometheus", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000040U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { if (this_._internal_debug_prometheus() != 0) { total_size += 3; } } + } + if (BatchCheckHasBit(cached_has_bits, 0x0000ff00U)) { // bool resolve_container_id = 200 [json_name = "resolveContainerId", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000080U)) { + if (CheckHasBit(cached_has_bits, 0x00000100U)) { if (this_._internal_resolve_container_id() != 0) { total_size += 3; } } - } - if (BatchCheckHasBit(cached_has_bits, 0x0000ff00U)) { // bool enrich_container_enable = 201 [json_name = "enrichContainerEnable"]; - if (CheckHasBit(cached_has_bits, 0x00000100U)) { + if (CheckHasBit(cached_has_bits, 0x00000200U)) { if (this_._internal_enrich_container_enable() != 0) { total_size += 3; } } // bool enrich_lldp_enable = 210 [json_name = "enrichLldpEnable"]; - if (CheckHasBit(cached_has_bits, 0x00000200U)) { + if (CheckHasBit(cached_has_bits, 0x00000400U)) { if (this_._internal_enrich_lldp_enable() != 0) { total_size += 3; } } // uint32 pyroscope_sample_hz = 172 [json_name = "pyroscopeSampleHz", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000400U)) { + if (CheckHasBit(cached_has_bits, 0x00000800U)) { if (this_._internal_pyroscope_sample_hz() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_pyroscope_sample_hz()); } } // uint32 pyroscope_upload_interval_sec = 173 [json_name = "pyroscopeUploadIntervalSec", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00000800U)) { + if (CheckHasBit(cached_has_bits, 0x00001000U)) { if (this_._internal_pyroscope_upload_interval_sec() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_pyroscope_upload_interval_sec()); } } // uint32 uplink_count = 221 [json_name = "uplinkCount", (.buf.validate.field) = { - if (CheckHasBit(cached_has_bits, 0x00001000U)) { + if (CheckHasBit(cached_has_bits, 0x00002000U)) { if (this_._internal_uplink_count() != 0) { total_size += 2 + ::_pbi::WireFormatLite::UInt32Size( this_._internal_uplink_count()); } } // bool enrich_nic_enable = 220 [json_name = "enrichNicEnable"]; - if (CheckHasBit(cached_has_bits, 0x00002000U)) { + if (CheckHasBit(cached_has_bits, 0x00004000U)) { if (this_._internal_enrich_nic_enable() != 0) { total_size += 3; } } // bool populate_nsid = 230 [json_name = "populateNsid"]; - if (CheckHasBit(cached_has_bits, 0x00004000U)) { + if (CheckHasBit(cached_has_bits, 0x00008000U)) { if (this_._internal_populate_nsid() != 0) { total_size += 3; } } + } + if (BatchCheckHasBit(cached_has_bits, 0x00070000U)) { // bool enrich_asn_enable = 240 [json_name = "enrichAsnEnable"]; - if (CheckHasBit(cached_has_bits, 0x00008000U)) { + if (CheckHasBit(cached_has_bits, 0x00010000U)) { if (this_._internal_enrich_asn_enable() != 0) { total_size += 3; } } - } - if (BatchCheckHasBit(cached_has_bits, 0x00030000U)) { // bool enrich_locality_enable = 245 [json_name = "enrichLocalityEnable"]; - if (CheckHasBit(cached_has_bits, 0x00010000U)) { + if (CheckHasBit(cached_has_bits, 0x00020000U)) { if (this_._internal_enrich_locality_enable() != 0) { total_size += 3; } } // bool locality_events_enable = 247 [json_name = "localityEventsEnable"]; - if (CheckHasBit(cached_has_bits, 0x00020000U)) { + if (CheckHasBit(cached_has_bits, 0x00040000U)) { if (this_._internal_locality_events_enable() != 0) { total_size += 3; } @@ -11066,11 +11792,18 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } if (CheckHasBit(cached_has_bits, 0x00400000U)) { + _this->_internal_mutable_listeners()->InternalMergeFromWithArena( + ::google::protobuf::MessageLite::internal_visibility(), arena, + from._internal_listeners()); + } + if (CheckHasBit(cached_has_bits, 0x00800000U)) { _this->_internal_mutable_uplink_interfaces()->InternalMergeFromWithArena( ::google::protobuf::MessageLite::internal_visibility(), arena, from._internal_uplink_interfaces()); } - if (CheckHasBit(cached_has_bits, 0x00800000U)) { + } + if (BatchCheckHasBit(cached_has_bits, 0xff000000U)) { + if (CheckHasBit(cached_has_bits, 0x01000000U)) { if (!from._internal_capture_path().empty()) { _this->_internal_set_capture_path(from._internal_capture_path()); } else { @@ -11079,9 +11812,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - } - if (BatchCheckHasBit(cached_has_bits, 0xff000000U)) { - if (CheckHasBit(cached_has_bits, 0x01000000U)) { + if (CheckHasBit(cached_has_bits, 0x02000000U)) { if (!from._internal_topic().empty()) { _this->_internal_set_topic(from._internal_topic()); } else { @@ -11090,7 +11821,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x02000000U)) { + if (CheckHasBit(cached_has_bits, 0x04000000U)) { if (!from._internal_kafka_schema_url().empty()) { _this->_internal_set_kafka_schema_url(from._internal_kafka_schema_url()); } else { @@ -11099,7 +11830,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x04000000U)) { + if (CheckHasBit(cached_has_bits, 0x08000000U)) { if (!from._internal_kafka_compression().empty()) { _this->_internal_set_kafka_compression(from._internal_kafka_compression()); } else { @@ -11108,7 +11839,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x08000000U)) { + if (CheckHasBit(cached_has_bits, 0x10000000U)) { if (!from._internal_s3_endpoint().empty()) { _this->_internal_set_s3_endpoint(from._internal_s3_endpoint()); } else { @@ -11117,7 +11848,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x10000000U)) { + if (CheckHasBit(cached_has_bits, 0x20000000U)) { if (!from._internal_s3_region().empty()) { _this->_internal_set_s3_region(from._internal_s3_region()); } else { @@ -11126,7 +11857,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x20000000U)) { + if (CheckHasBit(cached_has_bits, 0x40000000U)) { if (!from._internal_s3_bucket().empty()) { _this->_internal_set_s3_bucket(from._internal_s3_bucket()); } else { @@ -11135,7 +11866,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x40000000U)) { + if (CheckHasBit(cached_has_bits, 0x80000000U)) { if (!from._internal_s3_prefix().empty()) { _this->_internal_set_s3_prefix(from._internal_s3_prefix()); } else { @@ -11144,7 +11875,10 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x80000000U)) { + } + cached_has_bits = from._impl_._has_bits_[1]; + if (BatchCheckHasBit(cached_has_bits, 0x000000ffU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { if (!from._internal_s3_access_key().empty()) { _this->_internal_set_s3_access_key(from._internal_s3_access_key()); } else { @@ -11153,10 +11887,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - } - cached_has_bits = from._impl_._has_bits_[1]; - if (BatchCheckHasBit(cached_has_bits, 0x000000ffU)) { - if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (CheckHasBit(cached_has_bits, 0x00000002U)) { if (!from._internal_s3_secret_key().empty()) { _this->_internal_set_s3_secret_key(from._internal_s3_secret_key()); } else { @@ -11165,7 +11896,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (CheckHasBit(cached_has_bits, 0x00000004U)) { if (!from._internal_s3_ca_file().empty()) { _this->_internal_set_s3_ca_file(from._internal_s3_ca_file()); } else { @@ -11174,7 +11905,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (CheckHasBit(cached_has_bits, 0x00000008U)) { if (!from._internal_hostname().empty()) { _this->_internal_set_hostname(from._internal_hostname()); } else { @@ -11183,7 +11914,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (CheckHasBit(cached_has_bits, 0x00000010U)) { if (!from._internal_location().empty()) { _this->_internal_set_location(from._internal_location()); } else { @@ -11192,7 +11923,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (CheckHasBit(cached_has_bits, 0x00000020U)) { if (!from._internal_label().empty()) { _this->_internal_set_label(from._internal_label()); } else { @@ -11201,7 +11932,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (!from._internal_tag().empty()) { _this->_internal_set_tag(from._internal_tag()); } else { @@ -11210,7 +11941,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000040U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { if (!from._internal_daemon_version().empty()) { _this->_internal_set_daemon_version(from._internal_daemon_version()); } else { @@ -11219,7 +11950,9 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000080U)) { + } + if (BatchCheckHasBit(cached_has_bits, 0x0000ff00U)) { + if (CheckHasBit(cached_has_bits, 0x00000100U)) { if (!from._internal_pyroscope_url().empty()) { _this->_internal_set_pyroscope_url(from._internal_pyroscope_url()); } else { @@ -11228,9 +11961,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - } - if (BatchCheckHasBit(cached_has_bits, 0x0000ff00U)) { - if (CheckHasBit(cached_has_bits, 0x00000100U)) { + if (CheckHasBit(cached_has_bits, 0x00000200U)) { if (!from._internal_pyroscope_app_name().empty()) { _this->_internal_set_pyroscope_app_name(from._internal_pyroscope_app_name()); } else { @@ -11239,7 +11970,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000200U)) { + if (CheckHasBit(cached_has_bits, 0x00000400U)) { if (!from._internal_docker_socket_path().empty()) { _this->_internal_set_docker_socket_path(from._internal_docker_socket_path()); } else { @@ -11248,7 +11979,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000400U)) { + if (CheckHasBit(cached_has_bits, 0x00000800U)) { if (!from._internal_lldpd_socket_path().empty()) { _this->_internal_set_lldpd_socket_path(from._internal_lldpd_socket_path()); } else { @@ -11257,7 +11988,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000800U)) { + if (CheckHasBit(cached_has_bits, 0x00001000U)) { if (!from._internal_lldpd_version_hint().empty()) { _this->_internal_set_lldpd_version_hint(from._internal_lldpd_version_hint()); } else { @@ -11266,7 +11997,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00001000U)) { + if (CheckHasBit(cached_has_bits, 0x00002000U)) { if (!from._internal_asn_db_path().empty()) { _this->_internal_set_asn_db_path(from._internal_asn_db_path()); } else { @@ -11275,7 +12006,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00002000U)) { + if (CheckHasBit(cached_has_bits, 0x00004000U)) { if (!from._internal_ipmeta_bootstrap_path().empty()) { _this->_internal_set_ipmeta_bootstrap_path(from._internal_ipmeta_bootstrap_path()); } else { @@ -11284,7 +12015,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00004000U)) { + if (CheckHasBit(cached_has_bits, 0x00008000U)) { if (!from._internal_ipmeta_cache_path().empty()) { _this->_internal_set_ipmeta_cache_path(from._internal_ipmeta_cache_path()); } else { @@ -11293,7 +12024,9 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00008000U)) { + } + if (BatchCheckHasBit(cached_has_bits, 0x00ff0000U)) { + if (CheckHasBit(cached_has_bits, 0x00010000U)) { ABSL_DCHECK(from._impl_.reconcile_frequency_ != nullptr); if (_this->_impl_.reconcile_frequency_ == nullptr) { _this->_impl_.reconcile_frequency_ = Super_::CopyConstruct(arena, *from._impl_.reconcile_frequency_); @@ -11301,9 +12034,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.reconcile_frequency_->MergeFrom(*from._impl_.reconcile_frequency_); } } - } - if (BatchCheckHasBit(cached_has_bits, 0x00ff0000U)) { - if (CheckHasBit(cached_has_bits, 0x00010000U)) { + if (CheckHasBit(cached_has_bits, 0x00020000U)) { ABSL_DCHECK(from._impl_.kafka_produce_timeout_ != nullptr); if (_this->_impl_.kafka_produce_timeout_ == nullptr) { _this->_impl_.kafka_produce_timeout_ = Super_::CopyConstruct(arena, *from._impl_.kafka_produce_timeout_); @@ -11311,7 +12042,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.kafka_produce_timeout_->MergeFrom(*from._impl_.kafka_produce_timeout_); } } - if (CheckHasBit(cached_has_bits, 0x00020000U)) { + if (CheckHasBit(cached_has_bits, 0x00040000U)) { ABSL_DCHECK(from._impl_.s3_flush_interval_ != nullptr); if (_this->_impl_.s3_flush_interval_ == nullptr) { _this->_impl_.s3_flush_interval_ = Super_::CopyConstruct(arena, *from._impl_.s3_flush_interval_); @@ -11319,7 +12050,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.s3_flush_interval_->MergeFrom(*from._impl_.s3_flush_interval_); } } - if (CheckHasBit(cached_has_bits, 0x00040000U)) { + if (CheckHasBit(cached_has_bits, 0x00080000U)) { ABSL_DCHECK(from._impl_.s3_upload_backoff_cap_ != nullptr); if (_this->_impl_.s3_upload_backoff_cap_ == nullptr) { _this->_impl_.s3_upload_backoff_cap_ = Super_::CopyConstruct(arena, *from._impl_.s3_upload_backoff_cap_); @@ -11327,7 +12058,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.s3_upload_backoff_cap_->MergeFrom(*from._impl_.s3_upload_backoff_cap_); } } - if (CheckHasBit(cached_has_bits, 0x00080000U)) { + if (CheckHasBit(cached_has_bits, 0x00100000U)) { ABSL_DCHECK(from._impl_.listener_auth_ != nullptr); if (_this->_impl_.listener_auth_ == nullptr) { _this->_impl_.listener_auth_ = Super_::CopyConstruct(arena, *from._impl_.listener_auth_); @@ -11335,7 +12066,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.listener_auth_->MergeFrom(*from._impl_.listener_auth_); } } - if (CheckHasBit(cached_has_bits, 0x00100000U)) { + if (CheckHasBit(cached_has_bits, 0x00200000U)) { ABSL_DCHECK(from._impl_.prometheus_listener_ != nullptr); if (_this->_impl_.prometheus_listener_ == nullptr) { _this->_impl_.prometheus_listener_ = Super_::CopyConstruct(arena, *from._impl_.prometheus_listener_); @@ -11343,7 +12074,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.prometheus_listener_->MergeFrom(*from._impl_.prometheus_listener_); } } - if (CheckHasBit(cached_has_bits, 0x00200000U)) { + if (CheckHasBit(cached_has_bits, 0x00400000U)) { ABSL_DCHECK(from._impl_.admin_listener_auth_ != nullptr); if (_this->_impl_.admin_listener_auth_ == nullptr) { _this->_impl_.admin_listener_auth_ = Super_::CopyConstruct(arena, *from._impl_.admin_listener_auth_); @@ -11351,7 +12082,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.admin_listener_auth_->MergeFrom(*from._impl_.admin_listener_auth_); } } - if (CheckHasBit(cached_has_bits, 0x00400000U)) { + if (CheckHasBit(cached_has_bits, 0x00800000U)) { ABSL_DCHECK(from._impl_.grpc_listener_ != nullptr); if (_this->_impl_.grpc_listener_ == nullptr) { _this->_impl_.grpc_listener_ = Super_::CopyConstruct(arena, *from._impl_.grpc_listener_); @@ -11359,7 +12090,9 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.grpc_listener_->MergeFrom(*from._impl_.grpc_listener_); } } - if (CheckHasBit(cached_has_bits, 0x00800000U)) { + } + if (BatchCheckHasBit(cached_has_bits, 0xff000000U)) { + if (CheckHasBit(cached_has_bits, 0x01000000U)) { ABSL_DCHECK(from._impl_.asn_refresh_interval_ != nullptr); if (_this->_impl_.asn_refresh_interval_ == nullptr) { _this->_impl_.asn_refresh_interval_ = Super_::CopyConstruct(arena, *from._impl_.asn_refresh_interval_); @@ -11367,9 +12100,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.asn_refresh_interval_->MergeFrom(*from._impl_.asn_refresh_interval_); } } - } - if (BatchCheckHasBit(cached_has_bits, 0xff000000U)) { - if (CheckHasBit(cached_has_bits, 0x01000000U)) { + if (CheckHasBit(cached_has_bits, 0x02000000U)) { ABSL_DCHECK(from._impl_.locality_refresh_interval_ != nullptr); if (_this->_impl_.locality_refresh_interval_ == nullptr) { _this->_impl_.locality_refresh_interval_ = Super_::CopyConstruct(arena, *from._impl_.locality_refresh_interval_); @@ -11377,7 +12108,7 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.locality_refresh_interval_->MergeFrom(*from._impl_.locality_refresh_interval_); } } - if (CheckHasBit(cached_has_bits, 0x02000000U)) { + if (CheckHasBit(cached_has_bits, 0x04000000U)) { ABSL_DCHECK(from._impl_.link_monitor_ != nullptr); if (_this->_impl_.link_monitor_ == nullptr) { _this->_impl_.link_monitor_ = Super_::CopyConstruct(arena, *from._impl_.link_monitor_); @@ -11385,129 +12116,129 @@ void XtcpConfig::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.link_monitor_->MergeFrom(*from._impl_.link_monitor_); } } - if (CheckHasBit(cached_has_bits, 0x04000000U)) { + if (CheckHasBit(cached_has_bits, 0x08000000U)) { if (from._internal_write_files() != 0) { _this->_impl_.write_files_ = from._impl_.write_files_; } } - if (CheckHasBit(cached_has_bits, 0x08000000U)) { + if (CheckHasBit(cached_has_bits, 0x10000000U)) { if (from._internal_dest_write_files() != 0) { _this->_impl_.dest_write_files_ = from._impl_.dest_write_files_; } } - if (CheckHasBit(cached_has_bits, 0x10000000U)) { + if (CheckHasBit(cached_has_bits, 0x20000000U)) { if (from._internal_debug_level() != 0) { _this->_impl_.debug_level_ = from._impl_.debug_level_; } } - if (CheckHasBit(cached_has_bits, 0x20000000U)) { + if (CheckHasBit(cached_has_bits, 0x40000000U)) { if (from._internal_envelope_flush_threshold_bytes() != 0) { _this->_impl_.envelope_flush_threshold_bytes_ = from._impl_.envelope_flush_threshold_bytes_; } } - if (CheckHasBit(cached_has_bits, 0x40000000U)) { + if (CheckHasBit(cached_has_bits, 0x80000000U)) { if (from._internal_envelope_flush_threshold_rows() != 0) { _this->_impl_.envelope_flush_threshold_rows_ = from._impl_.envelope_flush_threshold_rows_; } } - if (CheckHasBit(cached_has_bits, 0x80000000U)) { - if (from._internal_s3_parquet_flush_threshold_bytes() != 0) { - _this->_impl_.s3_parquet_flush_threshold_bytes_ = from._impl_.s3_parquet_flush_threshold_bytes_; - } - } } cached_has_bits = from._impl_._has_bits_[2]; if (BatchCheckHasBit(cached_has_bits, 0x000000ffU)) { if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (from._internal_s3_parquet_flush_threshold_bytes() != 0) { + _this->_impl_.s3_parquet_flush_threshold_bytes_ = from._impl_.s3_parquet_flush_threshold_bytes_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { if (from._internal_s3_flush_jitter_pct() != 0) { _this->_impl_.s3_flush_jitter_pct_ = from._impl_.s3_flush_jitter_pct_; } } - if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (CheckHasBit(cached_has_bits, 0x00000004U)) { if (from._internal_s3_flush_threshold_jitter_pct() != 0) { _this->_impl_.s3_flush_threshold_jitter_pct_ = from._impl_.s3_flush_threshold_jitter_pct_; } } - if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (CheckHasBit(cached_has_bits, 0x00000008U)) { if (from._internal_s3_upload_max_attempts() != 0) { _this->_impl_.s3_upload_max_attempts_ = from._impl_.s3_upload_max_attempts_; } } - if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (CheckHasBit(cached_has_bits, 0x00000010U)) { if (from._internal_ipv4_ttl() != 0) { _this->_impl_.ipv4_ttl_ = from._impl_.ipv4_ttl_; } } - if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (CheckHasBit(cached_has_bits, 0x00000020U)) { if (from._internal_ipv6_hop_limit() != 0) { _this->_impl_.ipv6_hop_limit_ = from._impl_.ipv6_hop_limit_; } } - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (from._internal_grpc_port() != 0) { _this->_impl_.grpc_port_ = from._impl_.grpc_port_; } } - if (CheckHasBit(cached_has_bits, 0x00000040U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { if (from._internal_debug_prometheus() != 0) { _this->_impl_.debug_prometheus_ = from._impl_.debug_prometheus_; } } - if (CheckHasBit(cached_has_bits, 0x00000080U)) { + } + if (BatchCheckHasBit(cached_has_bits, 0x0000ff00U)) { + if (CheckHasBit(cached_has_bits, 0x00000100U)) { if (from._internal_resolve_container_id() != 0) { _this->_impl_.resolve_container_id_ = from._impl_.resolve_container_id_; } } - } - if (BatchCheckHasBit(cached_has_bits, 0x0000ff00U)) { - if (CheckHasBit(cached_has_bits, 0x00000100U)) { + if (CheckHasBit(cached_has_bits, 0x00000200U)) { if (from._internal_enrich_container_enable() != 0) { _this->_impl_.enrich_container_enable_ = from._impl_.enrich_container_enable_; } } - if (CheckHasBit(cached_has_bits, 0x00000200U)) { + if (CheckHasBit(cached_has_bits, 0x00000400U)) { if (from._internal_enrich_lldp_enable() != 0) { _this->_impl_.enrich_lldp_enable_ = from._impl_.enrich_lldp_enable_; } } - if (CheckHasBit(cached_has_bits, 0x00000400U)) { + if (CheckHasBit(cached_has_bits, 0x00000800U)) { if (from._internal_pyroscope_sample_hz() != 0) { _this->_impl_.pyroscope_sample_hz_ = from._impl_.pyroscope_sample_hz_; } } - if (CheckHasBit(cached_has_bits, 0x00000800U)) { + if (CheckHasBit(cached_has_bits, 0x00001000U)) { if (from._internal_pyroscope_upload_interval_sec() != 0) { _this->_impl_.pyroscope_upload_interval_sec_ = from._impl_.pyroscope_upload_interval_sec_; } } - if (CheckHasBit(cached_has_bits, 0x00001000U)) { + if (CheckHasBit(cached_has_bits, 0x00002000U)) { if (from._internal_uplink_count() != 0) { _this->_impl_.uplink_count_ = from._impl_.uplink_count_; } } - if (CheckHasBit(cached_has_bits, 0x00002000U)) { + if (CheckHasBit(cached_has_bits, 0x00004000U)) { if (from._internal_enrich_nic_enable() != 0) { _this->_impl_.enrich_nic_enable_ = from._impl_.enrich_nic_enable_; } } - if (CheckHasBit(cached_has_bits, 0x00004000U)) { + if (CheckHasBit(cached_has_bits, 0x00008000U)) { if (from._internal_populate_nsid() != 0) { _this->_impl_.populate_nsid_ = from._impl_.populate_nsid_; } } - if (CheckHasBit(cached_has_bits, 0x00008000U)) { + } + if (BatchCheckHasBit(cached_has_bits, 0x00070000U)) { + if (CheckHasBit(cached_has_bits, 0x00010000U)) { if (from._internal_enrich_asn_enable() != 0) { _this->_impl_.enrich_asn_enable_ = from._impl_.enrich_asn_enable_; } } - } - if (BatchCheckHasBit(cached_has_bits, 0x00030000U)) { - if (CheckHasBit(cached_has_bits, 0x00010000U)) { + if (CheckHasBit(cached_has_bits, 0x00020000U)) { if (from._internal_enrich_locality_enable() != 0) { _this->_impl_.enrich_locality_enable_ = from._impl_.enrich_locality_enable_; } } - if (CheckHasBit(cached_has_bits, 0x00020000U)) { + if (CheckHasBit(cached_has_bits, 0x00040000U)) { if (from._internal_locality_events_enable() != 0) { _this->_impl_.locality_events_enable_ = from._impl_.locality_events_enable_; } @@ -11544,6 +12275,7 @@ void XtcpConfig::InternalSwap(XtcpConfig* PROTOBUF_RESTRICT PROTOBUF_NONNULL oth - PROTOBUF_FIELD_OFFSET(XtcpConfig, _impl_.poll_frequency_)>( reinterpret_cast(&_impl_.poll_frequency_), reinterpret_cast(&other->_impl_.poll_frequency_)); + _impl_.listeners_.InternalSwap(&other->_impl_.listeners_); _impl_.uplink_interfaces_.InternalSwap(&other->_impl_.uplink_interfaces_); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.capture_path_, &other->_impl_.capture_path_, arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.topic_, &other->_impl_.topic_, arena); diff --git a/gen/cpp/xtcp_config/v1/xtcp_config.pb.h b/gen/cpp/xtcp_config/v1/xtcp_config.pb.h index 15e17c28e..a72c0064e 100644 --- a/gen/cpp/xtcp_config/v1/xtcp_config.pb.h +++ b/gen/cpp/xtcp_config/v1/xtcp_config.pb.h @@ -56,6 +56,8 @@ extern const ::google::protobuf::internal::DescriptorTable descriptor_table_xtcp } // extern "C" namespace xtcp_config { namespace v1 { +enum EndpointClass : int; +extern const uint32_t EndpointClass_internal_data_[]; enum ListenerAuthMode : int; extern const uint32_t ListenerAuthMode_internal_data_[]; enum ListenerNetwork : int; @@ -100,6 +102,14 @@ extern const ::google::protobuf::internal::ClassDataFull LinkMonitorConfig_class #else extern const LinkMonitorConfigGlobalsTypeInternal LinkMonitorConfig_globals_; #endif // PROTOBUF_MESSAGE_GLOBALS +class Listener; +struct ListenerGlobalsTypeInternal; +#ifndef PROTOBUF_MESSAGE_GLOBALS +extern ListenerGlobalsTypeInternal Listener_globals_; +extern const ::google::protobuf::internal::ClassDataFull Listener_class_data_; +#else +extern const ListenerGlobalsTypeInternal Listener_globals_; +#endif // PROTOBUF_MESSAGE_GLOBALS class ListenerAuth; struct ListenerAuthGlobalsTypeInternal; #ifndef PROTOBUF_MESSAGE_GLOBALS @@ -225,6 +235,9 @@ extern const XtcpConfigGlobalsTypeInternal XtcpConfig_globals_; namespace google { namespace protobuf { template <> +internal::EnumTraitsT<::xtcp_config::v1::EndpointClass_internal_data_> + internal::EnumTraitsImpl::value<::xtcp_config::v1::EndpointClass>; +template <> internal::EnumTraitsT<::xtcp_config::v1::ListenerAuthMode_internal_data_> internal::EnumTraitsImpl::value<::xtcp_config::v1::ListenerAuthMode>; template <> @@ -318,6 +331,52 @@ template <> return ::google::protobuf::internal::ParseNamedEnum(ListenerAuthMode_descriptor(), name, value); } +enum EndpointClass : int { + ENDPOINT_CLASS_UNSPECIFIED = 0, + ENDPOINT_CLASS_HEALTH = 1, + ENDPOINT_CLASS_METRICS = 2, + ENDPOINT_CLASS_METRICS_DETAIL = 3, + ENDPOINT_CLASS_IP = 4, + ENDPOINT_CLASS_DEBUG = 5, + ENDPOINT_CLASS_GRPC_READ = 6, + ENDPOINT_CLASS_GRPC_ADMIN = 7, + EndpointClass_INT_MIN_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::min(), + EndpointClass_INT_MAX_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::max(), +}; + +extern const uint32_t EndpointClass_internal_data_[]; +inline constexpr EndpointClass EndpointClass_MIN = + static_cast(0); +inline constexpr EndpointClass EndpointClass_MAX = + static_cast(7); +[[nodiscard]] inline bool EndpointClass_IsValid(int value) { + return 0 <= value && value <= 7; +} +inline constexpr int EndpointClass_ARRAYSIZE = 7 + 1; +[[nodiscard]] const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL +EndpointClass_descriptor(); +[[nodiscard]] inline auto ProtobufInternalGetEnumDescriptor(EndpointClass) { + return EndpointClass_descriptor(); +} +template +[[nodiscard]] const ::std::string& EndpointClass_Name(T value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to EndpointClass_Name()."); + return EndpointClass_Name(static_cast(value)); +} +template <> +[[nodiscard]] inline const ::std::string& EndpointClass_Name(EndpointClass value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +[[nodiscard]] inline bool EndpointClass_Parse( + ::absl::string_view name, EndpointClass* PROTOBUF_NONNULL value) { + return ::google::protobuf::internal::ParseNamedEnum(EndpointClass_descriptor(), name, + value); +} using ::google::protobuf::internal::generated_enum::AbslParseFlag; using ::google::protobuf::internal::generated_enum::AbslUnparseFlag; @@ -2308,6 +2367,8 @@ class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ListenerAuth final : public ::googl enum : int { kRawTokenFieldNumber = 2, kHmacSharedKeyFieldNumber = 3, + kRawTokenFileFieldNumber = 7, + kHmacSharedKeyFileFieldNumber = 8, kFailureJitterMinFieldNumber = 5, kFailureJitterMaxFieldNumber = 6, kModeFieldNumber = 1, @@ -2342,6 +2403,36 @@ class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ListenerAuth final : public ::googl PROTOBUF_ALWAYS_INLINE void _internal_set_hmac_shared_key(const ::std::string& value); ::std::string* PROTOBUF_NONNULL _internal_mutable_hmac_shared_key(); + public: + // string raw_token_file = 7 [json_name = "rawTokenFile", (.buf.validate.field) = { + void clear_raw_token_file() ; + [[nodiscard]] const ::std::string& raw_token_file() const; + template + void set_raw_token_file(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_raw_token_file(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_raw_token_file(); + void set_allocated_raw_token_file(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_raw_token_file() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_raw_token_file(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_raw_token_file(); + + public: + // string hmac_shared_key_file = 8 [json_name = "hmacSharedKeyFile", (.buf.validate.field) = { + void clear_hmac_shared_key_file() ; + [[nodiscard]] const ::std::string& hmac_shared_key_file() const; + template + void set_hmac_shared_key_file(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_hmac_shared_key_file(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_hmac_shared_key_file(); + void set_allocated_hmac_shared_key_file(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_hmac_shared_key_file() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_hmac_shared_key_file(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_hmac_shared_key_file(); + public: // .google.protobuf.Duration failure_jitter_min = 5 [json_name = "failureJitterMin", (.buf.validate.field) = { [[nodiscard]] bool has_failure_jitter_min() const; @@ -2398,8 +2489,8 @@ class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ListenerAuth final : public ::googl private: class _Internal; using ParseTableT_ = - ::google::protobuf::internal::TcParseTable<3, 6, - 2, 60, + ::google::protobuf::internal::TcParseTable<3, 8, + 2, 102, 2>; static constexpr ParseTableT_ InternalGenerateParseTable_( const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); @@ -2429,6 +2520,8 @@ class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED ListenerAuth final : public ::googl ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr raw_token_; ::google::protobuf::internal::ArenaStringPtr hmac_shared_key_; + ::google::protobuf::internal::ArenaStringPtr raw_token_file_; + ::google::protobuf::internal::ArenaStringPtr hmac_shared_key_file_; ::google::protobuf::Duration* PROTOBUF_NULLABLE failure_jitter_min_; ::google::protobuf::Duration* PROTOBUF_NULLABLE failure_jitter_max_; int mode_; @@ -2498,7 +2591,7 @@ class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED LinkMonitorConfig final : public :: [[nodiscard]] static const LinkMonitorConfig& default_instance() { return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&LinkMonitorConfig_globals_); } - static constexpr int kIndexInFileMessages = 16; + static constexpr int kIndexInFileMessages = 17; friend void swap(LinkMonitorConfig& a, LinkMonitorConfig& b) { a.Swap(&b); } inline void Swap(LinkMonitorConfig* PROTOBUF_NONNULL other) { if (other == this) return; @@ -3153,7 +3246,7 @@ class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED EnabledDeserializers final : public [[nodiscard]] static const EnabledDeserializers& default_instance() { return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&EnabledDeserializers_globals_); } - static constexpr int kIndexInFileMessages = 19; + static constexpr int kIndexInFileMessages = 20; friend void swap(EnabledDeserializers& a, EnabledDeserializers& b) { a.Swap(&b); } inline void Swap(EnabledDeserializers* PROTOBUF_NONNULL other) { if (other == this) return; @@ -3301,6 +3394,286 @@ class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED EnabledDeserializers final : public }; // ------------------------------------------------------------------- +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED Listener final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:xtcp_config.v1.Listener) */ { + using Super_ = ::google::protobuf::Message; + + public: + inline Listener() : Listener(nullptr) {} + ~Listener() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(Listener* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(Listener)); + } +#endif + + template + explicit constexpr Listener(::google::protobuf::internal::ConstantInitialized, + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL + class_data); + + inline Listener(const Listener& from) : Listener(nullptr, from) {} + inline Listener(Listener&& from) noexcept : Listener(nullptr, ::std::move(from)) {} + inline Listener& operator=(const Listener& from) { + CopyFrom(from); + return *this; + } + inline Listener& operator=(Listener&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const Listener& default_instance() { + return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&Listener_globals_); + } + static constexpr int kIndexInFileMessages = 16; + friend void swap(Listener& a, Listener& b) { a.Swap(&b); } + inline void Swap(Listener* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Listener* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] Listener* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return Super_::DefaultConstruct(arena); + } + using Super_::CopyFrom; + void CopyFrom(const Listener& from); + using Super_::MergeFrom; + void MergeFrom(const Listener& from) { Listener::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(Listener* PROTOBUF_NONNULL other); + private: + static ::absl::string_view FullMessageName() { return "xtcp_config.v1.Listener"; } + + explicit Listener(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + Listener(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Listener& from); + Listener( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, Listener&& from) noexcept + : Listener(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_( + const MessageLite& prototype, + const ::google::protobuf::internal::TcParseTableBase* PROTOBUF_NULLABLE tc_table = nullptr); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kServesFieldNumber = 5, + kNameFieldNumber = 1, + kEndpointFieldNumber = 2, + kAuthFieldNumber = 3, + kAdminAuthFieldNumber = 4, + }; + // repeated .xtcp_config.v1.EndpointClass serves = 5 [json_name = "serves", (.buf.validate.field) = { + [[nodiscard]] int serves_size() const; + private: + int _internal_serves_size() const; + + public: + void clear_serves() ; + public: + [[nodiscard]] ::xtcp_config::v1::EndpointClass serves(int index) const; + void set_serves(int index, ::xtcp_config::v1::EndpointClass value); + void add_serves(::xtcp_config::v1::EndpointClass value); + [[nodiscard]] const ::google::protobuf::RepeatedField& serves() + const; + [[nodiscard]] ::google::protobuf::RepeatedField* PROTOBUF_NONNULL mutable_serves(); + + private: + const ::google::protobuf::RepeatedField& _internal_serves() const; + ::google::protobuf::RepeatedField* PROTOBUF_NONNULL _internal_mutable_serves(); + + public: + // string name = 1 [json_name = "name", (.buf.validate.field) = { + void clear_name() ; + [[nodiscard]] const ::std::string& name() const; + template + void set_name(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_name(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_name(); + void set_allocated_name(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_name() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_name(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_name(); + + public: + // .xtcp_config.v1.ListenerEndpoint endpoint = 2 [json_name = "endpoint", (.buf.validate.field) = { + [[nodiscard]] bool has_endpoint() const; + void clear_endpoint() ; + [[nodiscard]] const ::xtcp_config::v1::ListenerEndpoint& endpoint() const; + [[nodiscard]] ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NULLABLE release_endpoint(); + ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NONNULL mutable_endpoint(); + void set_allocated_endpoint(::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_endpoint(::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NULLABLE value); + ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NULLABLE unsafe_arena_release_endpoint(); + + private: + const ::xtcp_config::v1::ListenerEndpoint& _internal_endpoint() const; + ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NONNULL _internal_mutable_endpoint(); + + public: + // .xtcp_config.v1.ListenerAuth auth = 3 [json_name = "auth"]; + [[nodiscard]] bool has_auth() const; + void clear_auth() ; + [[nodiscard]] const ::xtcp_config::v1::ListenerAuth& auth() const; + [[nodiscard]] ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE release_auth(); + ::xtcp_config::v1::ListenerAuth* PROTOBUF_NONNULL mutable_auth(); + void set_allocated_auth(::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_auth(::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE value); + ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE unsafe_arena_release_auth(); + + private: + const ::xtcp_config::v1::ListenerAuth& _internal_auth() const; + ::xtcp_config::v1::ListenerAuth* PROTOBUF_NONNULL _internal_mutable_auth(); + + public: + // .xtcp_config.v1.ListenerAuth admin_auth = 4 [json_name = "adminAuth"]; + [[nodiscard]] bool has_admin_auth() const; + void clear_admin_auth() ; + [[nodiscard]] const ::xtcp_config::v1::ListenerAuth& admin_auth() const; + [[nodiscard]] ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE release_admin_auth(); + ::xtcp_config::v1::ListenerAuth* PROTOBUF_NONNULL mutable_admin_auth(); + void set_allocated_admin_auth(::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_admin_auth(::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE value); + ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE unsafe_arena_release_admin_auth(); + + private: + const ::xtcp_config::v1::ListenerAuth& _internal_admin_auth() const; + ::xtcp_config::v1::ListenerAuth* PROTOBUF_NONNULL _internal_mutable_admin_auth(); + + public: + // @@protoc_insertion_point(class_scope:xtcp_config.v1.Listener) + private: + class _Internal; + using ParseTableT_ = + ::google::protobuf::internal::TcParseTable<3, 5, + 3, 36, + 2>; + static constexpr ParseTableT_ InternalGenerateParseTable_( + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); + friend class ::google::protobuf::internal::TcParser; + #ifndef PROTOBUF_MESSAGE_GLOBALS + static const ParseTableT_ _table_; + #endif + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const Listener& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::RepeatedField serves_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NULLABLE endpoint_; + ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE auth_; + ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE admin_auth_; + ::google::protobuf::internal::CachedSize _serves_cached_byte_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_xtcp_5fconfig_2fv1_2fxtcp_5fconfig_2eproto; +}; +// ------------------------------------------------------------------- + class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED XtcpConfig final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:xtcp_config.v1.XtcpConfig) */ { using Super_ = ::google::protobuf::Message; @@ -3359,7 +3732,7 @@ class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED XtcpConfig final : public ::google: [[nodiscard]] static const XtcpConfig& default_instance() { return *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance(&XtcpConfig_globals_); } - static constexpr int kIndexInFileMessages = 17; + static constexpr int kIndexInFileMessages = 18; friend void swap(XtcpConfig& a, XtcpConfig& b) { a.Swap(&b); } inline void Swap(XtcpConfig* PROTOBUF_NONNULL other) { if (other == this) return; @@ -3471,6 +3844,7 @@ class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED XtcpConfig final : public ::google: kReconcileBeforePollFieldNumber = 41, kS3SkipBucketProbeFieldNumber = 106, kS3AllowInsecureFieldNumber = 107, + kListenersFieldNumber = 162, kUplinkInterfacesFieldNumber = 222, kCapturePathFieldNumber = 51, kTopicFieldNumber = 80, @@ -3786,6 +4160,26 @@ class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED XtcpConfig final : public ::google: bool _internal_s3_allow_insecure() const; void _internal_set_s3_allow_insecure(bool value); + public: + // repeated .xtcp_config.v1.Listener listeners = 162 [json_name = "listeners", (.buf.validate.field) = { + [[nodiscard]] int listeners_size() const; + private: + int _internal_listeners_size() const; + + public: + void clear_listeners() ; + [[nodiscard]] const ::xtcp_config::v1::Listener& listeners(int index) const; + [[nodiscard]] ::xtcp_config::v1::Listener* PROTOBUF_NONNULL mutable_listeners(int index); + ::xtcp_config::v1::Listener* PROTOBUF_NONNULL add_listeners(); + [[nodiscard]] const ::google::protobuf::RepeatedPtrField<::xtcp_config::v1::Listener>& + listeners() const; + [[nodiscard]] ::google::protobuf::RepeatedPtrField<::xtcp_config::v1::Listener>* PROTOBUF_NONNULL + mutable_listeners(); + + private: + const ::google::protobuf::RepeatedPtrField<::xtcp_config::v1::Listener>& _internal_listeners() const; + ::google::protobuf::RepeatedPtrField<::xtcp_config::v1::Listener>* PROTOBUF_NONNULL _internal_mutable_listeners(); + public: // repeated string uplink_interfaces = 222 [json_name = "uplinkInterfaces", (.buf.validate.field) = { [[nodiscard]] int uplink_interfaces_size() const; @@ -4582,8 +4976,8 @@ class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED XtcpConfig final : public ::google: private: class _Internal; using ParseTableT_ = - ::google::protobuf::internal::TcParseTable<5, 82, - 14, 466, + ::google::protobuf::internal::TcParseTable<5, 83, + 15, 466, 33>; static constexpr ParseTableT_ InternalGenerateParseTable_( const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL class_data); @@ -4633,6 +5027,7 @@ class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED XtcpConfig final : public ::google: bool reconcile_before_poll_; bool s3_skip_bucket_probe_; bool s3_allow_insecure_; + ::google::protobuf::RepeatedPtrField< ::xtcp_config::v1::Listener > listeners_; ::google::protobuf::RepeatedPtrField<::std::string> uplink_interfaces_; ::google::protobuf::internal::ArenaStringPtr capture_path_; ::google::protobuf::internal::ArenaStringPtr topic_; @@ -7396,7 +7791,7 @@ inline void ListenerEndpoint::_internal_set_accept_burst(::uint32_t value) { inline void ListenerAuth::clear_mode() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.mode_ = 0; - ClearHasBit(_impl_._has_bits_[0], 0x00000010U); + ClearHasBit(_impl_._has_bits_[0], 0x00000040U); } inline ::xtcp_config::v1::ListenerAuthMode ListenerAuth::mode() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.ListenerAuth.mode) @@ -7404,7 +7799,7 @@ inline ::xtcp_config::v1::ListenerAuthMode ListenerAuth::mode() const { } inline void ListenerAuth::set_mode(::xtcp_config::v1::ListenerAuthMode value) { _internal_set_mode(value); - SetHasBit(_impl_._has_bits_[0], 0x00000010U); + SetHasBit(_impl_._has_bits_[0], 0x00000040U); // @@protoc_insertion_point(field_set:xtcp_config.v1.ListenerAuth.mode) } inline ::xtcp_config::v1::ListenerAuthMode ListenerAuth::_internal_mode() const { @@ -7546,13 +7941,13 @@ inline void ListenerAuth::set_allocated_hmac_shared_key(::std::string* PROTOBUF_ // optional uint32 signed_token_skew_minutes = 4 [json_name = "signedTokenSkewMinutes", (.buf.validate.field) = { inline bool ListenerAuth::has_signed_token_skew_minutes() const { - bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000020U); + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000080U); return value; } inline void ListenerAuth::clear_signed_token_skew_minutes() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.signed_token_skew_minutes_ = 0u; - ClearHasBit(_impl_._has_bits_[0], 0x00000020U); + ClearHasBit(_impl_._has_bits_[0], 0x00000080U); } inline ::uint32_t ListenerAuth::signed_token_skew_minutes() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.ListenerAuth.signed_token_skew_minutes) @@ -7560,7 +7955,7 @@ inline ::uint32_t ListenerAuth::signed_token_skew_minutes() const { } inline void ListenerAuth::set_signed_token_skew_minutes(::uint32_t value) { _internal_set_signed_token_skew_minutes(value); - SetHasBit(_impl_._has_bits_[0], 0x00000020U); + SetHasBit(_impl_._has_bits_[0], 0x00000080U); // @@protoc_insertion_point(field_set:xtcp_config.v1.ListenerAuth.signed_token_skew_minutes) } inline ::uint32_t ListenerAuth::_internal_signed_token_skew_minutes() const { @@ -7574,7 +7969,7 @@ inline void ListenerAuth::_internal_set_signed_token_skew_minutes(::uint32_t val // .google.protobuf.Duration failure_jitter_min = 5 [json_name = "failureJitterMin", (.buf.validate.field) = { inline bool ListenerAuth::has_failure_jitter_min() const { - bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000004U); + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000010U); PROTOBUF_ASSUME(!value || _impl_.failure_jitter_min_ != nullptr); return value; } @@ -7595,16 +7990,16 @@ inline void ListenerAuth::unsafe_arena_set_allocated_failure_jitter_min( } _impl_.failure_jitter_min_ = reinterpret_cast<::google::protobuf::Duration*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000004U); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.ListenerAuth.failure_jitter_min) } inline ::google::protobuf::Duration* PROTOBUF_NULLABLE ListenerAuth::release_failure_jitter_min() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); ::google::protobuf::Duration* released = _impl_.failure_jitter_min_; _impl_.failure_jitter_min_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -7624,7 +8019,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NULLABLE ListenerAuth::unsafe_aren ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.ListenerAuth.failure_jitter_min) - ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); ::google::protobuf::Duration* temp = _impl_.failure_jitter_min_; _impl_.failure_jitter_min_ = nullptr; return temp; @@ -7639,7 +8034,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NONNULL ListenerAuth::_internal_mu } inline ::google::protobuf::Duration* PROTOBUF_NONNULL ListenerAuth::mutable_failure_jitter_min() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000004U); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); ::google::protobuf::Duration* _msg = _internal_mutable_failure_jitter_min(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.ListenerAuth.failure_jitter_min) return _msg; @@ -7656,9 +8051,9 @@ inline void ListenerAuth::set_allocated_failure_jitter_min(::google::protobuf::D if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[0], 0x00000004U); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); } _impl_.failure_jitter_min_ = reinterpret_cast<::google::protobuf::Duration*>(value); @@ -7667,7 +8062,7 @@ inline void ListenerAuth::set_allocated_failure_jitter_min(::google::protobuf::D // .google.protobuf.Duration failure_jitter_max = 6 [json_name = "failureJitterMax", (.buf.validate.field) = { inline bool ListenerAuth::has_failure_jitter_max() const { - bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000008U); + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000020U); PROTOBUF_ASSUME(!value || _impl_.failure_jitter_max_ != nullptr); return value; } @@ -7688,16 +8083,16 @@ inline void ListenerAuth::unsafe_arena_set_allocated_failure_jitter_max( } _impl_.failure_jitter_max_ = reinterpret_cast<::google::protobuf::Duration*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000008U); + SetHasBit(_impl_._has_bits_[0], 0x00000020U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + ClearHasBit(_impl_._has_bits_[0], 0x00000020U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.ListenerAuth.failure_jitter_max) } inline ::google::protobuf::Duration* PROTOBUF_NULLABLE ListenerAuth::release_failure_jitter_max() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + ClearHasBit(_impl_._has_bits_[0], 0x00000020U); ::google::protobuf::Duration* released = _impl_.failure_jitter_max_; _impl_.failure_jitter_max_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -7717,7 +8112,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NULLABLE ListenerAuth::unsafe_aren ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.ListenerAuth.failure_jitter_max) - ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + ClearHasBit(_impl_._has_bits_[0], 0x00000020U); ::google::protobuf::Duration* temp = _impl_.failure_jitter_max_; _impl_.failure_jitter_max_ = nullptr; return temp; @@ -7732,7 +8127,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NONNULL ListenerAuth::_internal_mu } inline ::google::protobuf::Duration* PROTOBUF_NONNULL ListenerAuth::mutable_failure_jitter_max() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000008U); + SetHasBit(_impl_._has_bits_[0], 0x00000020U); ::google::protobuf::Duration* _msg = _internal_mutable_failure_jitter_max(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.ListenerAuth.failure_jitter_max) return _msg; @@ -7749,15 +8144,556 @@ inline void ListenerAuth::set_allocated_failure_jitter_max(::google::protobuf::D if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[0], 0x00000008U); + SetHasBit(_impl_._has_bits_[0], 0x00000020U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + ClearHasBit(_impl_._has_bits_[0], 0x00000020U); } _impl_.failure_jitter_max_ = reinterpret_cast<::google::protobuf::Duration*>(value); // @@protoc_insertion_point(field_set_allocated:xtcp_config.v1.ListenerAuth.failure_jitter_max) } +// string raw_token_file = 7 [json_name = "rawTokenFile", (.buf.validate.field) = { +inline void ListenerAuth::clear_raw_token_file() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.raw_token_file_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); +} +inline const ::std::string& ListenerAuth::raw_token_file() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:xtcp_config.v1.ListenerAuth.raw_token_file) + return _internal_raw_token_file(); +} +template +PROTOBUF_ALWAYS_INLINE void ListenerAuth::set_raw_token_file(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + _impl_.raw_token_file_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:xtcp_config.v1.ListenerAuth.raw_token_file) +} +inline ::std::string* PROTOBUF_NONNULL ListenerAuth::mutable_raw_token_file() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::std::string* _s = _internal_mutable_raw_token_file(); + // @@protoc_insertion_point(field_mutable:xtcp_config.v1.ListenerAuth.raw_token_file) + return _s; +} +inline const ::std::string& ListenerAuth::_internal_raw_token_file() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.raw_token_file_.Get(); +} +inline void ListenerAuth::_internal_set_raw_token_file(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.raw_token_file_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ListenerAuth::_internal_mutable_raw_token_file() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.raw_token_file_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ListenerAuth::release_raw_token_file() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:xtcp_config.v1.ListenerAuth.raw_token_file) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + auto* released = _impl_.raw_token_file_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.raw_token_file_.Set("", GetArena()); + } + return released; +} +inline void ListenerAuth::set_allocated_raw_token_file(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + _impl_.raw_token_file_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.raw_token_file_.IsDefault()) { + _impl_.raw_token_file_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:xtcp_config.v1.ListenerAuth.raw_token_file) +} + +// string hmac_shared_key_file = 8 [json_name = "hmacSharedKeyFile", (.buf.validate.field) = { +inline void ListenerAuth::clear_hmac_shared_key_file() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.hmac_shared_key_file_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); +} +inline const ::std::string& ListenerAuth::hmac_shared_key_file() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:xtcp_config.v1.ListenerAuth.hmac_shared_key_file) + return _internal_hmac_shared_key_file(); +} +template +PROTOBUF_ALWAYS_INLINE void ListenerAuth::set_hmac_shared_key_file(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + _impl_.hmac_shared_key_file_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:xtcp_config.v1.ListenerAuth.hmac_shared_key_file) +} +inline ::std::string* PROTOBUF_NONNULL ListenerAuth::mutable_hmac_shared_key_file() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + ::std::string* _s = _internal_mutable_hmac_shared_key_file(); + // @@protoc_insertion_point(field_mutable:xtcp_config.v1.ListenerAuth.hmac_shared_key_file) + return _s; +} +inline const ::std::string& ListenerAuth::_internal_hmac_shared_key_file() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.hmac_shared_key_file_.Get(); +} +inline void ListenerAuth::_internal_set_hmac_shared_key_file(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.hmac_shared_key_file_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ListenerAuth::_internal_mutable_hmac_shared_key_file() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.hmac_shared_key_file_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ListenerAuth::release_hmac_shared_key_file() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:xtcp_config.v1.ListenerAuth.hmac_shared_key_file) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000008U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + auto* released = _impl_.hmac_shared_key_file_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.hmac_shared_key_file_.Set("", GetArena()); + } + return released; +} +inline void ListenerAuth::set_allocated_hmac_shared_key_file(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + } + _impl_.hmac_shared_key_file_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.hmac_shared_key_file_.IsDefault()) { + _impl_.hmac_shared_key_file_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:xtcp_config.v1.ListenerAuth.hmac_shared_key_file) +} + +// ------------------------------------------------------------------- + +// Listener + +// string name = 1 [json_name = "name", (.buf.validate.field) = { +inline void Listener::clear_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.name_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); +} +inline const ::std::string& Listener::name() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:xtcp_config.v1.Listener.name) + return _internal_name(); +} +template +PROTOBUF_ALWAYS_INLINE void Listener::set_name(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:xtcp_config.v1.Listener.name) +} +inline ::std::string* PROTOBUF_NONNULL Listener::mutable_name() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:xtcp_config.v1.Listener.name) + return _s; +} +inline const ::std::string& Listener::_internal_name() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.name_.Get(); +} +inline void Listener::_internal_set_name(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.name_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL Listener::_internal_mutable_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.name_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE Listener::release_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:xtcp_config.v1.Listener.name) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.name_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.name_.Set("", GetArena()); + } + return released; +} +inline void Listener::set_allocated_name(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + _impl_.name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:xtcp_config.v1.Listener.name) +} + +// .xtcp_config.v1.ListenerEndpoint endpoint = 2 [json_name = "endpoint", (.buf.validate.field) = { +inline bool Listener::has_endpoint() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000004U); + PROTOBUF_ASSUME(!value || _impl_.endpoint_ != nullptr); + return value; +} +inline void Listener::clear_endpoint() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.endpoint_ != nullptr) _impl_.endpoint_->Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); +} +inline const ::xtcp_config::v1::ListenerEndpoint& Listener::_internal_endpoint() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::xtcp_config::v1::ListenerEndpoint* p = _impl_.endpoint_; + return p != nullptr ? *p : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::xtcp_config::v1::ListenerEndpoint>(&::xtcp_config::v1::ListenerEndpoint_globals_); +} +inline const ::xtcp_config::v1::ListenerEndpoint& Listener::endpoint() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:xtcp_config.v1.Listener.endpoint) + return _internal_endpoint(); +} +inline void Listener::unsafe_arena_set_allocated_endpoint( + ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.endpoint_); + } + _impl_.endpoint_ = reinterpret_cast<::xtcp_config::v1::ListenerEndpoint*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.Listener.endpoint) +} +inline ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NULLABLE Listener::release_endpoint() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ::xtcp_config::v1::ListenerEndpoint* released = _impl_.endpoint_; + _impl_.endpoint_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NULLABLE Listener::unsafe_arena_release_endpoint() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:xtcp_config.v1.Listener.endpoint) + + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ::xtcp_config::v1::ListenerEndpoint* temp = _impl_.endpoint_; + _impl_.endpoint_ = nullptr; + return temp; +} +inline ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NONNULL Listener::_internal_mutable_endpoint() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.endpoint_ == nullptr) { + auto* p = Super_::DefaultConstruct<::xtcp_config::v1::ListenerEndpoint>(GetArena()); + _impl_.endpoint_ = reinterpret_cast<::xtcp_config::v1::ListenerEndpoint*>(p); + } + return _impl_.endpoint_; +} +inline ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NONNULL Listener::mutable_endpoint() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::xtcp_config::v1::ListenerEndpoint* _msg = _internal_mutable_endpoint(); + // @@protoc_insertion_point(field_mutable:xtcp_config.v1.Listener.endpoint) + return _msg; +} +inline void Listener::set_allocated_endpoint(::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.endpoint_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + + _impl_.endpoint_ = reinterpret_cast<::xtcp_config::v1::ListenerEndpoint*>(value); + // @@protoc_insertion_point(field_set_allocated:xtcp_config.v1.Listener.endpoint) +} + +// .xtcp_config.v1.ListenerAuth auth = 3 [json_name = "auth"]; +inline bool Listener::has_auth() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000008U); + PROTOBUF_ASSUME(!value || _impl_.auth_ != nullptr); + return value; +} +inline void Listener::clear_auth() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.auth_ != nullptr) _impl_.auth_->Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); +} +inline const ::xtcp_config::v1::ListenerAuth& Listener::_internal_auth() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::xtcp_config::v1::ListenerAuth* p = _impl_.auth_; + return p != nullptr ? *p : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::xtcp_config::v1::ListenerAuth>(&::xtcp_config::v1::ListenerAuth_globals_); +} +inline const ::xtcp_config::v1::ListenerAuth& Listener::auth() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:xtcp_config.v1.Listener.auth) + return _internal_auth(); +} +inline void Listener::unsafe_arena_set_allocated_auth( + ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.auth_); + } + _impl_.auth_ = reinterpret_cast<::xtcp_config::v1::ListenerAuth*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.Listener.auth) +} +inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE Listener::release_auth() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + ::xtcp_config::v1::ListenerAuth* released = _impl_.auth_; + _impl_.auth_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE Listener::unsafe_arena_release_auth() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:xtcp_config.v1.Listener.auth) + + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + ::xtcp_config::v1::ListenerAuth* temp = _impl_.auth_; + _impl_.auth_ = nullptr; + return temp; +} +inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NONNULL Listener::_internal_mutable_auth() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.auth_ == nullptr) { + auto* p = Super_::DefaultConstruct<::xtcp_config::v1::ListenerAuth>(GetArena()); + _impl_.auth_ = reinterpret_cast<::xtcp_config::v1::ListenerAuth*>(p); + } + return _impl_.auth_; +} +inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NONNULL Listener::mutable_auth() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + ::xtcp_config::v1::ListenerAuth* _msg = _internal_mutable_auth(); + // @@protoc_insertion_point(field_mutable:xtcp_config.v1.Listener.auth) + return _msg; +} +inline void Listener::set_allocated_auth(::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.auth_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + } + + _impl_.auth_ = reinterpret_cast<::xtcp_config::v1::ListenerAuth*>(value); + // @@protoc_insertion_point(field_set_allocated:xtcp_config.v1.Listener.auth) +} + +// .xtcp_config.v1.ListenerAuth admin_auth = 4 [json_name = "adminAuth"]; +inline bool Listener::has_admin_auth() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000010U); + PROTOBUF_ASSUME(!value || _impl_.admin_auth_ != nullptr); + return value; +} +inline void Listener::clear_admin_auth() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.admin_auth_ != nullptr) _impl_.admin_auth_->Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); +} +inline const ::xtcp_config::v1::ListenerAuth& Listener::_internal_admin_auth() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::xtcp_config::v1::ListenerAuth* p = _impl_.admin_auth_; + return p != nullptr ? *p : *::google::protobuf::internal::MessageGlobalsBase::ToDefaultInstance<::xtcp_config::v1::ListenerAuth>(&::xtcp_config::v1::ListenerAuth_globals_); +} +inline const ::xtcp_config::v1::ListenerAuth& Listener::admin_auth() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:xtcp_config.v1.Listener.admin_auth) + return _internal_admin_auth(); +} +inline void Listener::unsafe_arena_set_allocated_admin_auth( + ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.admin_auth_); + } + _impl_.admin_auth_ = reinterpret_cast<::xtcp_config::v1::ListenerAuth*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.Listener.admin_auth) +} +inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE Listener::release_admin_auth() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); + ::xtcp_config::v1::ListenerAuth* released = _impl_.admin_auth_; + _impl_.admin_auth_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE Listener::unsafe_arena_release_admin_auth() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:xtcp_config.v1.Listener.admin_auth) + + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); + ::xtcp_config::v1::ListenerAuth* temp = _impl_.admin_auth_; + _impl_.admin_auth_ = nullptr; + return temp; +} +inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NONNULL Listener::_internal_mutable_admin_auth() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.admin_auth_ == nullptr) { + auto* p = Super_::DefaultConstruct<::xtcp_config::v1::ListenerAuth>(GetArena()); + _impl_.admin_auth_ = reinterpret_cast<::xtcp_config::v1::ListenerAuth*>(p); + } + return _impl_.admin_auth_; +} +inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NONNULL Listener::mutable_admin_auth() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + ::xtcp_config::v1::ListenerAuth* _msg = _internal_mutable_admin_auth(); + // @@protoc_insertion_point(field_mutable:xtcp_config.v1.Listener.admin_auth) + return _msg; +} +inline void Listener::set_allocated_admin_auth(::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.admin_auth_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); + } + + _impl_.admin_auth_ = reinterpret_cast<::xtcp_config::v1::ListenerAuth*>(value); + // @@protoc_insertion_point(field_set_allocated:xtcp_config.v1.Listener.admin_auth) +} + +// repeated .xtcp_config.v1.EndpointClass serves = 5 [json_name = "serves", (.buf.validate.field) = { +inline int Listener::_internal_serves_size() const { + return _internal_serves().size(); +} +inline int Listener::serves_size() const { + return _internal_serves_size(); +} +inline void Listener::clear_serves() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.serves_.Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); +} +inline ::xtcp_config::v1::EndpointClass Listener::serves(int index) const { + // @@protoc_insertion_point(field_get:xtcp_config.v1.Listener.serves) + return static_cast<::xtcp_config::v1::EndpointClass>(_internal_serves().Get(index)); +} +inline void Listener::set_serves(int index, ::xtcp_config::v1::EndpointClass value) { + _internal_mutable_serves()->Set(index, value); + // @@protoc_insertion_point(field_set:xtcp_config.v1.Listener.serves) +} +inline void Listener::add_serves(::xtcp_config::v1::EndpointClass value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _internal_mutable_serves() + ->InternalAddWithArena( + internal_visibility(), this, value); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_add:xtcp_config.v1.Listener.serves) +} +inline const ::google::protobuf::RepeatedField& Listener::serves() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:xtcp_config.v1.Listener.serves) + return _internal_serves(); +} +inline ::google::protobuf::RepeatedField* PROTOBUF_NONNULL Listener::mutable_serves() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_mutable_list:xtcp_config.v1.Listener.serves) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_serves(); +} +inline const ::google::protobuf::RepeatedField& Listener::_internal_serves() + const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.serves_; +} +inline ::google::protobuf::RepeatedField* PROTOBUF_NONNULL +Listener::_internal_mutable_serves() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.serves_; +} + // ------------------------------------------------------------------- // LinkMonitorConfig @@ -10246,7 +11182,7 @@ inline void XtcpConfig::_internal_set_io_uring_cqe_batch_size(::uint32_t value) // .google.protobuf.Duration reconcile_frequency = 40 [json_name = "reconcileFrequency", (.buf.validate.field) = { inline bool XtcpConfig::has_reconcile_frequency() const { - bool value = CheckHasBit(_impl_._has_bits_[1], 0x00008000U); + bool value = CheckHasBit(_impl_._has_bits_[1], 0x00010000U); PROTOBUF_ASSUME(!value || _impl_.reconcile_frequency_ != nullptr); return value; } @@ -10267,16 +11203,16 @@ inline void XtcpConfig::unsafe_arena_set_allocated_reconcile_frequency( } _impl_.reconcile_frequency_ = reinterpret_cast<::google::protobuf::Duration*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00008000U); + SetHasBit(_impl_._has_bits_[1], 0x00010000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00008000U); + ClearHasBit(_impl_._has_bits_[1], 0x00010000U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.XtcpConfig.reconcile_frequency) } inline ::google::protobuf::Duration* PROTOBUF_NULLABLE XtcpConfig::release_reconcile_frequency() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[1], 0x00008000U); + ClearHasBit(_impl_._has_bits_[1], 0x00010000U); ::google::protobuf::Duration* released = _impl_.reconcile_frequency_; _impl_.reconcile_frequency_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -10296,7 +11232,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NULLABLE XtcpConfig::unsafe_arena_ ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.reconcile_frequency) - ClearHasBit(_impl_._has_bits_[1], 0x00008000U); + ClearHasBit(_impl_._has_bits_[1], 0x00010000U); ::google::protobuf::Duration* temp = _impl_.reconcile_frequency_; _impl_.reconcile_frequency_ = nullptr; return temp; @@ -10311,7 +11247,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NONNULL XtcpConfig::_internal_muta } inline ::google::protobuf::Duration* PROTOBUF_NONNULL XtcpConfig::mutable_reconcile_frequency() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00008000U); + SetHasBit(_impl_._has_bits_[1], 0x00010000U); ::google::protobuf::Duration* _msg = _internal_mutable_reconcile_frequency(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.reconcile_frequency) return _msg; @@ -10328,9 +11264,9 @@ inline void XtcpConfig::set_allocated_reconcile_frequency(::google::protobuf::Du if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[1], 0x00008000U); + SetHasBit(_impl_._has_bits_[1], 0x00010000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00008000U); + ClearHasBit(_impl_._has_bits_[1], 0x00010000U); } _impl_.reconcile_frequency_ = reinterpret_cast<::google::protobuf::Duration*>(value); @@ -10365,7 +11301,7 @@ inline void XtcpConfig::_internal_set_reconcile_before_poll(bool value) { inline void XtcpConfig::clear_write_files() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.write_files_ = 0u; - ClearHasBit(_impl_._has_bits_[1], 0x04000000U); + ClearHasBit(_impl_._has_bits_[1], 0x08000000U); } inline ::uint32_t XtcpConfig::write_files() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.write_files) @@ -10373,7 +11309,7 @@ inline ::uint32_t XtcpConfig::write_files() const { } inline void XtcpConfig::set_write_files(::uint32_t value) { _internal_set_write_files(value); - SetHasBit(_impl_._has_bits_[1], 0x04000000U); + SetHasBit(_impl_._has_bits_[1], 0x08000000U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.write_files) } inline ::uint32_t XtcpConfig::_internal_write_files() const { @@ -10389,7 +11325,7 @@ inline void XtcpConfig::_internal_set_write_files(::uint32_t value) { inline void XtcpConfig::clear_capture_path() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.capture_path_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], 0x00800000U); + ClearHasBit(_impl_._has_bits_[0], 0x01000000U); } inline const ::std::string& XtcpConfig::capture_path() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -10399,13 +11335,13 @@ inline const ::std::string& XtcpConfig::capture_path() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_capture_path(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00800000U); + SetHasBit(_impl_._has_bits_[0], 0x01000000U); _impl_.capture_path_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.capture_path) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_capture_path() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00800000U); + SetHasBit(_impl_._has_bits_[0], 0x01000000U); ::std::string* _s = _internal_mutable_capture_path(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.capture_path) return _s; @@ -10425,10 +11361,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_capture_pat inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_capture_path() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.capture_path) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00800000U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x01000000U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00800000U); + ClearHasBit(_impl_._has_bits_[0], 0x01000000U); auto* released = _impl_.capture_path_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.capture_path_.Set("", GetArena()); @@ -10438,9 +11374,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_capture_path() { inline void XtcpConfig::set_allocated_capture_path(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00800000U); + SetHasBit(_impl_._has_bits_[0], 0x01000000U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00800000U); + ClearHasBit(_impl_._has_bits_[0], 0x01000000U); } _impl_.capture_path_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.capture_path_.IsDefault()) { @@ -10453,7 +11389,7 @@ inline void XtcpConfig::set_allocated_capture_path(::std::string* PROTOBUF_NULLA inline void XtcpConfig::clear_dest_write_files() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.dest_write_files_ = 0u; - ClearHasBit(_impl_._has_bits_[1], 0x08000000U); + ClearHasBit(_impl_._has_bits_[1], 0x10000000U); } inline ::uint32_t XtcpConfig::dest_write_files() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.dest_write_files) @@ -10461,7 +11397,7 @@ inline ::uint32_t XtcpConfig::dest_write_files() const { } inline void XtcpConfig::set_dest_write_files(::uint32_t value) { _internal_set_dest_write_files(value); - SetHasBit(_impl_._has_bits_[1], 0x08000000U); + SetHasBit(_impl_._has_bits_[1], 0x10000000U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.dest_write_files) } inline ::uint32_t XtcpConfig::_internal_dest_write_files() const { @@ -10477,7 +11413,7 @@ inline void XtcpConfig::_internal_set_dest_write_files(::uint32_t value) { inline void XtcpConfig::clear_debug_level() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.debug_level_ = 0u; - ClearHasBit(_impl_._has_bits_[1], 0x10000000U); + ClearHasBit(_impl_._has_bits_[1], 0x20000000U); } inline ::uint32_t XtcpConfig::debug_level() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.debug_level) @@ -10485,7 +11421,7 @@ inline ::uint32_t XtcpConfig::debug_level() const { } inline void XtcpConfig::set_debug_level(::uint32_t value) { _internal_set_debug_level(value); - SetHasBit(_impl_._has_bits_[1], 0x10000000U); + SetHasBit(_impl_._has_bits_[1], 0x20000000U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.debug_level) } inline ::uint32_t XtcpConfig::_internal_debug_level() const { @@ -10501,7 +11437,7 @@ inline void XtcpConfig::_internal_set_debug_level(::uint32_t value) { inline void XtcpConfig::clear_debug_prometheus() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.debug_prometheus_ = false; - ClearHasBit(_impl_._has_bits_[2], 0x00000040U); + ClearHasBit(_impl_._has_bits_[2], 0x00000080U); } inline bool XtcpConfig::debug_prometheus() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.debug_prometheus) @@ -10509,7 +11445,7 @@ inline bool XtcpConfig::debug_prometheus() const { } inline void XtcpConfig::set_debug_prometheus(bool value) { _internal_set_debug_prometheus(value); - SetHasBit(_impl_._has_bits_[2], 0x00000040U); + SetHasBit(_impl_._has_bits_[2], 0x00000080U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.debug_prometheus) } inline bool XtcpConfig::_internal_debug_prometheus() const { @@ -10781,7 +11717,7 @@ inline void XtcpConfig::set_allocated_xtcp_proto_file(::std::string* PROTOBUF_NU inline void XtcpConfig::clear_envelope_flush_threshold_bytes() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.envelope_flush_threshold_bytes_ = 0u; - ClearHasBit(_impl_._has_bits_[1], 0x20000000U); + ClearHasBit(_impl_._has_bits_[1], 0x40000000U); } inline ::uint32_t XtcpConfig::envelope_flush_threshold_bytes() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.envelope_flush_threshold_bytes) @@ -10789,7 +11725,7 @@ inline ::uint32_t XtcpConfig::envelope_flush_threshold_bytes() const { } inline void XtcpConfig::set_envelope_flush_threshold_bytes(::uint32_t value) { _internal_set_envelope_flush_threshold_bytes(value); - SetHasBit(_impl_._has_bits_[1], 0x20000000U); + SetHasBit(_impl_._has_bits_[1], 0x40000000U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.envelope_flush_threshold_bytes) } inline ::uint32_t XtcpConfig::_internal_envelope_flush_threshold_bytes() const { @@ -10805,7 +11741,7 @@ inline void XtcpConfig::_internal_set_envelope_flush_threshold_bytes(::uint32_t inline void XtcpConfig::clear_envelope_flush_threshold_rows() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.envelope_flush_threshold_rows_ = 0u; - ClearHasBit(_impl_._has_bits_[1], 0x40000000U); + ClearHasBit(_impl_._has_bits_[1], 0x80000000U); } inline ::uint32_t XtcpConfig::envelope_flush_threshold_rows() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.envelope_flush_threshold_rows) @@ -10813,7 +11749,7 @@ inline ::uint32_t XtcpConfig::envelope_flush_threshold_rows() const { } inline void XtcpConfig::set_envelope_flush_threshold_rows(::uint32_t value) { _internal_set_envelope_flush_threshold_rows(value); - SetHasBit(_impl_._has_bits_[1], 0x40000000U); + SetHasBit(_impl_._has_bits_[1], 0x80000000U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.envelope_flush_threshold_rows) } inline ::uint32_t XtcpConfig::_internal_envelope_flush_threshold_rows() const { @@ -10829,7 +11765,7 @@ inline void XtcpConfig::_internal_set_envelope_flush_threshold_rows(::uint32_t v inline void XtcpConfig::clear_topic() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.topic_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], 0x01000000U); + ClearHasBit(_impl_._has_bits_[0], 0x02000000U); } inline const ::std::string& XtcpConfig::topic() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -10839,13 +11775,13 @@ inline const ::std::string& XtcpConfig::topic() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_topic(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x01000000U); + SetHasBit(_impl_._has_bits_[0], 0x02000000U); _impl_.topic_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.topic) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_topic() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x01000000U); + SetHasBit(_impl_._has_bits_[0], 0x02000000U); ::std::string* _s = _internal_mutable_topic(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.topic) return _s; @@ -10865,10 +11801,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_topic() { inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_topic() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.topic) - if (!CheckHasBit(_impl_._has_bits_[0], 0x01000000U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x02000000U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x01000000U); + ClearHasBit(_impl_._has_bits_[0], 0x02000000U); auto* released = _impl_.topic_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.topic_.Set("", GetArena()); @@ -10878,9 +11814,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_topic() { inline void XtcpConfig::set_allocated_topic(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x01000000U); + SetHasBit(_impl_._has_bits_[0], 0x02000000U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x01000000U); + ClearHasBit(_impl_._has_bits_[0], 0x02000000U); } _impl_.topic_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.topic_.IsDefault()) { @@ -10893,7 +11829,7 @@ inline void XtcpConfig::set_allocated_topic(::std::string* PROTOBUF_NULLABLE val inline void XtcpConfig::clear_kafka_schema_url() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.kafka_schema_url_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], 0x02000000U); + ClearHasBit(_impl_._has_bits_[0], 0x04000000U); } inline const ::std::string& XtcpConfig::kafka_schema_url() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -10903,13 +11839,13 @@ inline const ::std::string& XtcpConfig::kafka_schema_url() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_kafka_schema_url(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x02000000U); + SetHasBit(_impl_._has_bits_[0], 0x04000000U); _impl_.kafka_schema_url_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.kafka_schema_url) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_kafka_schema_url() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x02000000U); + SetHasBit(_impl_._has_bits_[0], 0x04000000U); ::std::string* _s = _internal_mutable_kafka_schema_url(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.kafka_schema_url) return _s; @@ -10929,10 +11865,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_kafka_schem inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_kafka_schema_url() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.kafka_schema_url) - if (!CheckHasBit(_impl_._has_bits_[0], 0x02000000U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x04000000U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x02000000U); + ClearHasBit(_impl_._has_bits_[0], 0x04000000U); auto* released = _impl_.kafka_schema_url_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.kafka_schema_url_.Set("", GetArena()); @@ -10942,9 +11878,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_kafka_schema_url() { inline void XtcpConfig::set_allocated_kafka_schema_url(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x02000000U); + SetHasBit(_impl_._has_bits_[0], 0x04000000U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x02000000U); + ClearHasBit(_impl_._has_bits_[0], 0x04000000U); } _impl_.kafka_schema_url_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.kafka_schema_url_.IsDefault()) { @@ -10955,7 +11891,7 @@ inline void XtcpConfig::set_allocated_kafka_schema_url(::std::string* PROTOBUF_N // .google.protobuf.Duration kafka_produce_timeout = 82 [json_name = "kafkaProduceTimeout", (.buf.validate.field) = { inline bool XtcpConfig::has_kafka_produce_timeout() const { - bool value = CheckHasBit(_impl_._has_bits_[1], 0x00010000U); + bool value = CheckHasBit(_impl_._has_bits_[1], 0x00020000U); PROTOBUF_ASSUME(!value || _impl_.kafka_produce_timeout_ != nullptr); return value; } @@ -10976,16 +11912,16 @@ inline void XtcpConfig::unsafe_arena_set_allocated_kafka_produce_timeout( } _impl_.kafka_produce_timeout_ = reinterpret_cast<::google::protobuf::Duration*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00010000U); + SetHasBit(_impl_._has_bits_[1], 0x00020000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00010000U); + ClearHasBit(_impl_._has_bits_[1], 0x00020000U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.XtcpConfig.kafka_produce_timeout) } inline ::google::protobuf::Duration* PROTOBUF_NULLABLE XtcpConfig::release_kafka_produce_timeout() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[1], 0x00010000U); + ClearHasBit(_impl_._has_bits_[1], 0x00020000U); ::google::protobuf::Duration* released = _impl_.kafka_produce_timeout_; _impl_.kafka_produce_timeout_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -11005,7 +11941,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NULLABLE XtcpConfig::unsafe_arena_ ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.kafka_produce_timeout) - ClearHasBit(_impl_._has_bits_[1], 0x00010000U); + ClearHasBit(_impl_._has_bits_[1], 0x00020000U); ::google::protobuf::Duration* temp = _impl_.kafka_produce_timeout_; _impl_.kafka_produce_timeout_ = nullptr; return temp; @@ -11020,7 +11956,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NONNULL XtcpConfig::_internal_muta } inline ::google::protobuf::Duration* PROTOBUF_NONNULL XtcpConfig::mutable_kafka_produce_timeout() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00010000U); + SetHasBit(_impl_._has_bits_[1], 0x00020000U); ::google::protobuf::Duration* _msg = _internal_mutable_kafka_produce_timeout(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.kafka_produce_timeout) return _msg; @@ -11037,9 +11973,9 @@ inline void XtcpConfig::set_allocated_kafka_produce_timeout(::google::protobuf:: if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[1], 0x00010000U); + SetHasBit(_impl_._has_bits_[1], 0x00020000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00010000U); + ClearHasBit(_impl_._has_bits_[1], 0x00020000U); } _impl_.kafka_produce_timeout_ = reinterpret_cast<::google::protobuf::Duration*>(value); @@ -11050,7 +11986,7 @@ inline void XtcpConfig::set_allocated_kafka_produce_timeout(::google::protobuf:: inline void XtcpConfig::clear_kafka_compression() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.kafka_compression_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], 0x04000000U); + ClearHasBit(_impl_._has_bits_[0], 0x08000000U); } inline const ::std::string& XtcpConfig::kafka_compression() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -11060,13 +11996,13 @@ inline const ::std::string& XtcpConfig::kafka_compression() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_kafka_compression(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x04000000U); + SetHasBit(_impl_._has_bits_[0], 0x08000000U); _impl_.kafka_compression_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.kafka_compression) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_kafka_compression() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x04000000U); + SetHasBit(_impl_._has_bits_[0], 0x08000000U); ::std::string* _s = _internal_mutable_kafka_compression(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.kafka_compression) return _s; @@ -11086,10 +12022,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_kafka_compr inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_kafka_compression() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.kafka_compression) - if (!CheckHasBit(_impl_._has_bits_[0], 0x04000000U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x08000000U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x04000000U); + ClearHasBit(_impl_._has_bits_[0], 0x08000000U); auto* released = _impl_.kafka_compression_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.kafka_compression_.Set("", GetArena()); @@ -11099,9 +12035,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_kafka_compression() inline void XtcpConfig::set_allocated_kafka_compression(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x04000000U); + SetHasBit(_impl_._has_bits_[0], 0x08000000U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x04000000U); + ClearHasBit(_impl_._has_bits_[0], 0x08000000U); } _impl_.kafka_compression_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.kafka_compression_.IsDefault()) { @@ -11114,7 +12050,7 @@ inline void XtcpConfig::set_allocated_kafka_compression(::std::string* PROTOBUF_ inline void XtcpConfig::clear_s3_endpoint() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.s3_endpoint_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], 0x08000000U); + ClearHasBit(_impl_._has_bits_[0], 0x10000000U); } inline const ::std::string& XtcpConfig::s3_endpoint() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -11124,13 +12060,13 @@ inline const ::std::string& XtcpConfig::s3_endpoint() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_s3_endpoint(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x08000000U); + SetHasBit(_impl_._has_bits_[0], 0x10000000U); _impl_.s3_endpoint_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.s3_endpoint) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_s3_endpoint() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x08000000U); + SetHasBit(_impl_._has_bits_[0], 0x10000000U); ::std::string* _s = _internal_mutable_s3_endpoint(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.s3_endpoint) return _s; @@ -11150,10 +12086,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_s3_endpoint inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_endpoint() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.s3_endpoint) - if (!CheckHasBit(_impl_._has_bits_[0], 0x08000000U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x10000000U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x08000000U); + ClearHasBit(_impl_._has_bits_[0], 0x10000000U); auto* released = _impl_.s3_endpoint_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.s3_endpoint_.Set("", GetArena()); @@ -11163,9 +12099,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_endpoint() { inline void XtcpConfig::set_allocated_s3_endpoint(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x08000000U); + SetHasBit(_impl_._has_bits_[0], 0x10000000U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x08000000U); + ClearHasBit(_impl_._has_bits_[0], 0x10000000U); } _impl_.s3_endpoint_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.s3_endpoint_.IsDefault()) { @@ -11178,7 +12114,7 @@ inline void XtcpConfig::set_allocated_s3_endpoint(::std::string* PROTOBUF_NULLAB inline void XtcpConfig::clear_s3_region() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.s3_region_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], 0x10000000U); + ClearHasBit(_impl_._has_bits_[0], 0x20000000U); } inline const ::std::string& XtcpConfig::s3_region() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -11188,13 +12124,13 @@ inline const ::std::string& XtcpConfig::s3_region() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_s3_region(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x10000000U); + SetHasBit(_impl_._has_bits_[0], 0x20000000U); _impl_.s3_region_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.s3_region) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_s3_region() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x10000000U); + SetHasBit(_impl_._has_bits_[0], 0x20000000U); ::std::string* _s = _internal_mutable_s3_region(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.s3_region) return _s; @@ -11214,10 +12150,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_s3_region() inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_region() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.s3_region) - if (!CheckHasBit(_impl_._has_bits_[0], 0x10000000U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x20000000U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x10000000U); + ClearHasBit(_impl_._has_bits_[0], 0x20000000U); auto* released = _impl_.s3_region_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.s3_region_.Set("", GetArena()); @@ -11227,9 +12163,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_region() { inline void XtcpConfig::set_allocated_s3_region(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x10000000U); + SetHasBit(_impl_._has_bits_[0], 0x20000000U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x10000000U); + ClearHasBit(_impl_._has_bits_[0], 0x20000000U); } _impl_.s3_region_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.s3_region_.IsDefault()) { @@ -11242,7 +12178,7 @@ inline void XtcpConfig::set_allocated_s3_region(::std::string* PROTOBUF_NULLABLE inline void XtcpConfig::clear_s3_bucket() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.s3_bucket_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], 0x20000000U); + ClearHasBit(_impl_._has_bits_[0], 0x40000000U); } inline const ::std::string& XtcpConfig::s3_bucket() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -11252,13 +12188,13 @@ inline const ::std::string& XtcpConfig::s3_bucket() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_s3_bucket(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x20000000U); + SetHasBit(_impl_._has_bits_[0], 0x40000000U); _impl_.s3_bucket_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.s3_bucket) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_s3_bucket() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x20000000U); + SetHasBit(_impl_._has_bits_[0], 0x40000000U); ::std::string* _s = _internal_mutable_s3_bucket(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.s3_bucket) return _s; @@ -11278,10 +12214,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_s3_bucket() inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_bucket() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.s3_bucket) - if (!CheckHasBit(_impl_._has_bits_[0], 0x20000000U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x40000000U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x20000000U); + ClearHasBit(_impl_._has_bits_[0], 0x40000000U); auto* released = _impl_.s3_bucket_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.s3_bucket_.Set("", GetArena()); @@ -11291,9 +12227,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_bucket() { inline void XtcpConfig::set_allocated_s3_bucket(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x20000000U); + SetHasBit(_impl_._has_bits_[0], 0x40000000U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x20000000U); + ClearHasBit(_impl_._has_bits_[0], 0x40000000U); } _impl_.s3_bucket_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.s3_bucket_.IsDefault()) { @@ -11306,7 +12242,7 @@ inline void XtcpConfig::set_allocated_s3_bucket(::std::string* PROTOBUF_NULLABLE inline void XtcpConfig::clear_s3_prefix() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.s3_prefix_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], 0x40000000U); + ClearHasBit(_impl_._has_bits_[0], 0x80000000U); } inline const ::std::string& XtcpConfig::s3_prefix() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -11316,13 +12252,13 @@ inline const ::std::string& XtcpConfig::s3_prefix() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_s3_prefix(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x40000000U); + SetHasBit(_impl_._has_bits_[0], 0x80000000U); _impl_.s3_prefix_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.s3_prefix) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_s3_prefix() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x40000000U); + SetHasBit(_impl_._has_bits_[0], 0x80000000U); ::std::string* _s = _internal_mutable_s3_prefix(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.s3_prefix) return _s; @@ -11342,10 +12278,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_s3_prefix() inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_prefix() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.s3_prefix) - if (!CheckHasBit(_impl_._has_bits_[0], 0x40000000U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x80000000U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x40000000U); + ClearHasBit(_impl_._has_bits_[0], 0x80000000U); auto* released = _impl_.s3_prefix_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.s3_prefix_.Set("", GetArena()); @@ -11355,9 +12291,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_prefix() { inline void XtcpConfig::set_allocated_s3_prefix(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x40000000U); + SetHasBit(_impl_._has_bits_[0], 0x80000000U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x40000000U); + ClearHasBit(_impl_._has_bits_[0], 0x80000000U); } _impl_.s3_prefix_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.s3_prefix_.IsDefault()) { @@ -11370,7 +12306,7 @@ inline void XtcpConfig::set_allocated_s3_prefix(::std::string* PROTOBUF_NULLABLE inline void XtcpConfig::clear_s3_access_key() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.s3_access_key_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], 0x80000000U); + ClearHasBit(_impl_._has_bits_[1], 0x00000001U); } inline const ::std::string& XtcpConfig::s3_access_key() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -11380,13 +12316,13 @@ inline const ::std::string& XtcpConfig::s3_access_key() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_s3_access_key(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x80000000U); + SetHasBit(_impl_._has_bits_[1], 0x00000001U); _impl_.s3_access_key_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.s3_access_key) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_s3_access_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x80000000U); + SetHasBit(_impl_._has_bits_[1], 0x00000001U); ::std::string* _s = _internal_mutable_s3_access_key(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.s3_access_key) return _s; @@ -11406,10 +12342,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_s3_access_k inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_access_key() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.s3_access_key) - if (!CheckHasBit(_impl_._has_bits_[0], 0x80000000U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00000001U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x80000000U); + ClearHasBit(_impl_._has_bits_[1], 0x00000001U); auto* released = _impl_.s3_access_key_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.s3_access_key_.Set("", GetArena()); @@ -11419,9 +12355,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_access_key() { inline void XtcpConfig::set_allocated_s3_access_key(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x80000000U); + SetHasBit(_impl_._has_bits_[1], 0x00000001U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x80000000U); + ClearHasBit(_impl_._has_bits_[1], 0x00000001U); } _impl_.s3_access_key_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.s3_access_key_.IsDefault()) { @@ -11434,7 +12370,7 @@ inline void XtcpConfig::set_allocated_s3_access_key(::std::string* PROTOBUF_NULL inline void XtcpConfig::clear_s3_secret_key() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.s3_secret_key_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00000001U); + ClearHasBit(_impl_._has_bits_[1], 0x00000002U); } inline const ::std::string& XtcpConfig::s3_secret_key() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -11444,13 +12380,13 @@ inline const ::std::string& XtcpConfig::s3_secret_key() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_s3_secret_key(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00000001U); + SetHasBit(_impl_._has_bits_[1], 0x00000002U); _impl_.s3_secret_key_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.s3_secret_key) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_s3_secret_key() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00000001U); + SetHasBit(_impl_._has_bits_[1], 0x00000002U); ::std::string* _s = _internal_mutable_s3_secret_key(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.s3_secret_key) return _s; @@ -11470,10 +12406,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_s3_secret_k inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_secret_key() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.s3_secret_key) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00000001U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00000002U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00000001U); + ClearHasBit(_impl_._has_bits_[1], 0x00000002U); auto* released = _impl_.s3_secret_key_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.s3_secret_key_.Set("", GetArena()); @@ -11483,9 +12419,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_secret_key() { inline void XtcpConfig::set_allocated_s3_secret_key(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00000001U); + SetHasBit(_impl_._has_bits_[1], 0x00000002U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00000001U); + ClearHasBit(_impl_._has_bits_[1], 0x00000002U); } _impl_.s3_secret_key_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.s3_secret_key_.IsDefault()) { @@ -11546,7 +12482,7 @@ inline void XtcpConfig::_internal_set_s3_allow_insecure(bool value) { inline void XtcpConfig::clear_s3_ca_file() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.s3_ca_file_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00000002U); + ClearHasBit(_impl_._has_bits_[1], 0x00000004U); } inline const ::std::string& XtcpConfig::s3_ca_file() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -11556,13 +12492,13 @@ inline const ::std::string& XtcpConfig::s3_ca_file() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_s3_ca_file(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00000002U); + SetHasBit(_impl_._has_bits_[1], 0x00000004U); _impl_.s3_ca_file_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.s3_ca_file) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_s3_ca_file() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00000002U); + SetHasBit(_impl_._has_bits_[1], 0x00000004U); ::std::string* _s = _internal_mutable_s3_ca_file(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.s3_ca_file) return _s; @@ -11582,10 +12518,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_s3_ca_file( inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_ca_file() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.s3_ca_file) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00000002U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00000004U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00000002U); + ClearHasBit(_impl_._has_bits_[1], 0x00000004U); auto* released = _impl_.s3_ca_file_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.s3_ca_file_.Set("", GetArena()); @@ -11595,9 +12531,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_s3_ca_file() { inline void XtcpConfig::set_allocated_s3_ca_file(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00000002U); + SetHasBit(_impl_._has_bits_[1], 0x00000004U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00000002U); + ClearHasBit(_impl_._has_bits_[1], 0x00000004U); } _impl_.s3_ca_file_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.s3_ca_file_.IsDefault()) { @@ -11610,7 +12546,7 @@ inline void XtcpConfig::set_allocated_s3_ca_file(::std::string* PROTOBUF_NULLABL inline void XtcpConfig::clear_s3_parquet_flush_threshold_bytes() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.s3_parquet_flush_threshold_bytes_ = 0u; - ClearHasBit(_impl_._has_bits_[1], 0x80000000U); + ClearHasBit(_impl_._has_bits_[2], 0x00000001U); } inline ::uint32_t XtcpConfig::s3_parquet_flush_threshold_bytes() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.s3_parquet_flush_threshold_bytes) @@ -11618,7 +12554,7 @@ inline ::uint32_t XtcpConfig::s3_parquet_flush_threshold_bytes() const { } inline void XtcpConfig::set_s3_parquet_flush_threshold_bytes(::uint32_t value) { _internal_set_s3_parquet_flush_threshold_bytes(value); - SetHasBit(_impl_._has_bits_[1], 0x80000000U); + SetHasBit(_impl_._has_bits_[2], 0x00000001U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.s3_parquet_flush_threshold_bytes) } inline ::uint32_t XtcpConfig::_internal_s3_parquet_flush_threshold_bytes() const { @@ -11632,7 +12568,7 @@ inline void XtcpConfig::_internal_set_s3_parquet_flush_threshold_bytes(::uint32_ // .google.protobuf.Duration s3_flush_interval = 111 [json_name = "s3FlushInterval", (.buf.validate.field) = { inline bool XtcpConfig::has_s3_flush_interval() const { - bool value = CheckHasBit(_impl_._has_bits_[1], 0x00020000U); + bool value = CheckHasBit(_impl_._has_bits_[1], 0x00040000U); PROTOBUF_ASSUME(!value || _impl_.s3_flush_interval_ != nullptr); return value; } @@ -11653,16 +12589,16 @@ inline void XtcpConfig::unsafe_arena_set_allocated_s3_flush_interval( } _impl_.s3_flush_interval_ = reinterpret_cast<::google::protobuf::Duration*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00020000U); + SetHasBit(_impl_._has_bits_[1], 0x00040000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00020000U); + ClearHasBit(_impl_._has_bits_[1], 0x00040000U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.XtcpConfig.s3_flush_interval) } inline ::google::protobuf::Duration* PROTOBUF_NULLABLE XtcpConfig::release_s3_flush_interval() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[1], 0x00020000U); + ClearHasBit(_impl_._has_bits_[1], 0x00040000U); ::google::protobuf::Duration* released = _impl_.s3_flush_interval_; _impl_.s3_flush_interval_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -11682,7 +12618,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NULLABLE XtcpConfig::unsafe_arena_ ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.s3_flush_interval) - ClearHasBit(_impl_._has_bits_[1], 0x00020000U); + ClearHasBit(_impl_._has_bits_[1], 0x00040000U); ::google::protobuf::Duration* temp = _impl_.s3_flush_interval_; _impl_.s3_flush_interval_ = nullptr; return temp; @@ -11697,7 +12633,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NONNULL XtcpConfig::_internal_muta } inline ::google::protobuf::Duration* PROTOBUF_NONNULL XtcpConfig::mutable_s3_flush_interval() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00020000U); + SetHasBit(_impl_._has_bits_[1], 0x00040000U); ::google::protobuf::Duration* _msg = _internal_mutable_s3_flush_interval(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.s3_flush_interval) return _msg; @@ -11714,9 +12650,9 @@ inline void XtcpConfig::set_allocated_s3_flush_interval(::google::protobuf::Dura if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[1], 0x00020000U); + SetHasBit(_impl_._has_bits_[1], 0x00040000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00020000U); + ClearHasBit(_impl_._has_bits_[1], 0x00040000U); } _impl_.s3_flush_interval_ = reinterpret_cast<::google::protobuf::Duration*>(value); @@ -11727,7 +12663,7 @@ inline void XtcpConfig::set_allocated_s3_flush_interval(::google::protobuf::Dura inline void XtcpConfig::clear_s3_flush_jitter_pct() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.s3_flush_jitter_pct_ = 0u; - ClearHasBit(_impl_._has_bits_[2], 0x00000001U); + ClearHasBit(_impl_._has_bits_[2], 0x00000002U); } inline ::uint32_t XtcpConfig::s3_flush_jitter_pct() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.s3_flush_jitter_pct) @@ -11735,7 +12671,7 @@ inline ::uint32_t XtcpConfig::s3_flush_jitter_pct() const { } inline void XtcpConfig::set_s3_flush_jitter_pct(::uint32_t value) { _internal_set_s3_flush_jitter_pct(value); - SetHasBit(_impl_._has_bits_[2], 0x00000001U); + SetHasBit(_impl_._has_bits_[2], 0x00000002U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.s3_flush_jitter_pct) } inline ::uint32_t XtcpConfig::_internal_s3_flush_jitter_pct() const { @@ -11751,7 +12687,7 @@ inline void XtcpConfig::_internal_set_s3_flush_jitter_pct(::uint32_t value) { inline void XtcpConfig::clear_s3_flush_threshold_jitter_pct() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.s3_flush_threshold_jitter_pct_ = 0u; - ClearHasBit(_impl_._has_bits_[2], 0x00000002U); + ClearHasBit(_impl_._has_bits_[2], 0x00000004U); } inline ::uint32_t XtcpConfig::s3_flush_threshold_jitter_pct() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.s3_flush_threshold_jitter_pct) @@ -11759,7 +12695,7 @@ inline ::uint32_t XtcpConfig::s3_flush_threshold_jitter_pct() const { } inline void XtcpConfig::set_s3_flush_threshold_jitter_pct(::uint32_t value) { _internal_set_s3_flush_threshold_jitter_pct(value); - SetHasBit(_impl_._has_bits_[2], 0x00000002U); + SetHasBit(_impl_._has_bits_[2], 0x00000004U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.s3_flush_threshold_jitter_pct) } inline ::uint32_t XtcpConfig::_internal_s3_flush_threshold_jitter_pct() const { @@ -11775,7 +12711,7 @@ inline void XtcpConfig::_internal_set_s3_flush_threshold_jitter_pct(::uint32_t v inline void XtcpConfig::clear_s3_upload_max_attempts() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.s3_upload_max_attempts_ = 0u; - ClearHasBit(_impl_._has_bits_[2], 0x00000004U); + ClearHasBit(_impl_._has_bits_[2], 0x00000008U); } inline ::uint32_t XtcpConfig::s3_upload_max_attempts() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.s3_upload_max_attempts) @@ -11783,7 +12719,7 @@ inline ::uint32_t XtcpConfig::s3_upload_max_attempts() const { } inline void XtcpConfig::set_s3_upload_max_attempts(::uint32_t value) { _internal_set_s3_upload_max_attempts(value); - SetHasBit(_impl_._has_bits_[2], 0x00000004U); + SetHasBit(_impl_._has_bits_[2], 0x00000008U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.s3_upload_max_attempts) } inline ::uint32_t XtcpConfig::_internal_s3_upload_max_attempts() const { @@ -11797,7 +12733,7 @@ inline void XtcpConfig::_internal_set_s3_upload_max_attempts(::uint32_t value) { // .google.protobuf.Duration s3_upload_backoff_cap = 115 [json_name = "s3UploadBackoffCap", (.buf.validate.field) = { inline bool XtcpConfig::has_s3_upload_backoff_cap() const { - bool value = CheckHasBit(_impl_._has_bits_[1], 0x00040000U); + bool value = CheckHasBit(_impl_._has_bits_[1], 0x00080000U); PROTOBUF_ASSUME(!value || _impl_.s3_upload_backoff_cap_ != nullptr); return value; } @@ -11818,16 +12754,16 @@ inline void XtcpConfig::unsafe_arena_set_allocated_s3_upload_backoff_cap( } _impl_.s3_upload_backoff_cap_ = reinterpret_cast<::google::protobuf::Duration*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00040000U); + SetHasBit(_impl_._has_bits_[1], 0x00080000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00040000U); + ClearHasBit(_impl_._has_bits_[1], 0x00080000U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.XtcpConfig.s3_upload_backoff_cap) } inline ::google::protobuf::Duration* PROTOBUF_NULLABLE XtcpConfig::release_s3_upload_backoff_cap() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[1], 0x00040000U); + ClearHasBit(_impl_._has_bits_[1], 0x00080000U); ::google::protobuf::Duration* released = _impl_.s3_upload_backoff_cap_; _impl_.s3_upload_backoff_cap_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -11847,7 +12783,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NULLABLE XtcpConfig::unsafe_arena_ ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.s3_upload_backoff_cap) - ClearHasBit(_impl_._has_bits_[1], 0x00040000U); + ClearHasBit(_impl_._has_bits_[1], 0x00080000U); ::google::protobuf::Duration* temp = _impl_.s3_upload_backoff_cap_; _impl_.s3_upload_backoff_cap_ = nullptr; return temp; @@ -11862,7 +12798,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NONNULL XtcpConfig::_internal_muta } inline ::google::protobuf::Duration* PROTOBUF_NONNULL XtcpConfig::mutable_s3_upload_backoff_cap() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00040000U); + SetHasBit(_impl_._has_bits_[1], 0x00080000U); ::google::protobuf::Duration* _msg = _internal_mutable_s3_upload_backoff_cap(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.s3_upload_backoff_cap) return _msg; @@ -11879,9 +12815,9 @@ inline void XtcpConfig::set_allocated_s3_upload_backoff_cap(::google::protobuf:: if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[1], 0x00040000U); + SetHasBit(_impl_._has_bits_[1], 0x00080000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00040000U); + ClearHasBit(_impl_._has_bits_[1], 0x00080000U); } _impl_.s3_upload_backoff_cap_ = reinterpret_cast<::google::protobuf::Duration*>(value); @@ -11892,7 +12828,7 @@ inline void XtcpConfig::set_allocated_s3_upload_backoff_cap(::google::protobuf:: inline void XtcpConfig::clear_hostname() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.hostname_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00000004U); + ClearHasBit(_impl_._has_bits_[1], 0x00000008U); } inline const ::std::string& XtcpConfig::hostname() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -11902,13 +12838,13 @@ inline const ::std::string& XtcpConfig::hostname() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_hostname(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00000004U); + SetHasBit(_impl_._has_bits_[1], 0x00000008U); _impl_.hostname_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.hostname) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_hostname() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00000004U); + SetHasBit(_impl_._has_bits_[1], 0x00000008U); ::std::string* _s = _internal_mutable_hostname(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.hostname) return _s; @@ -11928,10 +12864,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_hostname() inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_hostname() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.hostname) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00000004U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00000008U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00000004U); + ClearHasBit(_impl_._has_bits_[1], 0x00000008U); auto* released = _impl_.hostname_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.hostname_.Set("", GetArena()); @@ -11941,9 +12877,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_hostname() { inline void XtcpConfig::set_allocated_hostname(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00000004U); + SetHasBit(_impl_._has_bits_[1], 0x00000008U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00000004U); + ClearHasBit(_impl_._has_bits_[1], 0x00000008U); } _impl_.hostname_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.hostname_.IsDefault()) { @@ -11956,7 +12892,7 @@ inline void XtcpConfig::set_allocated_hostname(::std::string* PROTOBUF_NULLABLE inline void XtcpConfig::clear_location() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.location_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00000008U); + ClearHasBit(_impl_._has_bits_[1], 0x00000010U); } inline const ::std::string& XtcpConfig::location() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -11966,13 +12902,13 @@ inline const ::std::string& XtcpConfig::location() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_location(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00000008U); + SetHasBit(_impl_._has_bits_[1], 0x00000010U); _impl_.location_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.location) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_location() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00000008U); + SetHasBit(_impl_._has_bits_[1], 0x00000010U); ::std::string* _s = _internal_mutable_location(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.location) return _s; @@ -11992,10 +12928,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_location() inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_location() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.location) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00000008U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00000010U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00000008U); + ClearHasBit(_impl_._has_bits_[1], 0x00000010U); auto* released = _impl_.location_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.location_.Set("", GetArena()); @@ -12005,9 +12941,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_location() { inline void XtcpConfig::set_allocated_location(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00000008U); + SetHasBit(_impl_._has_bits_[1], 0x00000010U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00000008U); + ClearHasBit(_impl_._has_bits_[1], 0x00000010U); } _impl_.location_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.location_.IsDefault()) { @@ -12020,7 +12956,7 @@ inline void XtcpConfig::set_allocated_location(::std::string* PROTOBUF_NULLABLE inline void XtcpConfig::clear_label() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.label_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00000010U); + ClearHasBit(_impl_._has_bits_[1], 0x00000020U); } inline const ::std::string& XtcpConfig::label() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -12030,13 +12966,13 @@ inline const ::std::string& XtcpConfig::label() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_label(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00000010U); + SetHasBit(_impl_._has_bits_[1], 0x00000020U); _impl_.label_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.label) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_label() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00000010U); + SetHasBit(_impl_._has_bits_[1], 0x00000020U); ::std::string* _s = _internal_mutable_label(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.label) return _s; @@ -12056,10 +12992,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_label() { inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_label() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.label) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00000010U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00000020U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00000010U); + ClearHasBit(_impl_._has_bits_[1], 0x00000020U); auto* released = _impl_.label_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.label_.Set("", GetArena()); @@ -12069,9 +13005,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_label() { inline void XtcpConfig::set_allocated_label(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00000010U); + SetHasBit(_impl_._has_bits_[1], 0x00000020U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00000010U); + ClearHasBit(_impl_._has_bits_[1], 0x00000020U); } _impl_.label_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.label_.IsDefault()) { @@ -12084,7 +13020,7 @@ inline void XtcpConfig::set_allocated_label(::std::string* PROTOBUF_NULLABLE val inline void XtcpConfig::clear_tag() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.tag_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00000020U); + ClearHasBit(_impl_._has_bits_[1], 0x00000040U); } inline const ::std::string& XtcpConfig::tag() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -12094,13 +13030,13 @@ inline const ::std::string& XtcpConfig::tag() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_tag(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00000020U); + SetHasBit(_impl_._has_bits_[1], 0x00000040U); _impl_.tag_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.tag) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_tag() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00000020U); + SetHasBit(_impl_._has_bits_[1], 0x00000040U); ::std::string* _s = _internal_mutable_tag(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.tag) return _s; @@ -12120,10 +13056,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_tag() { inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_tag() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.tag) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00000020U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00000040U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00000020U); + ClearHasBit(_impl_._has_bits_[1], 0x00000040U); auto* released = _impl_.tag_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.tag_.Set("", GetArena()); @@ -12133,9 +13069,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_tag() { inline void XtcpConfig::set_allocated_tag(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00000020U); + SetHasBit(_impl_._has_bits_[1], 0x00000040U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00000020U); + ClearHasBit(_impl_._has_bits_[1], 0x00000040U); } _impl_.tag_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.tag_.IsDefault()) { @@ -12148,7 +13084,7 @@ inline void XtcpConfig::set_allocated_tag(::std::string* PROTOBUF_NULLABLE value inline void XtcpConfig::clear_daemon_version() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.daemon_version_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00000040U); + ClearHasBit(_impl_._has_bits_[1], 0x00000080U); } inline const ::std::string& XtcpConfig::daemon_version() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -12158,13 +13094,13 @@ inline const ::std::string& XtcpConfig::daemon_version() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_daemon_version(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00000040U); + SetHasBit(_impl_._has_bits_[1], 0x00000080U); _impl_.daemon_version_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.daemon_version) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_daemon_version() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00000040U); + SetHasBit(_impl_._has_bits_[1], 0x00000080U); ::std::string* _s = _internal_mutable_daemon_version(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.daemon_version) return _s; @@ -12184,10 +13120,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_daemon_vers inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_daemon_version() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.daemon_version) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00000040U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00000080U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00000040U); + ClearHasBit(_impl_._has_bits_[1], 0x00000080U); auto* released = _impl_.daemon_version_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.daemon_version_.Set("", GetArena()); @@ -12197,9 +13133,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_daemon_version() { inline void XtcpConfig::set_allocated_daemon_version(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00000040U); + SetHasBit(_impl_._has_bits_[1], 0x00000080U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00000040U); + ClearHasBit(_impl_._has_bits_[1], 0x00000080U); } _impl_.daemon_version_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.daemon_version_.IsDefault()) { @@ -12212,7 +13148,7 @@ inline void XtcpConfig::set_allocated_daemon_version(::std::string* PROTOBUF_NUL inline void XtcpConfig::clear_ipv4_ttl() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.ipv4_ttl_ = 0u; - ClearHasBit(_impl_._has_bits_[2], 0x00000008U); + ClearHasBit(_impl_._has_bits_[2], 0x00000010U); } inline ::uint32_t XtcpConfig::ipv4_ttl() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.ipv4_ttl) @@ -12220,7 +13156,7 @@ inline ::uint32_t XtcpConfig::ipv4_ttl() const { } inline void XtcpConfig::set_ipv4_ttl(::uint32_t value) { _internal_set_ipv4_ttl(value); - SetHasBit(_impl_._has_bits_[2], 0x00000008U); + SetHasBit(_impl_._has_bits_[2], 0x00000010U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.ipv4_ttl) } inline ::uint32_t XtcpConfig::_internal_ipv4_ttl() const { @@ -12236,7 +13172,7 @@ inline void XtcpConfig::_internal_set_ipv4_ttl(::uint32_t value) { inline void XtcpConfig::clear_ipv6_hop_limit() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.ipv6_hop_limit_ = 0u; - ClearHasBit(_impl_._has_bits_[2], 0x00000010U); + ClearHasBit(_impl_._has_bits_[2], 0x00000020U); } inline ::uint32_t XtcpConfig::ipv6_hop_limit() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.ipv6_hop_limit) @@ -12244,7 +13180,7 @@ inline ::uint32_t XtcpConfig::ipv6_hop_limit() const { } inline void XtcpConfig::set_ipv6_hop_limit(::uint32_t value) { _internal_set_ipv6_hop_limit(value); - SetHasBit(_impl_._has_bits_[2], 0x00000010U); + SetHasBit(_impl_._has_bits_[2], 0x00000020U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.ipv6_hop_limit) } inline ::uint32_t XtcpConfig::_internal_ipv6_hop_limit() const { @@ -12258,14 +13194,14 @@ inline void XtcpConfig::_internal_set_ipv6_hop_limit(::uint32_t value) { // .xtcp_config.v1.ListenerAuth listener_auth = 152 [json_name = "listenerAuth", (.buf.validate.field) = { inline bool XtcpConfig::has_listener_auth() const { - bool value = CheckHasBit(_impl_._has_bits_[1], 0x00080000U); + bool value = CheckHasBit(_impl_._has_bits_[1], 0x00100000U); PROTOBUF_ASSUME(!value || _impl_.listener_auth_ != nullptr); return value; } inline void XtcpConfig::clear_listener_auth() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.listener_auth_ != nullptr) _impl_.listener_auth_->Clear(); - ClearHasBit(_impl_._has_bits_[1], 0x00080000U); + ClearHasBit(_impl_._has_bits_[1], 0x00100000U); } inline const ::xtcp_config::v1::ListenerAuth& XtcpConfig::_internal_listener_auth() const { ::google::protobuf::internal::TSanRead(&_impl_); @@ -12284,16 +13220,16 @@ inline void XtcpConfig::unsafe_arena_set_allocated_listener_auth( } _impl_.listener_auth_ = reinterpret_cast<::xtcp_config::v1::ListenerAuth*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00080000U); + SetHasBit(_impl_._has_bits_[1], 0x00100000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00080000U); + ClearHasBit(_impl_._has_bits_[1], 0x00100000U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.XtcpConfig.listener_auth) } inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE XtcpConfig::release_listener_auth() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[1], 0x00080000U); + ClearHasBit(_impl_._has_bits_[1], 0x00100000U); ::xtcp_config::v1::ListenerAuth* released = _impl_.listener_auth_; _impl_.listener_auth_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -12313,7 +13249,7 @@ inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE XtcpConfig::unsafe_are ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.listener_auth) - ClearHasBit(_impl_._has_bits_[1], 0x00080000U); + ClearHasBit(_impl_._has_bits_[1], 0x00100000U); ::xtcp_config::v1::ListenerAuth* temp = _impl_.listener_auth_; _impl_.listener_auth_ = nullptr; return temp; @@ -12328,7 +13264,7 @@ inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NONNULL XtcpConfig::_internal_m } inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NONNULL XtcpConfig::mutable_listener_auth() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00080000U); + SetHasBit(_impl_._has_bits_[1], 0x00100000U); ::xtcp_config::v1::ListenerAuth* _msg = _internal_mutable_listener_auth(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.listener_auth) return _msg; @@ -12345,9 +13281,9 @@ inline void XtcpConfig::set_allocated_listener_auth(::xtcp_config::v1::ListenerA if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[1], 0x00080000U); + SetHasBit(_impl_._has_bits_[1], 0x00100000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00080000U); + ClearHasBit(_impl_._has_bits_[1], 0x00100000U); } _impl_.listener_auth_ = reinterpret_cast<::xtcp_config::v1::ListenerAuth*>(value); @@ -12356,14 +13292,14 @@ inline void XtcpConfig::set_allocated_listener_auth(::xtcp_config::v1::ListenerA // .xtcp_config.v1.ListenerEndpoint prometheus_listener = 153 [json_name = "prometheusListener", (.buf.validate.field) = { inline bool XtcpConfig::has_prometheus_listener() const { - bool value = CheckHasBit(_impl_._has_bits_[1], 0x00100000U); + bool value = CheckHasBit(_impl_._has_bits_[1], 0x00200000U); PROTOBUF_ASSUME(!value || _impl_.prometheus_listener_ != nullptr); return value; } inline void XtcpConfig::clear_prometheus_listener() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.prometheus_listener_ != nullptr) _impl_.prometheus_listener_->Clear(); - ClearHasBit(_impl_._has_bits_[1], 0x00100000U); + ClearHasBit(_impl_._has_bits_[1], 0x00200000U); } inline const ::xtcp_config::v1::ListenerEndpoint& XtcpConfig::_internal_prometheus_listener() const { ::google::protobuf::internal::TSanRead(&_impl_); @@ -12382,16 +13318,16 @@ inline void XtcpConfig::unsafe_arena_set_allocated_prometheus_listener( } _impl_.prometheus_listener_ = reinterpret_cast<::xtcp_config::v1::ListenerEndpoint*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00100000U); + SetHasBit(_impl_._has_bits_[1], 0x00200000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00100000U); + ClearHasBit(_impl_._has_bits_[1], 0x00200000U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.XtcpConfig.prometheus_listener) } inline ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NULLABLE XtcpConfig::release_prometheus_listener() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[1], 0x00100000U); + ClearHasBit(_impl_._has_bits_[1], 0x00200000U); ::xtcp_config::v1::ListenerEndpoint* released = _impl_.prometheus_listener_; _impl_.prometheus_listener_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -12411,7 +13347,7 @@ inline ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NULLABLE XtcpConfig::unsafe ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.prometheus_listener) - ClearHasBit(_impl_._has_bits_[1], 0x00100000U); + ClearHasBit(_impl_._has_bits_[1], 0x00200000U); ::xtcp_config::v1::ListenerEndpoint* temp = _impl_.prometheus_listener_; _impl_.prometheus_listener_ = nullptr; return temp; @@ -12426,7 +13362,7 @@ inline ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NONNULL XtcpConfig::_intern } inline ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NONNULL XtcpConfig::mutable_prometheus_listener() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00100000U); + SetHasBit(_impl_._has_bits_[1], 0x00200000U); ::xtcp_config::v1::ListenerEndpoint* _msg = _internal_mutable_prometheus_listener(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.prometheus_listener) return _msg; @@ -12443,9 +13379,9 @@ inline void XtcpConfig::set_allocated_prometheus_listener(::xtcp_config::v1::Lis if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[1], 0x00100000U); + SetHasBit(_impl_._has_bits_[1], 0x00200000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00100000U); + ClearHasBit(_impl_._has_bits_[1], 0x00200000U); } _impl_.prometheus_listener_ = reinterpret_cast<::xtcp_config::v1::ListenerEndpoint*>(value); @@ -12454,14 +13390,14 @@ inline void XtcpConfig::set_allocated_prometheus_listener(::xtcp_config::v1::Lis // .xtcp_config.v1.ListenerAuth admin_listener_auth = 154 [json_name = "adminListenerAuth", (.buf.validate.field) = { inline bool XtcpConfig::has_admin_listener_auth() const { - bool value = CheckHasBit(_impl_._has_bits_[1], 0x00200000U); + bool value = CheckHasBit(_impl_._has_bits_[1], 0x00400000U); PROTOBUF_ASSUME(!value || _impl_.admin_listener_auth_ != nullptr); return value; } inline void XtcpConfig::clear_admin_listener_auth() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.admin_listener_auth_ != nullptr) _impl_.admin_listener_auth_->Clear(); - ClearHasBit(_impl_._has_bits_[1], 0x00200000U); + ClearHasBit(_impl_._has_bits_[1], 0x00400000U); } inline const ::xtcp_config::v1::ListenerAuth& XtcpConfig::_internal_admin_listener_auth() const { ::google::protobuf::internal::TSanRead(&_impl_); @@ -12480,16 +13416,16 @@ inline void XtcpConfig::unsafe_arena_set_allocated_admin_listener_auth( } _impl_.admin_listener_auth_ = reinterpret_cast<::xtcp_config::v1::ListenerAuth*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00200000U); + SetHasBit(_impl_._has_bits_[1], 0x00400000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00200000U); + ClearHasBit(_impl_._has_bits_[1], 0x00400000U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.XtcpConfig.admin_listener_auth) } inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE XtcpConfig::release_admin_listener_auth() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[1], 0x00200000U); + ClearHasBit(_impl_._has_bits_[1], 0x00400000U); ::xtcp_config::v1::ListenerAuth* released = _impl_.admin_listener_auth_; _impl_.admin_listener_auth_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -12509,7 +13445,7 @@ inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NULLABLE XtcpConfig::unsafe_are ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.admin_listener_auth) - ClearHasBit(_impl_._has_bits_[1], 0x00200000U); + ClearHasBit(_impl_._has_bits_[1], 0x00400000U); ::xtcp_config::v1::ListenerAuth* temp = _impl_.admin_listener_auth_; _impl_.admin_listener_auth_ = nullptr; return temp; @@ -12524,7 +13460,7 @@ inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NONNULL XtcpConfig::_internal_m } inline ::xtcp_config::v1::ListenerAuth* PROTOBUF_NONNULL XtcpConfig::mutable_admin_listener_auth() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00200000U); + SetHasBit(_impl_._has_bits_[1], 0x00400000U); ::xtcp_config::v1::ListenerAuth* _msg = _internal_mutable_admin_listener_auth(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.admin_listener_auth) return _msg; @@ -12541,9 +13477,9 @@ inline void XtcpConfig::set_allocated_admin_listener_auth(::xtcp_config::v1::Lis if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[1], 0x00200000U); + SetHasBit(_impl_._has_bits_[1], 0x00400000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00200000U); + ClearHasBit(_impl_._has_bits_[1], 0x00400000U); } _impl_.admin_listener_auth_ = reinterpret_cast<::xtcp_config::v1::ListenerAuth*>(value); @@ -12554,7 +13490,7 @@ inline void XtcpConfig::set_allocated_admin_listener_auth(::xtcp_config::v1::Lis inline void XtcpConfig::clear_grpc_port() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.grpc_port_ = 0u; - ClearHasBit(_impl_._has_bits_[2], 0x00000020U); + ClearHasBit(_impl_._has_bits_[2], 0x00000040U); } inline ::uint32_t XtcpConfig::grpc_port() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.grpc_port) @@ -12562,7 +13498,7 @@ inline ::uint32_t XtcpConfig::grpc_port() const { } inline void XtcpConfig::set_grpc_port(::uint32_t value) { _internal_set_grpc_port(value); - SetHasBit(_impl_._has_bits_[2], 0x00000020U); + SetHasBit(_impl_._has_bits_[2], 0x00000040U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.grpc_port) } inline ::uint32_t XtcpConfig::_internal_grpc_port() const { @@ -12576,14 +13512,14 @@ inline void XtcpConfig::_internal_set_grpc_port(::uint32_t value) { // .xtcp_config.v1.ListenerEndpoint grpc_listener = 161 [json_name = "grpcListener", (.buf.validate.field) = { inline bool XtcpConfig::has_grpc_listener() const { - bool value = CheckHasBit(_impl_._has_bits_[1], 0x00400000U); + bool value = CheckHasBit(_impl_._has_bits_[1], 0x00800000U); PROTOBUF_ASSUME(!value || _impl_.grpc_listener_ != nullptr); return value; } inline void XtcpConfig::clear_grpc_listener() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.grpc_listener_ != nullptr) _impl_.grpc_listener_->Clear(); - ClearHasBit(_impl_._has_bits_[1], 0x00400000U); + ClearHasBit(_impl_._has_bits_[1], 0x00800000U); } inline const ::xtcp_config::v1::ListenerEndpoint& XtcpConfig::_internal_grpc_listener() const { ::google::protobuf::internal::TSanRead(&_impl_); @@ -12602,16 +13538,16 @@ inline void XtcpConfig::unsafe_arena_set_allocated_grpc_listener( } _impl_.grpc_listener_ = reinterpret_cast<::xtcp_config::v1::ListenerEndpoint*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00400000U); + SetHasBit(_impl_._has_bits_[1], 0x00800000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00400000U); + ClearHasBit(_impl_._has_bits_[1], 0x00800000U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.XtcpConfig.grpc_listener) } inline ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NULLABLE XtcpConfig::release_grpc_listener() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[1], 0x00400000U); + ClearHasBit(_impl_._has_bits_[1], 0x00800000U); ::xtcp_config::v1::ListenerEndpoint* released = _impl_.grpc_listener_; _impl_.grpc_listener_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -12631,7 +13567,7 @@ inline ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NULLABLE XtcpConfig::unsafe ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.grpc_listener) - ClearHasBit(_impl_._has_bits_[1], 0x00400000U); + ClearHasBit(_impl_._has_bits_[1], 0x00800000U); ::xtcp_config::v1::ListenerEndpoint* temp = _impl_.grpc_listener_; _impl_.grpc_listener_ = nullptr; return temp; @@ -12646,7 +13582,7 @@ inline ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NONNULL XtcpConfig::_intern } inline ::xtcp_config::v1::ListenerEndpoint* PROTOBUF_NONNULL XtcpConfig::mutable_grpc_listener() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00400000U); + SetHasBit(_impl_._has_bits_[1], 0x00800000U); ::xtcp_config::v1::ListenerEndpoint* _msg = _internal_mutable_grpc_listener(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.grpc_listener) return _msg; @@ -12663,20 +13599,75 @@ inline void XtcpConfig::set_allocated_grpc_listener(::xtcp_config::v1::ListenerE if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[1], 0x00400000U); + SetHasBit(_impl_._has_bits_[1], 0x00800000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00400000U); + ClearHasBit(_impl_._has_bits_[1], 0x00800000U); } _impl_.grpc_listener_ = reinterpret_cast<::xtcp_config::v1::ListenerEndpoint*>(value); // @@protoc_insertion_point(field_set_allocated:xtcp_config.v1.XtcpConfig.grpc_listener) } +// repeated .xtcp_config.v1.Listener listeners = 162 [json_name = "listeners", (.buf.validate.field) = { +inline int XtcpConfig::_internal_listeners_size() const { + return _internal_listeners().size(); +} +inline int XtcpConfig::listeners_size() const { + return _internal_listeners_size(); +} +inline void XtcpConfig::clear_listeners() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.listeners_.Clear(); + ClearHasBit(_impl_._has_bits_[0], 0x00400000U); +} +inline const ::xtcp_config::v1::Listener& XtcpConfig::listeners(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.listeners) + return _internal_listeners().Get(index); +} +inline ::xtcp_config::v1::Listener* PROTOBUF_NONNULL XtcpConfig::mutable_listeners(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.listeners) + return _internal_mutable_listeners()->Mutable(index); +} +inline ::xtcp_config::v1::Listener* PROTOBUF_NONNULL XtcpConfig::add_listeners() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::xtcp_config::v1::Listener* _add = + _internal_mutable_listeners()->InternalAddWithArena( + ::google::protobuf::MessageLite::internal_visibility(), GetArena()); + SetHasBit(_impl_._has_bits_[0], 0x00400000U); + // @@protoc_insertion_point(field_add:xtcp_config.v1.XtcpConfig.listeners) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField<::xtcp_config::v1::Listener>& XtcpConfig::listeners() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:xtcp_config.v1.XtcpConfig.listeners) + return _internal_listeners(); +} +inline ::google::protobuf::RepeatedPtrField<::xtcp_config::v1::Listener>* PROTOBUF_NONNULL +XtcpConfig::mutable_listeners() ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00400000U); + // @@protoc_insertion_point(field_mutable_list:xtcp_config.v1.XtcpConfig.listeners) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_listeners(); +} +inline const ::google::protobuf::RepeatedPtrField<::xtcp_config::v1::Listener>& +XtcpConfig::_internal_listeners() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.listeners_; +} +inline ::google::protobuf::RepeatedPtrField<::xtcp_config::v1::Listener>* PROTOBUF_NONNULL +XtcpConfig::_internal_mutable_listeners() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.listeners_; +} + // string pyroscope_url = 170 [json_name = "pyroscopeUrl", (.buf.validate.field) = { inline void XtcpConfig::clear_pyroscope_url() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.pyroscope_url_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00000080U); + ClearHasBit(_impl_._has_bits_[1], 0x00000100U); } inline const ::std::string& XtcpConfig::pyroscope_url() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -12686,13 +13677,13 @@ inline const ::std::string& XtcpConfig::pyroscope_url() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_pyroscope_url(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00000080U); + SetHasBit(_impl_._has_bits_[1], 0x00000100U); _impl_.pyroscope_url_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.pyroscope_url) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_pyroscope_url() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00000080U); + SetHasBit(_impl_._has_bits_[1], 0x00000100U); ::std::string* _s = _internal_mutable_pyroscope_url(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.pyroscope_url) return _s; @@ -12712,10 +13703,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_pyroscope_u inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_pyroscope_url() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.pyroscope_url) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00000080U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00000100U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00000080U); + ClearHasBit(_impl_._has_bits_[1], 0x00000100U); auto* released = _impl_.pyroscope_url_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.pyroscope_url_.Set("", GetArena()); @@ -12725,9 +13716,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_pyroscope_url() { inline void XtcpConfig::set_allocated_pyroscope_url(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00000080U); + SetHasBit(_impl_._has_bits_[1], 0x00000100U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00000080U); + ClearHasBit(_impl_._has_bits_[1], 0x00000100U); } _impl_.pyroscope_url_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.pyroscope_url_.IsDefault()) { @@ -12740,7 +13731,7 @@ inline void XtcpConfig::set_allocated_pyroscope_url(::std::string* PROTOBUF_NULL inline void XtcpConfig::clear_pyroscope_app_name() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.pyroscope_app_name_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00000100U); + ClearHasBit(_impl_._has_bits_[1], 0x00000200U); } inline const ::std::string& XtcpConfig::pyroscope_app_name() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -12750,13 +13741,13 @@ inline const ::std::string& XtcpConfig::pyroscope_app_name() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_pyroscope_app_name(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00000100U); + SetHasBit(_impl_._has_bits_[1], 0x00000200U); _impl_.pyroscope_app_name_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.pyroscope_app_name) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_pyroscope_app_name() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00000100U); + SetHasBit(_impl_._has_bits_[1], 0x00000200U); ::std::string* _s = _internal_mutable_pyroscope_app_name(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.pyroscope_app_name) return _s; @@ -12776,10 +13767,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_pyroscope_a inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_pyroscope_app_name() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.pyroscope_app_name) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00000100U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00000200U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00000100U); + ClearHasBit(_impl_._has_bits_[1], 0x00000200U); auto* released = _impl_.pyroscope_app_name_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.pyroscope_app_name_.Set("", GetArena()); @@ -12789,9 +13780,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_pyroscope_app_name() inline void XtcpConfig::set_allocated_pyroscope_app_name(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00000100U); + SetHasBit(_impl_._has_bits_[1], 0x00000200U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00000100U); + ClearHasBit(_impl_._has_bits_[1], 0x00000200U); } _impl_.pyroscope_app_name_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.pyroscope_app_name_.IsDefault()) { @@ -12804,7 +13795,7 @@ inline void XtcpConfig::set_allocated_pyroscope_app_name(::std::string* PROTOBUF inline void XtcpConfig::clear_pyroscope_sample_hz() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.pyroscope_sample_hz_ = 0u; - ClearHasBit(_impl_._has_bits_[2], 0x00000400U); + ClearHasBit(_impl_._has_bits_[2], 0x00000800U); } inline ::uint32_t XtcpConfig::pyroscope_sample_hz() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.pyroscope_sample_hz) @@ -12812,7 +13803,7 @@ inline ::uint32_t XtcpConfig::pyroscope_sample_hz() const { } inline void XtcpConfig::set_pyroscope_sample_hz(::uint32_t value) { _internal_set_pyroscope_sample_hz(value); - SetHasBit(_impl_._has_bits_[2], 0x00000400U); + SetHasBit(_impl_._has_bits_[2], 0x00000800U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.pyroscope_sample_hz) } inline ::uint32_t XtcpConfig::_internal_pyroscope_sample_hz() const { @@ -12828,7 +13819,7 @@ inline void XtcpConfig::_internal_set_pyroscope_sample_hz(::uint32_t value) { inline void XtcpConfig::clear_pyroscope_upload_interval_sec() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.pyroscope_upload_interval_sec_ = 0u; - ClearHasBit(_impl_._has_bits_[2], 0x00000800U); + ClearHasBit(_impl_._has_bits_[2], 0x00001000U); } inline ::uint32_t XtcpConfig::pyroscope_upload_interval_sec() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.pyroscope_upload_interval_sec) @@ -12836,7 +13827,7 @@ inline ::uint32_t XtcpConfig::pyroscope_upload_interval_sec() const { } inline void XtcpConfig::set_pyroscope_upload_interval_sec(::uint32_t value) { _internal_set_pyroscope_upload_interval_sec(value); - SetHasBit(_impl_._has_bits_[2], 0x00000800U); + SetHasBit(_impl_._has_bits_[2], 0x00001000U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.pyroscope_upload_interval_sec) } inline ::uint32_t XtcpConfig::_internal_pyroscope_upload_interval_sec() const { @@ -12852,7 +13843,7 @@ inline void XtcpConfig::_internal_set_pyroscope_upload_interval_sec(::uint32_t v inline void XtcpConfig::clear_resolve_container_id() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.resolve_container_id_ = false; - ClearHasBit(_impl_._has_bits_[2], 0x00000080U); + ClearHasBit(_impl_._has_bits_[2], 0x00000100U); } inline bool XtcpConfig::resolve_container_id() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.resolve_container_id) @@ -12860,7 +13851,7 @@ inline bool XtcpConfig::resolve_container_id() const { } inline void XtcpConfig::set_resolve_container_id(bool value) { _internal_set_resolve_container_id(value); - SetHasBit(_impl_._has_bits_[2], 0x00000080U); + SetHasBit(_impl_._has_bits_[2], 0x00000100U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.resolve_container_id) } inline bool XtcpConfig::_internal_resolve_container_id() const { @@ -12876,7 +13867,7 @@ inline void XtcpConfig::_internal_set_resolve_container_id(bool value) { inline void XtcpConfig::clear_enrich_container_enable() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.enrich_container_enable_ = false; - ClearHasBit(_impl_._has_bits_[2], 0x00000100U); + ClearHasBit(_impl_._has_bits_[2], 0x00000200U); } inline bool XtcpConfig::enrich_container_enable() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.enrich_container_enable) @@ -12884,7 +13875,7 @@ inline bool XtcpConfig::enrich_container_enable() const { } inline void XtcpConfig::set_enrich_container_enable(bool value) { _internal_set_enrich_container_enable(value); - SetHasBit(_impl_._has_bits_[2], 0x00000100U); + SetHasBit(_impl_._has_bits_[2], 0x00000200U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.enrich_container_enable) } inline bool XtcpConfig::_internal_enrich_container_enable() const { @@ -12900,7 +13891,7 @@ inline void XtcpConfig::_internal_set_enrich_container_enable(bool value) { inline void XtcpConfig::clear_docker_socket_path() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.docker_socket_path_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00000200U); + ClearHasBit(_impl_._has_bits_[1], 0x00000400U); } inline const ::std::string& XtcpConfig::docker_socket_path() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -12910,13 +13901,13 @@ inline const ::std::string& XtcpConfig::docker_socket_path() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_docker_socket_path(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00000200U); + SetHasBit(_impl_._has_bits_[1], 0x00000400U); _impl_.docker_socket_path_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.docker_socket_path) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_docker_socket_path() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00000200U); + SetHasBit(_impl_._has_bits_[1], 0x00000400U); ::std::string* _s = _internal_mutable_docker_socket_path(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.docker_socket_path) return _s; @@ -12936,10 +13927,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_docker_sock inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_docker_socket_path() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.docker_socket_path) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00000200U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00000400U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00000200U); + ClearHasBit(_impl_._has_bits_[1], 0x00000400U); auto* released = _impl_.docker_socket_path_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.docker_socket_path_.Set("", GetArena()); @@ -12949,9 +13940,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_docker_socket_path() inline void XtcpConfig::set_allocated_docker_socket_path(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00000200U); + SetHasBit(_impl_._has_bits_[1], 0x00000400U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00000200U); + ClearHasBit(_impl_._has_bits_[1], 0x00000400U); } _impl_.docker_socket_path_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.docker_socket_path_.IsDefault()) { @@ -12964,7 +13955,7 @@ inline void XtcpConfig::set_allocated_docker_socket_path(::std::string* PROTOBUF inline void XtcpConfig::clear_enrich_lldp_enable() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.enrich_lldp_enable_ = false; - ClearHasBit(_impl_._has_bits_[2], 0x00000200U); + ClearHasBit(_impl_._has_bits_[2], 0x00000400U); } inline bool XtcpConfig::enrich_lldp_enable() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.enrich_lldp_enable) @@ -12972,7 +13963,7 @@ inline bool XtcpConfig::enrich_lldp_enable() const { } inline void XtcpConfig::set_enrich_lldp_enable(bool value) { _internal_set_enrich_lldp_enable(value); - SetHasBit(_impl_._has_bits_[2], 0x00000200U); + SetHasBit(_impl_._has_bits_[2], 0x00000400U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.enrich_lldp_enable) } inline bool XtcpConfig::_internal_enrich_lldp_enable() const { @@ -12988,7 +13979,7 @@ inline void XtcpConfig::_internal_set_enrich_lldp_enable(bool value) { inline void XtcpConfig::clear_lldpd_socket_path() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.lldpd_socket_path_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00000400U); + ClearHasBit(_impl_._has_bits_[1], 0x00000800U); } inline const ::std::string& XtcpConfig::lldpd_socket_path() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -12998,13 +13989,13 @@ inline const ::std::string& XtcpConfig::lldpd_socket_path() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_lldpd_socket_path(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00000400U); + SetHasBit(_impl_._has_bits_[1], 0x00000800U); _impl_.lldpd_socket_path_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.lldpd_socket_path) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_lldpd_socket_path() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00000400U); + SetHasBit(_impl_._has_bits_[1], 0x00000800U); ::std::string* _s = _internal_mutable_lldpd_socket_path(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.lldpd_socket_path) return _s; @@ -13024,10 +14015,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_lldpd_socke inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_lldpd_socket_path() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.lldpd_socket_path) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00000400U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00000800U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00000400U); + ClearHasBit(_impl_._has_bits_[1], 0x00000800U); auto* released = _impl_.lldpd_socket_path_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.lldpd_socket_path_.Set("", GetArena()); @@ -13037,9 +14028,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_lldpd_socket_path() inline void XtcpConfig::set_allocated_lldpd_socket_path(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00000400U); + SetHasBit(_impl_._has_bits_[1], 0x00000800U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00000400U); + ClearHasBit(_impl_._has_bits_[1], 0x00000800U); } _impl_.lldpd_socket_path_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.lldpd_socket_path_.IsDefault()) { @@ -13052,7 +14043,7 @@ inline void XtcpConfig::set_allocated_lldpd_socket_path(::std::string* PROTOBUF_ inline void XtcpConfig::clear_lldpd_version_hint() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.lldpd_version_hint_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00000800U); + ClearHasBit(_impl_._has_bits_[1], 0x00001000U); } inline const ::std::string& XtcpConfig::lldpd_version_hint() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -13062,13 +14053,13 @@ inline const ::std::string& XtcpConfig::lldpd_version_hint() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_lldpd_version_hint(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00000800U); + SetHasBit(_impl_._has_bits_[1], 0x00001000U); _impl_.lldpd_version_hint_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.lldpd_version_hint) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_lldpd_version_hint() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00000800U); + SetHasBit(_impl_._has_bits_[1], 0x00001000U); ::std::string* _s = _internal_mutable_lldpd_version_hint(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.lldpd_version_hint) return _s; @@ -13088,10 +14079,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_lldpd_versi inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_lldpd_version_hint() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.lldpd_version_hint) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00000800U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00001000U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00000800U); + ClearHasBit(_impl_._has_bits_[1], 0x00001000U); auto* released = _impl_.lldpd_version_hint_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.lldpd_version_hint_.Set("", GetArena()); @@ -13101,9 +14092,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_lldpd_version_hint() inline void XtcpConfig::set_allocated_lldpd_version_hint(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00000800U); + SetHasBit(_impl_._has_bits_[1], 0x00001000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00000800U); + ClearHasBit(_impl_._has_bits_[1], 0x00001000U); } _impl_.lldpd_version_hint_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.lldpd_version_hint_.IsDefault()) { @@ -13116,7 +14107,7 @@ inline void XtcpConfig::set_allocated_lldpd_version_hint(::std::string* PROTOBUF inline void XtcpConfig::clear_enrich_nic_enable() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.enrich_nic_enable_ = false; - ClearHasBit(_impl_._has_bits_[2], 0x00002000U); + ClearHasBit(_impl_._has_bits_[2], 0x00004000U); } inline bool XtcpConfig::enrich_nic_enable() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.enrich_nic_enable) @@ -13124,7 +14115,7 @@ inline bool XtcpConfig::enrich_nic_enable() const { } inline void XtcpConfig::set_enrich_nic_enable(bool value) { _internal_set_enrich_nic_enable(value); - SetHasBit(_impl_._has_bits_[2], 0x00002000U); + SetHasBit(_impl_._has_bits_[2], 0x00004000U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.enrich_nic_enable) } inline bool XtcpConfig::_internal_enrich_nic_enable() const { @@ -13140,7 +14131,7 @@ inline void XtcpConfig::_internal_set_enrich_nic_enable(bool value) { inline void XtcpConfig::clear_uplink_count() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.uplink_count_ = 0u; - ClearHasBit(_impl_._has_bits_[2], 0x00001000U); + ClearHasBit(_impl_._has_bits_[2], 0x00002000U); } inline ::uint32_t XtcpConfig::uplink_count() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.uplink_count) @@ -13148,7 +14139,7 @@ inline ::uint32_t XtcpConfig::uplink_count() const { } inline void XtcpConfig::set_uplink_count(::uint32_t value) { _internal_set_uplink_count(value); - SetHasBit(_impl_._has_bits_[2], 0x00001000U); + SetHasBit(_impl_._has_bits_[2], 0x00002000U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.uplink_count) } inline ::uint32_t XtcpConfig::_internal_uplink_count() const { @@ -13170,7 +14161,7 @@ inline int XtcpConfig::uplink_interfaces_size() const { inline void XtcpConfig::clear_uplink_interfaces() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.uplink_interfaces_.Clear(); - ClearHasBit(_impl_._has_bits_[0], 0x00400000U); + ClearHasBit(_impl_._has_bits_[0], 0x00800000U); } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::add_uplink_interfaces() ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -13178,7 +14169,7 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::add_uplink_interfaces() ::std::string* _s = _internal_mutable_uplink_interfaces()->InternalAddWithArena( ::google::protobuf::MessageLite::internal_visibility(), GetArena()); - SetHasBit(_impl_._has_bits_[0], 0x00400000U); + SetHasBit(_impl_._has_bits_[0], 0x00800000U); // @@protoc_insertion_point(field_add_mutable:xtcp_config.v1.XtcpConfig.uplink_interfaces) return _s; } @@ -13206,7 +14197,7 @@ inline void XtcpConfig::add_uplink_interfaces(Arg_&& value, Args_... args) { ::google::protobuf::MessageLite::internal_visibility(), GetArena(), *_internal_mutable_uplink_interfaces(), ::std::forward(value), args... ); - SetHasBit(_impl_._has_bits_[0], 0x00400000U); + SetHasBit(_impl_._has_bits_[0], 0x00800000U); // @@protoc_insertion_point(field_add:xtcp_config.v1.XtcpConfig.uplink_interfaces) } inline const ::google::protobuf::RepeatedPtrField<::std::string>& XtcpConfig::uplink_interfaces() @@ -13216,7 +14207,7 @@ inline const ::google::protobuf::RepeatedPtrField<::std::string>& XtcpConfig::up } inline ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL XtcpConfig::mutable_uplink_interfaces() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00400000U); + SetHasBit(_impl_._has_bits_[0], 0x00800000U); // @@protoc_insertion_point(field_mutable_list:xtcp_config.v1.XtcpConfig.uplink_interfaces) ::google::protobuf::internal::TSanWrite(&_impl_); return _internal_mutable_uplink_interfaces(); @@ -13236,7 +14227,7 @@ XtcpConfig::_internal_mutable_uplink_interfaces() { inline void XtcpConfig::clear_populate_nsid() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.populate_nsid_ = false; - ClearHasBit(_impl_._has_bits_[2], 0x00004000U); + ClearHasBit(_impl_._has_bits_[2], 0x00008000U); } inline bool XtcpConfig::populate_nsid() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.populate_nsid) @@ -13244,7 +14235,7 @@ inline bool XtcpConfig::populate_nsid() const { } inline void XtcpConfig::set_populate_nsid(bool value) { _internal_set_populate_nsid(value); - SetHasBit(_impl_._has_bits_[2], 0x00004000U); + SetHasBit(_impl_._has_bits_[2], 0x00008000U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.populate_nsid) } inline bool XtcpConfig::_internal_populate_nsid() const { @@ -13260,7 +14251,7 @@ inline void XtcpConfig::_internal_set_populate_nsid(bool value) { inline void XtcpConfig::clear_enrich_asn_enable() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.enrich_asn_enable_ = false; - ClearHasBit(_impl_._has_bits_[2], 0x00008000U); + ClearHasBit(_impl_._has_bits_[2], 0x00010000U); } inline bool XtcpConfig::enrich_asn_enable() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.enrich_asn_enable) @@ -13268,7 +14259,7 @@ inline bool XtcpConfig::enrich_asn_enable() const { } inline void XtcpConfig::set_enrich_asn_enable(bool value) { _internal_set_enrich_asn_enable(value); - SetHasBit(_impl_._has_bits_[2], 0x00008000U); + SetHasBit(_impl_._has_bits_[2], 0x00010000U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.enrich_asn_enable) } inline bool XtcpConfig::_internal_enrich_asn_enable() const { @@ -13284,7 +14275,7 @@ inline void XtcpConfig::_internal_set_enrich_asn_enable(bool value) { inline void XtcpConfig::clear_asn_db_path() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.asn_db_path_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00001000U); + ClearHasBit(_impl_._has_bits_[1], 0x00002000U); } inline const ::std::string& XtcpConfig::asn_db_path() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -13294,13 +14285,13 @@ inline const ::std::string& XtcpConfig::asn_db_path() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_asn_db_path(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00001000U); + SetHasBit(_impl_._has_bits_[1], 0x00002000U); _impl_.asn_db_path_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.asn_db_path) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_asn_db_path() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00001000U); + SetHasBit(_impl_._has_bits_[1], 0x00002000U); ::std::string* _s = _internal_mutable_asn_db_path(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.asn_db_path) return _s; @@ -13320,10 +14311,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_asn_db_path inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_asn_db_path() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.asn_db_path) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00001000U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00002000U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00001000U); + ClearHasBit(_impl_._has_bits_[1], 0x00002000U); auto* released = _impl_.asn_db_path_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.asn_db_path_.Set("", GetArena()); @@ -13333,9 +14324,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_asn_db_path() { inline void XtcpConfig::set_allocated_asn_db_path(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00001000U); + SetHasBit(_impl_._has_bits_[1], 0x00002000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00001000U); + ClearHasBit(_impl_._has_bits_[1], 0x00002000U); } _impl_.asn_db_path_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.asn_db_path_.IsDefault()) { @@ -13346,7 +14337,7 @@ inline void XtcpConfig::set_allocated_asn_db_path(::std::string* PROTOBUF_NULLAB // .google.protobuf.Duration asn_refresh_interval = 242 [json_name = "asnRefreshInterval"]; inline bool XtcpConfig::has_asn_refresh_interval() const { - bool value = CheckHasBit(_impl_._has_bits_[1], 0x00800000U); + bool value = CheckHasBit(_impl_._has_bits_[1], 0x01000000U); PROTOBUF_ASSUME(!value || _impl_.asn_refresh_interval_ != nullptr); return value; } @@ -13367,16 +14358,16 @@ inline void XtcpConfig::unsafe_arena_set_allocated_asn_refresh_interval( } _impl_.asn_refresh_interval_ = reinterpret_cast<::google::protobuf::Duration*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00800000U); + SetHasBit(_impl_._has_bits_[1], 0x01000000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00800000U); + ClearHasBit(_impl_._has_bits_[1], 0x01000000U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.XtcpConfig.asn_refresh_interval) } inline ::google::protobuf::Duration* PROTOBUF_NULLABLE XtcpConfig::release_asn_refresh_interval() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[1], 0x00800000U); + ClearHasBit(_impl_._has_bits_[1], 0x01000000U); ::google::protobuf::Duration* released = _impl_.asn_refresh_interval_; _impl_.asn_refresh_interval_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -13396,7 +14387,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NULLABLE XtcpConfig::unsafe_arena_ ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.asn_refresh_interval) - ClearHasBit(_impl_._has_bits_[1], 0x00800000U); + ClearHasBit(_impl_._has_bits_[1], 0x01000000U); ::google::protobuf::Duration* temp = _impl_.asn_refresh_interval_; _impl_.asn_refresh_interval_ = nullptr; return temp; @@ -13411,7 +14402,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NONNULL XtcpConfig::_internal_muta } inline ::google::protobuf::Duration* PROTOBUF_NONNULL XtcpConfig::mutable_asn_refresh_interval() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00800000U); + SetHasBit(_impl_._has_bits_[1], 0x01000000U); ::google::protobuf::Duration* _msg = _internal_mutable_asn_refresh_interval(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.asn_refresh_interval) return _msg; @@ -13428,9 +14419,9 @@ inline void XtcpConfig::set_allocated_asn_refresh_interval(::google::protobuf::D if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[1], 0x00800000U); + SetHasBit(_impl_._has_bits_[1], 0x01000000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00800000U); + ClearHasBit(_impl_._has_bits_[1], 0x01000000U); } _impl_.asn_refresh_interval_ = reinterpret_cast<::google::protobuf::Duration*>(value); @@ -13441,7 +14432,7 @@ inline void XtcpConfig::set_allocated_asn_refresh_interval(::google::protobuf::D inline void XtcpConfig::clear_ipmeta_bootstrap_path() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.ipmeta_bootstrap_path_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00002000U); + ClearHasBit(_impl_._has_bits_[1], 0x00004000U); } inline const ::std::string& XtcpConfig::ipmeta_bootstrap_path() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -13451,13 +14442,13 @@ inline const ::std::string& XtcpConfig::ipmeta_bootstrap_path() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_ipmeta_bootstrap_path(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00002000U); + SetHasBit(_impl_._has_bits_[1], 0x00004000U); _impl_.ipmeta_bootstrap_path_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.ipmeta_bootstrap_path) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_ipmeta_bootstrap_path() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00002000U); + SetHasBit(_impl_._has_bits_[1], 0x00004000U); ::std::string* _s = _internal_mutable_ipmeta_bootstrap_path(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.ipmeta_bootstrap_path) return _s; @@ -13477,10 +14468,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_ipmeta_boot inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_ipmeta_bootstrap_path() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.ipmeta_bootstrap_path) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00002000U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00004000U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00002000U); + ClearHasBit(_impl_._has_bits_[1], 0x00004000U); auto* released = _impl_.ipmeta_bootstrap_path_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.ipmeta_bootstrap_path_.Set("", GetArena()); @@ -13490,9 +14481,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_ipmeta_bootstrap_pat inline void XtcpConfig::set_allocated_ipmeta_bootstrap_path(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00002000U); + SetHasBit(_impl_._has_bits_[1], 0x00004000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00002000U); + ClearHasBit(_impl_._has_bits_[1], 0x00004000U); } _impl_.ipmeta_bootstrap_path_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.ipmeta_bootstrap_path_.IsDefault()) { @@ -13505,7 +14496,7 @@ inline void XtcpConfig::set_allocated_ipmeta_bootstrap_path(::std::string* PROTO inline void XtcpConfig::clear_ipmeta_cache_path() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.ipmeta_cache_path_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[1], 0x00004000U); + ClearHasBit(_impl_._has_bits_[1], 0x00008000U); } inline const ::std::string& XtcpConfig::ipmeta_cache_path() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -13515,13 +14506,13 @@ inline const ::std::string& XtcpConfig::ipmeta_cache_path() const template PROTOBUF_ALWAYS_INLINE void XtcpConfig::set_ipmeta_cache_path(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[1], 0x00004000U); + SetHasBit(_impl_._has_bits_[1], 0x00008000U); _impl_.ipmeta_cache_path_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.ipmeta_cache_path) } inline ::std::string* PROTOBUF_NONNULL XtcpConfig::mutable_ipmeta_cache_path() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x00004000U); + SetHasBit(_impl_._has_bits_[1], 0x00008000U); ::std::string* _s = _internal_mutable_ipmeta_cache_path(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.ipmeta_cache_path) return _s; @@ -13541,10 +14532,10 @@ inline ::std::string* PROTOBUF_NONNULL XtcpConfig::_internal_mutable_ipmeta_cach inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_ipmeta_cache_path() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.ipmeta_cache_path) - if (!CheckHasBit(_impl_._has_bits_[1], 0x00004000U)) { + if (!CheckHasBit(_impl_._has_bits_[1], 0x00008000U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[1], 0x00004000U); + ClearHasBit(_impl_._has_bits_[1], 0x00008000U); auto* released = _impl_.ipmeta_cache_path_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.ipmeta_cache_path_.Set("", GetArena()); @@ -13554,9 +14545,9 @@ inline ::std::string* PROTOBUF_NULLABLE XtcpConfig::release_ipmeta_cache_path() inline void XtcpConfig::set_allocated_ipmeta_cache_path(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x00004000U); + SetHasBit(_impl_._has_bits_[1], 0x00008000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x00004000U); + ClearHasBit(_impl_._has_bits_[1], 0x00008000U); } _impl_.ipmeta_cache_path_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.ipmeta_cache_path_.IsDefault()) { @@ -13569,7 +14560,7 @@ inline void XtcpConfig::set_allocated_ipmeta_cache_path(::std::string* PROTOBUF_ inline void XtcpConfig::clear_enrich_locality_enable() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.enrich_locality_enable_ = false; - ClearHasBit(_impl_._has_bits_[2], 0x00010000U); + ClearHasBit(_impl_._has_bits_[2], 0x00020000U); } inline bool XtcpConfig::enrich_locality_enable() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.enrich_locality_enable) @@ -13577,7 +14568,7 @@ inline bool XtcpConfig::enrich_locality_enable() const { } inline void XtcpConfig::set_enrich_locality_enable(bool value) { _internal_set_enrich_locality_enable(value); - SetHasBit(_impl_._has_bits_[2], 0x00010000U); + SetHasBit(_impl_._has_bits_[2], 0x00020000U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.enrich_locality_enable) } inline bool XtcpConfig::_internal_enrich_locality_enable() const { @@ -13591,7 +14582,7 @@ inline void XtcpConfig::_internal_set_enrich_locality_enable(bool value) { // .google.protobuf.Duration locality_refresh_interval = 246 [json_name = "localityRefreshInterval"]; inline bool XtcpConfig::has_locality_refresh_interval() const { - bool value = CheckHasBit(_impl_._has_bits_[1], 0x01000000U); + bool value = CheckHasBit(_impl_._has_bits_[1], 0x02000000U); PROTOBUF_ASSUME(!value || _impl_.locality_refresh_interval_ != nullptr); return value; } @@ -13612,16 +14603,16 @@ inline void XtcpConfig::unsafe_arena_set_allocated_locality_refresh_interval( } _impl_.locality_refresh_interval_ = reinterpret_cast<::google::protobuf::Duration*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x01000000U); + SetHasBit(_impl_._has_bits_[1], 0x02000000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x01000000U); + ClearHasBit(_impl_._has_bits_[1], 0x02000000U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.XtcpConfig.locality_refresh_interval) } inline ::google::protobuf::Duration* PROTOBUF_NULLABLE XtcpConfig::release_locality_refresh_interval() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[1], 0x01000000U); + ClearHasBit(_impl_._has_bits_[1], 0x02000000U); ::google::protobuf::Duration* released = _impl_.locality_refresh_interval_; _impl_.locality_refresh_interval_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -13641,7 +14632,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NULLABLE XtcpConfig::unsafe_arena_ ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.locality_refresh_interval) - ClearHasBit(_impl_._has_bits_[1], 0x01000000U); + ClearHasBit(_impl_._has_bits_[1], 0x02000000U); ::google::protobuf::Duration* temp = _impl_.locality_refresh_interval_; _impl_.locality_refresh_interval_ = nullptr; return temp; @@ -13656,7 +14647,7 @@ inline ::google::protobuf::Duration* PROTOBUF_NONNULL XtcpConfig::_internal_muta } inline ::google::protobuf::Duration* PROTOBUF_NONNULL XtcpConfig::mutable_locality_refresh_interval() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x01000000U); + SetHasBit(_impl_._has_bits_[1], 0x02000000U); ::google::protobuf::Duration* _msg = _internal_mutable_locality_refresh_interval(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.locality_refresh_interval) return _msg; @@ -13673,9 +14664,9 @@ inline void XtcpConfig::set_allocated_locality_refresh_interval(::google::protob if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[1], 0x01000000U); + SetHasBit(_impl_._has_bits_[1], 0x02000000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x01000000U); + ClearHasBit(_impl_._has_bits_[1], 0x02000000U); } _impl_.locality_refresh_interval_ = reinterpret_cast<::google::protobuf::Duration*>(value); @@ -13686,7 +14677,7 @@ inline void XtcpConfig::set_allocated_locality_refresh_interval(::google::protob inline void XtcpConfig::clear_locality_events_enable() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.locality_events_enable_ = false; - ClearHasBit(_impl_._has_bits_[2], 0x00020000U); + ClearHasBit(_impl_._has_bits_[2], 0x00040000U); } inline bool XtcpConfig::locality_events_enable() const { // @@protoc_insertion_point(field_get:xtcp_config.v1.XtcpConfig.locality_events_enable) @@ -13694,7 +14685,7 @@ inline bool XtcpConfig::locality_events_enable() const { } inline void XtcpConfig::set_locality_events_enable(bool value) { _internal_set_locality_events_enable(value); - SetHasBit(_impl_._has_bits_[2], 0x00020000U); + SetHasBit(_impl_._has_bits_[2], 0x00040000U); // @@protoc_insertion_point(field_set:xtcp_config.v1.XtcpConfig.locality_events_enable) } inline bool XtcpConfig::_internal_locality_events_enable() const { @@ -13708,14 +14699,14 @@ inline void XtcpConfig::_internal_set_locality_events_enable(bool value) { // .xtcp_config.v1.LinkMonitorConfig link_monitor = 250 [json_name = "linkMonitor"]; inline bool XtcpConfig::has_link_monitor() const { - bool value = CheckHasBit(_impl_._has_bits_[1], 0x02000000U); + bool value = CheckHasBit(_impl_._has_bits_[1], 0x04000000U); PROTOBUF_ASSUME(!value || _impl_.link_monitor_ != nullptr); return value; } inline void XtcpConfig::clear_link_monitor() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.link_monitor_ != nullptr) _impl_.link_monitor_->Clear(); - ClearHasBit(_impl_._has_bits_[1], 0x02000000U); + ClearHasBit(_impl_._has_bits_[1], 0x04000000U); } inline const ::xtcp_config::v1::LinkMonitorConfig& XtcpConfig::_internal_link_monitor() const { ::google::protobuf::internal::TSanRead(&_impl_); @@ -13734,16 +14725,16 @@ inline void XtcpConfig::unsafe_arena_set_allocated_link_monitor( } _impl_.link_monitor_ = reinterpret_cast<::xtcp_config::v1::LinkMonitorConfig*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[1], 0x02000000U); + SetHasBit(_impl_._has_bits_[1], 0x04000000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x02000000U); + ClearHasBit(_impl_._has_bits_[1], 0x04000000U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:xtcp_config.v1.XtcpConfig.link_monitor) } inline ::xtcp_config::v1::LinkMonitorConfig* PROTOBUF_NULLABLE XtcpConfig::release_link_monitor() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[1], 0x02000000U); + ClearHasBit(_impl_._has_bits_[1], 0x04000000U); ::xtcp_config::v1::LinkMonitorConfig* released = _impl_.link_monitor_; _impl_.link_monitor_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -13763,7 +14754,7 @@ inline ::xtcp_config::v1::LinkMonitorConfig* PROTOBUF_NULLABLE XtcpConfig::unsaf ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:xtcp_config.v1.XtcpConfig.link_monitor) - ClearHasBit(_impl_._has_bits_[1], 0x02000000U); + ClearHasBit(_impl_._has_bits_[1], 0x04000000U); ::xtcp_config::v1::LinkMonitorConfig* temp = _impl_.link_monitor_; _impl_.link_monitor_ = nullptr; return temp; @@ -13778,7 +14769,7 @@ inline ::xtcp_config::v1::LinkMonitorConfig* PROTOBUF_NONNULL XtcpConfig::_inter } inline ::xtcp_config::v1::LinkMonitorConfig* PROTOBUF_NONNULL XtcpConfig::mutable_link_monitor() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[1], 0x02000000U); + SetHasBit(_impl_._has_bits_[1], 0x04000000U); ::xtcp_config::v1::LinkMonitorConfig* _msg = _internal_mutable_link_monitor(); // @@protoc_insertion_point(field_mutable:xtcp_config.v1.XtcpConfig.link_monitor) return _msg; @@ -13795,9 +14786,9 @@ inline void XtcpConfig::set_allocated_link_monitor(::xtcp_config::v1::LinkMonito if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[1], 0x02000000U); + SetHasBit(_impl_._has_bits_[1], 0x04000000U); } else { - ClearHasBit(_impl_._has_bits_[1], 0x02000000U); + ClearHasBit(_impl_._has_bits_[1], 0x04000000U); } _impl_.link_monitor_ = reinterpret_cast<::xtcp_config::v1::LinkMonitorConfig*>(value); @@ -13865,6 +14856,12 @@ template <> inline const EnumDescriptor* PROTOBUF_NONNULL GetEnumDescriptor<::xtcp_config::v1::ListenerAuthMode>() { return ::xtcp_config::v1::ListenerAuthMode_descriptor(); } +template <> +struct is_proto_enum<::xtcp_config::v1::EndpointClass> : std::true_type {}; +template <> +inline const EnumDescriptor* PROTOBUF_NONNULL GetEnumDescriptor<::xtcp_config::v1::EndpointClass>() { + return ::xtcp_config::v1::EndpointClass_descriptor(); +} } // namespace protobuf } // namespace google diff --git a/gen/dart/xtcp_config/v1/xtcp_config.pb.dart b/gen/dart/xtcp_config/v1/xtcp_config.pb.dart index 80c8564f9..690442e0e 100644 --- a/gen/dart/xtcp_config/v1/xtcp_config.pb.dart +++ b/gen/dart/xtcp_config/v1/xtcp_config.pb.dart @@ -1054,6 +1054,8 @@ class ListenerAuth extends $pb.GeneratedMessage { $core.int? signedTokenSkewMinutes, $1.Duration? failureJitterMin, $1.Duration? failureJitterMax, + $core.String? rawTokenFile, + $core.String? hmacSharedKeyFile, }) { final result = ListenerAuth._(); if (mode != null) result.mode = mode; @@ -1063,6 +1065,8 @@ class ListenerAuth extends $pb.GeneratedMessage { result.signedTokenSkewMinutes = signedTokenSkewMinutes; if (failureJitterMin != null) result.failureJitterMin = failureJitterMin; if (failureJitterMax != null) result.failureJitterMax = failureJitterMax; + if (rawTokenFile != null) result.rawTokenFile = rawTokenFile; + if (hmacSharedKeyFile != null) result.hmacSharedKeyFile = hmacSharedKeyFile; return result; } @@ -1089,6 +1093,8 @@ class ListenerAuth extends $pb.GeneratedMessage { subBuilder: $1.Duration.$_createMessage) ..aOM<$1.Duration>(6, _omitFieldNames ? '' : 'failureJitterMax', subBuilder: $1.Duration.$_createMessage) + ..aOS(7, _omitFieldNames ? '' : 'rawTokenFile') + ..aOS(8, _omitFieldNames ? '' : 'hmacSharedKeyFile') ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') @@ -1170,6 +1176,145 @@ class ListenerAuth extends $pb.GeneratedMessage { void clearFailureJitterMax() => $_clearField(6); @$pb.TagNumber(6) $1.Duration ensureFailureJitterMax() => $_ensure(5); + + /// Path to a file holding raw_token, read when the listener starts. For a + /// per-listener credential (Listener.auth / admin_auth), so the config + /// carries a path rather than the secret. The file must be a regular file + /// with no group or other permission bits. + @$pb.TagNumber(7) + $core.String get rawTokenFile => $_getSZ(6); + @$pb.TagNumber(7) + set rawTokenFile($core.String value) => $_setString(6, value); + @$pb.TagNumber(7) + $core.bool hasRawTokenFile() => $_has(6); + @$pb.TagNumber(7) + void clearRawTokenFile() => $_clearField(7); + + /// Path to a file holding hmac_shared_key; as raw_token_file. + @$pb.TagNumber(8) + $core.String get hmacSharedKeyFile => $_getSZ(7); + @$pb.TagNumber(8) + set hmacSharedKeyFile($core.String value) => $_setString(7, value); + @$pb.TagNumber(8) + $core.bool hasHmacSharedKeyFile() => $_has(7); + @$pb.TagNumber(8) + void clearHmacSharedKeyFile() => $_clearField(8); +} + +/// A listener: one socket, one credential pair, and the endpoint classes it +/// serves. See docs/security.md#listeners for the rules checked at startup. +class Listener extends $pb.GeneratedMessage { + factory Listener({ + $core.String? name, + ListenerEndpoint? endpoint, + ListenerAuth? auth, + ListenerAuth? adminAuth, + $core.Iterable? serves, + }) { + final result = Listener._(); + if (name != null) result.name = name; + if (endpoint != null) result.endpoint = endpoint; + if (auth != null) result.auth = auth; + if (adminAuth != null) result.adminAuth = adminAuth; + if (serves != null) result.serves.addAll(serves); + return result; + } + + Listener._(); + + factory Listener.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + Listener()..mergeFromBuffer(data, registry); + factory Listener.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + Listener()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'Listener', + package: const $pb.PackageName(_omitMessageNames ? '' : 'xtcp_config.v1'), + createEmptyInstance: Listener.$_createMessage) + ..aOS(1, _omitFieldNames ? '' : 'name') + ..aOM(2, _omitFieldNames ? '' : 'endpoint', + subBuilder: ListenerEndpoint.$_createMessage) + ..aOM(3, _omitFieldNames ? '' : 'auth', + subBuilder: ListenerAuth.$_createMessage) + ..aOM(4, _omitFieldNames ? '' : 'adminAuth', + subBuilder: ListenerAuth.$_createMessage) + ..pc(5, _omitFieldNames ? '' : 'serves', $pb.PbFieldType.KE, + valueOf: EndpointClass.valueOf, + enumValues: EndpointClass.values, + defaultEnumValue: EndpointClass.ENDPOINT_CLASS_UNSPECIFIED) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + Listener clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + Listener copyWith(void Function(Listener) updates) => + super.copyWith((message) => updates(message as Listener)) as Listener; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + @$core.Deprecated('Use Listener() / Listener.new instead') + static Listener create() => Listener._(); + static $pb.GeneratedMessage $_createMessage() => Listener._(); + @$core.override + Listener createEmptyInstance() => Listener._(); + @$core.pragma('dart2js:noInline') + static Listener getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(Listener.$_createMessage); + static Listener? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get name => $_getSZ(0); + @$pb.TagNumber(1) + set name($core.String value) => $_setString(0, value); + @$pb.TagNumber(1) + $core.bool hasName() => $_has(0); + @$pb.TagNumber(1) + void clearName() => $_clearField(1); + + /// network unix, or tcp typed explicitly. An unset network with an + /// address that is an absolute path means unix. + @$pb.TagNumber(2) + ListenerEndpoint get endpoint => $_getN(1); + @$pb.TagNumber(2) + set endpoint(ListenerEndpoint value) => $_setField(2, value); + @$pb.TagNumber(2) + $core.bool hasEndpoint() => $_has(1); + @$pb.TagNumber(2) + void clearEndpoint() => $_clearField(2); + @$pb.TagNumber(2) + ListenerEndpoint ensureEndpoint() => $_ensure(1); + + /// Unset: the daemon-wide listener_auth (-listenerAuthMode and the + /// LISTENER_* variables). An unspecified mode means raw. + @$pb.TagNumber(3) + ListenerAuth get auth => $_getN(2); + @$pb.TagNumber(3) + set auth(ListenerAuth value) => $_setField(3, value); + @$pb.TagNumber(3) + $core.bool hasAuth() => $_has(2); + @$pb.TagNumber(3) + void clearAuth() => $_clearField(3); + @$pb.TagNumber(3) + ListenerAuth ensureAuth() => $_ensure(2); + + /// Unset: the daemon-wide admin_listener_auth. + @$pb.TagNumber(4) + ListenerAuth get adminAuth => $_getN(3); + @$pb.TagNumber(4) + set adminAuth(ListenerAuth value) => $_setField(4, value); + @$pb.TagNumber(4) + $core.bool hasAdminAuth() => $_has(3); + @$pb.TagNumber(4) + void clearAdminAuth() => $_clearField(4); + @$pb.TagNumber(4) + ListenerAuth ensureAdminAuth() => $_ensure(3); + + @$pb.TagNumber(5) + $pb.PbList get serves => $_getList(4); } /// Embedded physical link monitor (pkg/linkmonitor), the same one the @@ -1721,6 +1866,7 @@ class XtcpConfig extends $pb.GeneratedMessage { ListenerAuth? adminListenerAuth, $core.int? grpcPort, ListenerEndpoint? grpcListener, + $core.Iterable? listeners, $core.String? pyroscopeUrl, $core.String? pyroscopeAppName, $core.int? pyroscopeSampleHz, @@ -1820,6 +1966,7 @@ class XtcpConfig extends $pb.GeneratedMessage { if (adminListenerAuth != null) result.adminListenerAuth = adminListenerAuth; if (grpcPort != null) result.grpcPort = grpcPort; if (grpcListener != null) result.grpcListener = grpcListener; + if (listeners != null) result.listeners.addAll(listeners); if (pyroscopeUrl != null) result.pyroscopeUrl = pyroscopeUrl; if (pyroscopeAppName != null) result.pyroscopeAppName = pyroscopeAppName; if (pyroscopeSampleHz != null) result.pyroscopeSampleHz = pyroscopeSampleHz; @@ -1963,6 +2110,8 @@ class XtcpConfig extends $pb.GeneratedMessage { ..aI(160, _omitFieldNames ? '' : 'grpcPort', fieldType: $pb.PbFieldType.OU3) ..aOM(161, _omitFieldNames ? '' : 'grpcListener', subBuilder: ListenerEndpoint.$_createMessage) + ..pPM(162, _omitFieldNames ? '' : 'listeners', + subBuilder: Listener.$_createMessage) ..aOS(170, _omitFieldNames ? '' : 'pyroscopeUrl') ..aOS(171, _omitFieldNames ? '' : 'pyroscopeAppName') ..aI(172, _omitFieldNames ? '' : 'pyroscopeSampleHz', @@ -2758,6 +2907,8 @@ class XtcpConfig extends $pb.GeneratedMessage { ListenerAuth ensureAdminListenerAuth() => $_ensure(56); /// GRPC listening port + /// Legacy: the gRPC port when -grpcPort (or GRPC_PORT) expands into a + /// listener. 0 when the listener model configures gRPC. @$pb.TagNumber(160) $core.int get grpcPort => $_getIZ(57); @$pb.TagNumber(160) @@ -2780,6 +2931,13 @@ class XtcpConfig extends $pb.GeneratedMessage { @$pb.TagNumber(161) ListenerEndpoint ensureGrpcListener() => $_ensure(58); + /// Every listener the daemon opens (-listener, LISTENERS). Empty means the + /// default: one UDS, /run/xtcp2/metrics.sock mode 0600, raw bearer auth, + /// serving health, metrics and metrics-detail. The legacy -promListen*, + /// -grpc* and -linkMonitorIPListen flags expand into entries here. + @$pb.TagNumber(162) + $pb.PbList get listeners => $_getList(59); + /// Pyroscope continuous-profiling server URL (e.g. /// http://127.0.0.1:4040). When set, the daemon streams CPU, /// memory, goroutine, mutex, and block profiles to that endpoint. @@ -2788,11 +2946,11 @@ class XtcpConfig extends $pb.GeneratedMessage { /// Grafana Cloud Pyroscope) and point xtcp2 at it for live profile /// data without restarts. @$pb.TagNumber(170) - $core.String get pyroscopeUrl => $_getSZ(59); + $core.String get pyroscopeUrl => $_getSZ(60); @$pb.TagNumber(170) - set pyroscopeUrl($core.String value) => $_setString(59, value); + set pyroscopeUrl($core.String value) => $_setString(60, value); @$pb.TagNumber(170) - $core.bool hasPyroscopeUrl() => $_has(59); + $core.bool hasPyroscopeUrl() => $_has(60); @$pb.TagNumber(170) void clearPyroscopeUrl() => $_clearField(170); @@ -2801,34 +2959,34 @@ class XtcpConfig extends $pb.GeneratedMessage { /// Set per fleet/role for multi-host environments /// (e.g. "xtcp2.prod.iad", "xtcp2.staging.fra"). @$pb.TagNumber(171) - $core.String get pyroscopeAppName => $_getSZ(60); + $core.String get pyroscopeAppName => $_getSZ(61); @$pb.TagNumber(171) - set pyroscopeAppName($core.String value) => $_setString(60, value); + set pyroscopeAppName($core.String value) => $_setString(61, value); @$pb.TagNumber(171) - $core.bool hasPyroscopeAppName() => $_has(60); + $core.bool hasPyroscopeAppName() => $_has(61); @$pb.TagNumber(171) void clearPyroscopeAppName() => $_clearField(171); /// CPU profile sampling rate in Hz. Default 100. The Pyroscope /// agent uses this to call runtime.SetCPUProfileRate at startup. @$pb.TagNumber(172) - $core.int get pyroscopeSampleHz => $_getIZ(61); + $core.int get pyroscopeSampleHz => $_getIZ(62); @$pb.TagNumber(172) - set pyroscopeSampleHz($core.int value) => $_setUnsignedInt32(61, value); + set pyroscopeSampleHz($core.int value) => $_setUnsignedInt32(62, value); @$pb.TagNumber(172) - $core.bool hasPyroscopeSampleHz() => $_has(61); + $core.bool hasPyroscopeSampleHz() => $_has(62); @$pb.TagNumber(172) void clearPyroscopeSampleHz() => $_clearField(172); /// Profile upload interval (seconds between batched profile /// pushes). Default 15 s. @$pb.TagNumber(173) - $core.int get pyroscopeUploadIntervalSec => $_getIZ(62); + $core.int get pyroscopeUploadIntervalSec => $_getIZ(63); @$pb.TagNumber(173) set pyroscopeUploadIntervalSec($core.int value) => - $_setUnsignedInt32(62, value); + $_setUnsignedInt32(63, value); @$pb.TagNumber(173) - $core.bool hasPyroscopeUploadIntervalSec() => $_has(62); + $core.bool hasPyroscopeUploadIntervalSec() => $_has(63); @$pb.TagNumber(173) void clearPyroscopeUploadIntervalSec() => $_clearField(173); @@ -2839,11 +2997,11 @@ class XtcpConfig extends $pb.GeneratedMessage { /// CONTAINER_ID_RESOLVE env. Needs /sys/fs/cgroup readable (mount it and run /// --cgroupns=host in a container). @$pb.TagNumber(200) - $core.bool get resolveContainerId => $_getBF(63); + $core.bool get resolveContainerId => $_getBF(64); @$pb.TagNumber(200) - set resolveContainerId($core.bool value) => $_setBool(63, value); + set resolveContainerId($core.bool value) => $_setBool(64, value); @$pb.TagNumber(200) - $core.bool hasResolveContainerId() => $_has(63); + $core.bool hasResolveContainerId() => $_has(64); @$pb.TagNumber(200) void clearResolveContainerId() => $_clearField(200); @@ -2851,21 +3009,21 @@ class XtcpConfig extends $pb.GeneratedMessage { /// by joining the socket's owning netns inode against the Docker Engine API /// index over docker_socket_path. Default false. @$pb.TagNumber(201) - $core.bool get enrichContainerEnable => $_getBF(64); + $core.bool get enrichContainerEnable => $_getBF(65); @$pb.TagNumber(201) - set enrichContainerEnable($core.bool value) => $_setBool(64, value); + set enrichContainerEnable($core.bool value) => $_setBool(65, value); @$pb.TagNumber(201) - $core.bool hasEnrichContainerEnable() => $_has(64); + $core.bool hasEnrichContainerEnable() => $_has(65); @$pb.TagNumber(201) void clearEnrichContainerEnable() => $_clearField(201); /// Docker Engine API unix socket. Default "/run/docker.sock". @$pb.TagNumber(202) - $core.String get dockerSocketPath => $_getSZ(65); + $core.String get dockerSocketPath => $_getSZ(66); @$pb.TagNumber(202) - set dockerSocketPath($core.String value) => $_setString(65, value); + set dockerSocketPath($core.String value) => $_setString(66, value); @$pb.TagNumber(202) - $core.bool hasDockerSocketPath() => $_has(65); + $core.bool hasDockerSocketPath() => $_has(66); @$pb.TagNumber(202) void clearDockerSocketPath() => $_clearField(202); @@ -2873,32 +3031,32 @@ class XtcpConfig extends $pb.GeneratedMessage { /// Enrich per-uplink LLDP neighbor labels by reading the lldpd control socket /// (lldpd_socket_path) once at startup. Default false. @$pb.TagNumber(210) - $core.bool get enrichLldpEnable => $_getBF(66); + $core.bool get enrichLldpEnable => $_getBF(67); @$pb.TagNumber(210) - set enrichLldpEnable($core.bool value) => $_setBool(66, value); + set enrichLldpEnable($core.bool value) => $_setBool(67, value); @$pb.TagNumber(210) - $core.bool hasEnrichLldpEnable() => $_has(66); + $core.bool hasEnrichLldpEnable() => $_has(67); @$pb.TagNumber(210) void clearEnrichLldpEnable() => $_clearField(210); /// lldpd control socket. Default "/run/lldpd.socket". @$pb.TagNumber(211) - $core.String get lldpdSocketPath => $_getSZ(67); + $core.String get lldpdSocketPath => $_getSZ(68); @$pb.TagNumber(211) - set lldpdSocketPath($core.String value) => $_setString(67, value); + set lldpdSocketPath($core.String value) => $_setString(68, value); @$pb.TagNumber(211) - $core.bool hasLldpdSocketPath() => $_has(67); + $core.bool hasLldpdSocketPath() => $_has(68); @$pb.TagNumber(211) void clearLldpdSocketPath() => $_clearField(211); /// Optional lldpd version hint ("1.0.13"/"1.0.18") selecting the struct-layout /// descriptor for the wire parser. Empty = auto-detect. Default "". @$pb.TagNumber(212) - $core.String get lldpdVersionHint => $_getSZ(68); + $core.String get lldpdVersionHint => $_getSZ(69); @$pb.TagNumber(212) - set lldpdVersionHint($core.String value) => $_setString(68, value); + set lldpdVersionHint($core.String value) => $_setString(69, value); @$pb.TagNumber(212) - $core.bool hasLldpdVersionHint() => $_has(68); + $core.bool hasLldpdVersionHint() => $_has(69); @$pb.TagNumber(212) void clearLldpdVersionHint() => $_clearField(212); @@ -2906,38 +3064,38 @@ class XtcpConfig extends $pb.GeneratedMessage { /// Enrich per-uplink NIC labels (driver/model/pci/speed/firmware) from sysfs + /// the ethtool ioctl once at startup. Default false. @$pb.TagNumber(220) - $core.bool get enrichNicEnable => $_getBF(69); + $core.bool get enrichNicEnable => $_getBF(70); @$pb.TagNumber(220) - set enrichNicEnable($core.bool value) => $_setBool(69, value); + set enrichNicEnable($core.bool value) => $_setBool(70, value); @$pb.TagNumber(220) - $core.bool hasEnrichNicEnable() => $_has(69); + $core.bool hasEnrichNicEnable() => $_has(70); @$pb.TagNumber(220) void clearEnrichNicEnable() => $_clearField(220); /// Number of host uplink slots to populate (dual-homed hosts = 2). Default 2. @$pb.TagNumber(221) - $core.int get uplinkCount => $_getIZ(70); + $core.int get uplinkCount => $_getIZ(71); @$pb.TagNumber(221) - set uplinkCount($core.int value) => $_setUnsignedInt32(70, value); + set uplinkCount($core.int value) => $_setUnsignedInt32(71, value); @$pb.TagNumber(221) - $core.bool hasUplinkCount() => $_has(70); + $core.bool hasUplinkCount() => $_has(71); @$pb.TagNumber(221) void clearUplinkCount() => $_clearField(221); /// Explicit uplink interface names, slot order. Empty = auto-detect from the /// default IPv4/IPv6 routes. @$pb.TagNumber(222) - $pb.PbList<$core.String> get uplinkInterfaces => $_getList(71); + $pb.PbList<$core.String> get uplinkInterfaces => $_getList(72); /// -- nsid (230-239) /// Populate nsid (record field 32) best-effort via RTM_GETNSID. Usually 0 for /// Docker/containerd namespaces. Default false. @$pb.TagNumber(230) - $core.bool get populateNsid => $_getBF(72); + $core.bool get populateNsid => $_getBF(73); @$pb.TagNumber(230) - set populateNsid($core.bool value) => $_setBool(72, value); + set populateNsid($core.bool value) => $_setBool(73, value); @$pb.TagNumber(230) - $core.bool hasPopulateNsid() => $_has(72); + $core.bool hasPopulateNsid() => $_has(73); @$pb.TagNumber(230) void clearPopulateNsid() => $_clearField(230); @@ -2948,47 +3106,47 @@ class XtcpConfig extends $pb.GeneratedMessage { /// enabled but asn_db_path is missing/unreadable, xtcp2 logs, bumps a counter, /// and leaves both columns empty. Default false. @$pb.TagNumber(240) - $core.bool get enrichAsnEnable => $_getBF(73); + $core.bool get enrichAsnEnable => $_getBF(74); @$pb.TagNumber(240) - set enrichAsnEnable($core.bool value) => $_setBool(73, value); + set enrichAsnEnable($core.bool value) => $_setBool(74, value); @$pb.TagNumber(240) - $core.bool hasEnrichAsnEnable() => $_has(73); + $core.bool hasEnrichAsnEnable() => $_has(74); @$pb.TagNumber(240) void clearEnrichAsnEnable() => $_clearField(240); /// Path to the ipfeed-collector Parquet artifact (prefix -> {asn, /// network_owner}). Default "". @$pb.TagNumber(241) - $core.String get asnDbPath => $_getSZ(74); + $core.String get asnDbPath => $_getSZ(75); @$pb.TagNumber(241) - set asnDbPath($core.String value) => $_setString(74, value); + set asnDbPath($core.String value) => $_setString(75, value); @$pb.TagNumber(241) - $core.bool hasAsnDbPath() => $_has(74); + $core.bool hasAsnDbPath() => $_has(75); @$pb.TagNumber(241) void clearAsnDbPath() => $_clearField(241); /// How often to reload asn_db_path in the background so a refreshed artifact /// is picked up without a restart. 0 = load once at startup, never reload. @$pb.TagNumber(242) - $1.Duration get asnRefreshInterval => $_getN(75); + $1.Duration get asnRefreshInterval => $_getN(76); @$pb.TagNumber(242) set asnRefreshInterval($1.Duration value) => $_setField(242, value); @$pb.TagNumber(242) - $core.bool hasAsnRefreshInterval() => $_has(75); + $core.bool hasAsnRefreshInterval() => $_has(76); @$pb.TagNumber(242) void clearAsnRefreshInterval() => $_clearField(242); @$pb.TagNumber(242) - $1.Duration ensureAsnRefreshInterval() => $_ensure(75); + $1.Duration ensureAsnRefreshInterval() => $_ensure(76); /// Optional zstd-compressed lookup artifact baked into the image and used at /// startup when no fresher writable cache is available. Default is supplied /// by the daemon CLI as /share/xtcp2/ipmeta/bootstrap.lookup.parquet.zst. @$pb.TagNumber(243) - $core.String get ipmetaBootstrapPath => $_getSZ(76); + $core.String get ipmetaBootstrapPath => $_getSZ(77); @$pb.TagNumber(243) - set ipmetaBootstrapPath($core.String value) => $_setString(76, value); + set ipmetaBootstrapPath($core.String value) => $_setString(77, value); @$pb.TagNumber(243) - $core.bool hasIpmetaBootstrapPath() => $_has(76); + $core.bool hasIpmetaBootstrapPath() => $_has(77); @$pb.TagNumber(243) void clearIpmetaBootstrapPath() => $_clearField(243); @@ -2997,11 +3155,11 @@ class XtcpConfig extends $pb.GeneratedMessage { /// The companion previous.lookup.parquet.zst in the same directory is kept /// as a recovery fallback. @$pb.TagNumber(244) - $core.String get ipmetaCachePath => $_getSZ(77); + $core.String get ipmetaCachePath => $_getSZ(78); @$pb.TagNumber(244) - set ipmetaCachePath($core.String value) => $_setString(77, value); + set ipmetaCachePath($core.String value) => $_setString(78, value); @$pb.TagNumber(244) - $core.bool hasIpmetaCachePath() => $_has(77); + $core.bool hasIpmetaCachePath() => $_has(78); @$pb.TagNumber(244) void clearIpmetaCachePath() => $_clearField(244); @@ -3014,11 +3172,11 @@ class XtcpConfig extends $pb.GeneratedMessage { /// Non-fatal: a per-namespace discovery failure just leaves that namespace's /// sockets unclassified (and is retried with backoff). Default false. @$pb.TagNumber(245) - $core.bool get enrichLocalityEnable => $_getBF(78); + $core.bool get enrichLocalityEnable => $_getBF(79); @$pb.TagNumber(245) - set enrichLocalityEnable($core.bool value) => $_setBool(78, value); + set enrichLocalityEnable($core.bool value) => $_setBool(79, value); @$pb.TagNumber(245) - $core.bool hasEnrichLocalityEnable() => $_has(78); + $core.bool hasEnrichLocalityEnable() => $_has(79); @$pb.TagNumber(245) void clearEnrichLocalityEnable() => $_clearField(245); @@ -3027,15 +3185,15 @@ class XtcpConfig extends $pb.GeneratedMessage { /// namespaces are always snapshotted on the next reconcile regardless. 0 = /// discover once per namespace, never refresh. Daemon default 60s. @$pb.TagNumber(246) - $1.Duration get localityRefreshInterval => $_getN(79); + $1.Duration get localityRefreshInterval => $_getN(80); @$pb.TagNumber(246) set localityRefreshInterval($1.Duration value) => $_setField(246, value); @$pb.TagNumber(246) - $core.bool hasLocalityRefreshInterval() => $_has(79); + $core.bool hasLocalityRefreshInterval() => $_has(80); @$pb.TagNumber(246) void clearLocalityRefreshInterval() => $_clearField(246); @$pb.TagNumber(246) - $1.Duration ensureLocalityRefreshInterval() => $_ensure(79); + $1.Duration ensureLocalityRefreshInterval() => $_ensure(80); /// Keep each namespace's locality snapshot current from rtnetlink /// notifications (link, address and route changes) instead of waiting for @@ -3043,25 +3201,25 @@ class XtcpConfig extends $pb.GeneratedMessage { /// locality_refresh_interval then becomes the backstop, a resync taken /// after that long. Needs enrich_locality_enable. Default false. @$pb.TagNumber(247) - $core.bool get localityEventsEnable => $_getBF(80); + $core.bool get localityEventsEnable => $_getBF(81); @$pb.TagNumber(247) - set localityEventsEnable($core.bool value) => $_setBool(80, value); + set localityEventsEnable($core.bool value) => $_setBool(81, value); @$pb.TagNumber(247) - $core.bool hasLocalityEventsEnable() => $_has(80); + $core.bool hasLocalityEventsEnable() => $_has(81); @$pb.TagNumber(247) void clearLocalityEventsEnable() => $_clearField(247); /// Physical link monitor; see LinkMonitorConfig. @$pb.TagNumber(250) - LinkMonitorConfig get linkMonitor => $_getN(81); + LinkMonitorConfig get linkMonitor => $_getN(82); @$pb.TagNumber(250) set linkMonitor(LinkMonitorConfig value) => $_setField(250, value); @$pb.TagNumber(250) - $core.bool hasLinkMonitor() => $_has(81); + $core.bool hasLinkMonitor() => $_has(82); @$pb.TagNumber(250) void clearLinkMonitor() => $_clearField(250); @$pb.TagNumber(250) - LinkMonitorConfig ensureLinkMonitor() => $_ensure(81); + LinkMonitorConfig ensureLinkMonitor() => $_ensure(82); } class EnabledDeserializers extends $pb.GeneratedMessage { diff --git a/gen/dart/xtcp_config/v1/xtcp_config.pbenum.dart b/gen/dart/xtcp_config/v1/xtcp_config.pbenum.dart index 6c3bacc5b..258233576 100644 --- a/gen/dart/xtcp_config/v1/xtcp_config.pbenum.dart +++ b/gen/dart/xtcp_config/v1/xtcp_config.pbenum.dart @@ -65,5 +65,63 @@ class ListenerAuthMode extends $pb.ProtobufEnum { const ListenerAuthMode._(super.value, super.name); } +/// EndpointClass groups the paths and RPCs a listener can serve. Every served +/// path or RPC belongs to exactly one class, and a class is served by at most +/// one listener; a class no listener names is not served at all. +class EndpointClass extends $pb.ProtobufEnum { + static const EndpointClass ENDPOINT_CLASS_UNSPECIFIED = + EndpointClass._(0, _omitEnumNames ? '' : 'ENDPOINT_CLASS_UNSPECIFIED'); + + /// /healthz, /readyz. + static const EndpointClass ENDPOINT_CLASS_HEALTH = + EndpointClass._(1, _omitEnumNames ? '' : 'ENDPOINT_CLASS_HEALTH'); + + /// The core Prometheus path (-promPath, /metrics). + static const EndpointClass ENDPOINT_CLASS_METRICS = + EndpointClass._(2, _omitEnumNames ? '' : 'ENDPOINT_CLASS_METRICS'); + + /// The link monitor detail paths: /metrics/[/] and + /// /metrics-all[/]. + static const EndpointClass ENDPOINT_CLASS_METRICS_DETAIL = + EndpointClass._(3, _omitEnumNames ? '' : 'ENDPOINT_CLASS_METRICS_DETAIL'); + + /// /ip and /i (goip show, GET-only). Needs link_monitor.ip_paths. + static const EndpointClass ENDPOINT_CLASS_IP = + EndpointClass._(4, _omitEnumNames ? '' : 'ENDPOINT_CLASS_IP'); + + /// /debug/pprof/* except cmdline, which is never served. + static const EndpointClass ENDPOINT_CLASS_DEBUG = + EndpointClass._(5, _omitEnumNames ? '' : 'ENDPOINT_CLASS_DEBUG'); + + /// gRPC read methods: FlatRecords, ConfigService.Get, the link monitor's + /// GetStatus/List*, health and reflection. Admin methods answer + /// Unimplemented on a listener that serves only this class. + static const EndpointClass ENDPOINT_CLASS_GRPC_READ = + EndpointClass._(6, _omitEnumNames ? '' : 'ENDPOINT_CLASS_GRPC_READ'); + + /// Every gRPC method, admin ones included (Set*, TriggerPoll*, + /// PollFlatRecords, Rebaseline, Resync). + static const EndpointClass ENDPOINT_CLASS_GRPC_ADMIN = + EndpointClass._(7, _omitEnumNames ? '' : 'ENDPOINT_CLASS_GRPC_ADMIN'); + + static const $core.List values = [ + ENDPOINT_CLASS_UNSPECIFIED, + ENDPOINT_CLASS_HEALTH, + ENDPOINT_CLASS_METRICS, + ENDPOINT_CLASS_METRICS_DETAIL, + ENDPOINT_CLASS_IP, + ENDPOINT_CLASS_DEBUG, + ENDPOINT_CLASS_GRPC_READ, + ENDPOINT_CLASS_GRPC_ADMIN, + ]; + + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 7); + static EndpointClass? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; + + const EndpointClass._(super.value, super.name); +} + const $core.bool _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/gen/dart/xtcp_config/v1/xtcp_config.pbjson.dart b/gen/dart/xtcp_config/v1/xtcp_config.pbjson.dart index 170d57380..a7ba14630 100644 --- a/gen/dart/xtcp_config/v1/xtcp_config.pbjson.dart +++ b/gen/dart/xtcp_config/v1/xtcp_config.pbjson.dart @@ -47,6 +47,29 @@ final $typed_data.Uint8List listenerAuthModeDescriptor = $convert.base64Decode( '8KG0xJU1RFTkVSX0FVVEhfTU9ERV9ESVNBQkxFRBABEiAKHExJU1RFTkVSX0FVVEhfTU9ERV9S' 'QVdfVE9LRU4QAhImCiJMSVNURU5FUl9BVVRIX01PREVfSE1BQ19VVENfTUlOVVRFEAM='); +@$core.Deprecated('Use endpointClassDescriptor instead') +const EndpointClass$json = { + '1': 'EndpointClass', + '2': [ + {'1': 'ENDPOINT_CLASS_UNSPECIFIED', '2': 0}, + {'1': 'ENDPOINT_CLASS_HEALTH', '2': 1}, + {'1': 'ENDPOINT_CLASS_METRICS', '2': 2}, + {'1': 'ENDPOINT_CLASS_METRICS_DETAIL', '2': 3}, + {'1': 'ENDPOINT_CLASS_IP', '2': 4}, + {'1': 'ENDPOINT_CLASS_DEBUG', '2': 5}, + {'1': 'ENDPOINT_CLASS_GRPC_READ', '2': 6}, + {'1': 'ENDPOINT_CLASS_GRPC_ADMIN', '2': 7}, + ], +}; + +/// Descriptor for `EndpointClass`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List endpointClassDescriptor = $convert.base64Decode( + 'Cg1FbmRwb2ludENsYXNzEh4KGkVORFBPSU5UX0NMQVNTX1VOU1BFQ0lGSUVEEAASGQoVRU5EUE' + '9JTlRfQ0xBU1NfSEVBTFRIEAESGgoWRU5EUE9JTlRfQ0xBU1NfTUVUUklDUxACEiEKHUVORFBP' + 'SU5UX0NMQVNTX01FVFJJQ1NfREVUQUlMEAMSFQoRRU5EUE9JTlRfQ0xBU1NfSVAQBBIYChRFTk' + 'RQT0lOVF9DTEFTU19ERUJVRxAFEhwKGEVORFBPSU5UX0NMQVNTX0dSUENfUkVBRBAGEh0KGUVO' + 'RFBPSU5UX0NMQVNTX0dSUENfQURNSU4QBw=='); + @$core.Deprecated('Use getRequestDescriptor instead') const GetRequest$json = { '1': 'GetRequest', @@ -462,6 +485,22 @@ const ListenerAuth$json = { '8': {}, '10': 'failureJitterMax' }, + { + '1': 'raw_token_file', + '3': 7, + '4': 1, + '5': 9, + '8': {}, + '10': 'rawTokenFile' + }, + { + '1': 'hmac_shared_key_file', + '3': 8, + '4': 1, + '5': 9, + '8': {}, + '10': 'hmacSharedKeyFile' + }, ], '7': {}, '8': [ @@ -478,11 +517,64 @@ final $typed_data.Uint8List listenerAuthDescriptor = $convert.base64Decode( 'b2tlblNrZXdNaW51dGVziAEBElEKEmZhaWx1cmVfaml0dGVyX21pbhgFIAEoCzIZLmdvb2dsZS' '5wcm90b2J1Zi5EdXJhdGlvbkIIukgFqgECMgBSEGZhaWx1cmVKaXR0ZXJNaW4SUQoSZmFpbHVy' 'ZV9qaXR0ZXJfbWF4GAYgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uQgi6SAWqAQIyAF' - 'IQZmFpbHVyZUppdHRlck1heDrhAbpI3QEa2gEKGkxpc3RlbmVyQXV0aC5mYWlsdXJlSml0dGVy' - 'EkZmYWlsdXJlX2ppdHRlcl9tYXggbXVzdCBiZSBncmVhdGVyIHRoYW4gb3IgZXF1YWwgdG8gZm' - 'FpbHVyZV9qaXR0ZXJfbWluGnQhaGFzKHRoaXMuZmFpbHVyZV9qaXR0ZXJfbWluKSB8fCAhaGFz' - 'KHRoaXMuZmFpbHVyZV9qaXR0ZXJfbWF4KSB8fCB0aGlzLmZhaWx1cmVfaml0dGVyX21heCA+PS' - 'B0aGlzLmZhaWx1cmVfaml0dGVyX21pbkIcChpfc2lnbmVkX3Rva2VuX3NrZXdfbWludXRlcw=='); + 'IQZmFpbHVyZUppdHRlck1heBIuCg5yYXdfdG9rZW5fZmlsZRgHIAEoCUIIukgFcgMYgCBSDHJh' + 'd1Rva2VuRmlsZRI5ChRobWFjX3NoYXJlZF9rZXlfZmlsZRgIIAEoCUIIukgFcgMYgCBSEWhtYW' + 'NTaGFyZWRLZXlGaWxlOuEBukjdARraAQoaTGlzdGVuZXJBdXRoLmZhaWx1cmVKaXR0ZXISRmZh' + 'aWx1cmVfaml0dGVyX21heCBtdXN0IGJlIGdyZWF0ZXIgdGhhbiBvciBlcXVhbCB0byBmYWlsdX' + 'JlX2ppdHRlcl9taW4adCFoYXModGhpcy5mYWlsdXJlX2ppdHRlcl9taW4pIHx8ICFoYXModGhp' + 'cy5mYWlsdXJlX2ppdHRlcl9tYXgpIHx8IHRoaXMuZmFpbHVyZV9qaXR0ZXJfbWF4ID49IHRoaX' + 'MuZmFpbHVyZV9qaXR0ZXJfbWluQhwKGl9zaWduZWRfdG9rZW5fc2tld19taW51dGVz'); + +@$core.Deprecated('Use listenerDescriptor instead') +const Listener$json = { + '1': 'Listener', + '2': [ + {'1': 'name', '3': 1, '4': 1, '5': 9, '8': {}, '10': 'name'}, + { + '1': 'endpoint', + '3': 2, + '4': 1, + '5': 11, + '6': '.xtcp_config.v1.ListenerEndpoint', + '8': {}, + '10': 'endpoint' + }, + { + '1': 'auth', + '3': 3, + '4': 1, + '5': 11, + '6': '.xtcp_config.v1.ListenerAuth', + '10': 'auth' + }, + { + '1': 'admin_auth', + '3': 4, + '4': 1, + '5': 11, + '6': '.xtcp_config.v1.ListenerAuth', + '10': 'adminAuth' + }, + { + '1': 'serves', + '3': 5, + '4': 3, + '5': 14, + '6': '.xtcp_config.v1.EndpointClass', + '8': {}, + '10': 'serves' + }, + ], +}; + +/// Descriptor for `Listener`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List listenerDescriptor = $convert.base64Decode( + 'CghMaXN0ZW5lchIwCgRuYW1lGAEgASgJQhy6SBlyFxABGCAyEV5bYS16XVthLXowLTktXSokUg' + 'RuYW1lEkQKCGVuZHBvaW50GAIgASgLMiAueHRjcF9jb25maWcudjEuTGlzdGVuZXJFbmRwb2lu' + 'dEIGukgDyAEBUghlbmRwb2ludBIwCgRhdXRoGAMgASgLMhwueHRjcF9jb25maWcudjEuTGlzdG' + 'VuZXJBdXRoUgRhdXRoEjsKCmFkbWluX2F1dGgYBCABKAsyHC54dGNwX2NvbmZpZy52MS5MaXN0' + 'ZW5lckF1dGhSCWFkbWluQXV0aBJMCgZzZXJ2ZXMYBSADKA4yHS54dGNwX2NvbmZpZy52MS5Fbm' + 'Rwb2ludENsYXNzQhW6SBKSAQ8IARAHGAEiB4IBBBABIABSBnNlcnZlcw=='); @$core.Deprecated('Use linkMonitorConfigDescriptor instead') const LinkMonitorConfig$json = { @@ -1071,6 +1163,15 @@ const XtcpConfig$json = { '8': {}, '10': 'grpcListener' }, + { + '1': 'listeners', + '3': 162, + '4': 3, + '5': 11, + '6': '.xtcp_config.v1.Listener', + '8': {}, + '10': 'listeners' + }, { '1': 'pyroscope_url', '3': 170, @@ -1300,35 +1401,36 @@ final $typed_data.Uint8List xtcpConfigDescriptor = $convert.base64Decode( 'c3RlbmVyQXV0aBJaChNwcm9tZXRoZXVzX2xpc3RlbmVyGJkBIAEoCzIgLnh0Y3BfY29uZmlnLn' 'YxLkxpc3RlbmVyRW5kcG9pbnRCBrpIA8gBAFIScHJvbWV0aGV1c0xpc3RlbmVyElUKE2FkbWlu' 'X2xpc3RlbmVyX2F1dGgYmgEgASgLMhwueHRjcF9jb25maWcudjEuTGlzdGVuZXJBdXRoQga6SA' - 'PIAQBSEWFkbWluTGlzdGVuZXJBdXRoEiwKCWdycGNfcG9ydBigASABKA1CDrpIC8gBASoGGP//' - 'AygBUghncnBjUG9ydBJOCg1ncnBjX2xpc3RlbmVyGKEBIAEoCzIgLnh0Y3BfY29uZmlnLnYxLk' - 'xpc3RlbmVyRW5kcG9pbnRCBrpIA8gBAFIMZ3JwY0xpc3RlbmVyEiwKDXB5cm9zY29wZV91cmwY' - 'qgEgASgJQga6SAPIAQBSDHB5cm9zY29wZVVybBI1ChJweXJvc2NvcGVfYXBwX25hbWUYqwEgAS' - 'gJQga6SAPIAQBSEHB5cm9zY29wZUFwcE5hbWUSNwoTcHlyb3Njb3BlX3NhbXBsZV9oehisASAB' - 'KA1CBrpIA8gBAFIRcHlyb3Njb3BlU2FtcGxlSHoSSgodcHlyb3Njb3BlX3VwbG9hZF9pbnRlcn' - 'ZhbF9zZWMYrQEgASgNQga6SAPIAQBSGnB5cm9zY29wZVVwbG9hZEludGVydmFsU2VjEjkKFHJl' - 'c29sdmVfY29udGFpbmVyX2lkGMgBIAEoCEIGukgDyAEAUhJyZXNvbHZlQ29udGFpbmVySWQSNw' - 'oXZW5yaWNoX2NvbnRhaW5lcl9lbmFibGUYyQEgASgIUhVlbnJpY2hDb250YWluZXJFbmFibGUS' - 'NwoSZG9ja2VyX3NvY2tldF9wYXRoGMoBIAEoCUIIukgFcgMY/wFSEGRvY2tlclNvY2tldFBhdG' - 'gSLQoSZW5yaWNoX2xsZHBfZW5hYmxlGNIBIAEoCFIQZW5yaWNoTGxkcEVuYWJsZRI1ChFsbGRw' - 'ZF9zb2NrZXRfcGF0aBjTASABKAlCCLpIBXIDGP8BUg9sbGRwZFNvY2tldFBhdGgSNgoSbGxkcG' - 'RfdmVyc2lvbl9oaW50GNQBIAEoCUIHukgEcgIYEFIQbGxkcGRWZXJzaW9uSGludBIrChFlbnJp' - 'Y2hfbmljX2VuYWJsZRjcASABKAhSD2VucmljaE5pY0VuYWJsZRIrCgx1cGxpbmtfY291bnQY3Q' - 'EgASgNQge6SAQqAhgCUgt1cGxpbmtDb3VudBI2ChF1cGxpbmtfaW50ZXJmYWNlcxjeASADKAlC' - 'CLpIBZIBAhACUhB1cGxpbmtJbnRlcmZhY2VzEiQKDXBvcHVsYXRlX25zaWQY5gEgASgIUgxwb3' - 'B1bGF0ZU5zaWQSKwoRZW5yaWNoX2Fzbl9lbmFibGUY8AEgASgIUg9lbnJpY2hBc25FbmFibGUS' - 'KQoLYXNuX2RiX3BhdGgY8QEgASgJQgi6SAVyAxj/AVIJYXNuRGJQYXRoEkwKFGFzbl9yZWZyZX' - 'NoX2ludGVydmFsGPIBIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvblISYXNuUmVmcmVz' - 'aEludGVydmFsEj0KFWlwbWV0YV9ib290c3RyYXBfcGF0aBjzASABKAlCCLpIBXIDGP8BUhNpcG' - '1ldGFCb290c3RyYXBQYXRoEjUKEWlwbWV0YV9jYWNoZV9wYXRoGPQBIAEoCUIIukgFcgMY/wFS' - 'D2lwbWV0YUNhY2hlUGF0aBI1ChZlbnJpY2hfbG9jYWxpdHlfZW5hYmxlGPUBIAEoCFIUZW5yaW' - 'NoTG9jYWxpdHlFbmFibGUSVgoZbG9jYWxpdHlfcmVmcmVzaF9pbnRlcnZhbBj2ASABKAsyGS5n' - 'b29nbGUucHJvdG9idWYuRHVyYXRpb25SF2xvY2FsaXR5UmVmcmVzaEludGVydmFsEjUKFmxvY2' - 'FsaXR5X2V2ZW50c19lbmFibGUY9wEgASgIUhRsb2NhbGl0eUV2ZW50c0VuYWJsZRJFCgxsaW5r' - 'X21vbml0b3IY+gEgASgLMiEueHRjcF9jb25maWcudjEuTGlua01vbml0b3JDb25maWdSC2xpbm' - 'tNb25pdG9yOnO6SHAabgoPWHRjcENvbmZpZy5wb2xsEjJQb2xsIHRpbWVvdXQgbXVzdCBiZSBs' - 'ZXNzIHRoYW4gcG9sbCBwb2xsX2ZyZXF1ZW5jeRondGhpcy5wb2xsX2ZyZXF1ZW5jeSA+IHRoaX' - 'MucG9sbF90aW1lb3V0'); + 'PIAQBSEWFkbWluTGlzdGVuZXJBdXRoEicKCWdycGNfcG9ydBigASABKA1CCbpIBioEGP//A1II' + 'Z3JwY1BvcnQSTgoNZ3JwY19saXN0ZW5lchihASABKAsyIC54dGNwX2NvbmZpZy52MS5MaXN0ZW' + '5lckVuZHBvaW50Qga6SAPIAQBSDGdycGNMaXN0ZW5lchJBCglsaXN0ZW5lcnMYogEgAygLMhgu' + 'eHRjcF9jb25maWcudjEuTGlzdGVuZXJCCLpIBZIBAhAQUglsaXN0ZW5lcnMSLAoNcHlyb3Njb3' + 'BlX3VybBiqASABKAlCBrpIA8gBAFIMcHlyb3Njb3BlVXJsEjUKEnB5cm9zY29wZV9hcHBfbmFt' + 'ZRirASABKAlCBrpIA8gBAFIQcHlyb3Njb3BlQXBwTmFtZRI3ChNweXJvc2NvcGVfc2FtcGxlX2' + 'h6GKwBIAEoDUIGukgDyAEAUhFweXJvc2NvcGVTYW1wbGVIehJKCh1weXJvc2NvcGVfdXBsb2Fk' + 'X2ludGVydmFsX3NlYxitASABKA1CBrpIA8gBAFIacHlyb3Njb3BlVXBsb2FkSW50ZXJ2YWxTZW' + 'MSOQoUcmVzb2x2ZV9jb250YWluZXJfaWQYyAEgASgIQga6SAPIAQBSEnJlc29sdmVDb250YWlu' + 'ZXJJZBI3ChdlbnJpY2hfY29udGFpbmVyX2VuYWJsZRjJASABKAhSFWVucmljaENvbnRhaW5lck' + 'VuYWJsZRI3ChJkb2NrZXJfc29ja2V0X3BhdGgYygEgASgJQgi6SAVyAxj/AVIQZG9ja2VyU29j' + 'a2V0UGF0aBItChJlbnJpY2hfbGxkcF9lbmFibGUY0gEgASgIUhBlbnJpY2hMbGRwRW5hYmxlEj' + 'UKEWxsZHBkX3NvY2tldF9wYXRoGNMBIAEoCUIIukgFcgMY/wFSD2xsZHBkU29ja2V0UGF0aBI2' + 'ChJsbGRwZF92ZXJzaW9uX2hpbnQY1AEgASgJQge6SARyAhgQUhBsbGRwZFZlcnNpb25IaW50Ei' + 'sKEWVucmljaF9uaWNfZW5hYmxlGNwBIAEoCFIPZW5yaWNoTmljRW5hYmxlEisKDHVwbGlua19j' + 'b3VudBjdASABKA1CB7pIBCoCGAJSC3VwbGlua0NvdW50EjYKEXVwbGlua19pbnRlcmZhY2VzGN' + '4BIAMoCUIIukgFkgECEAJSEHVwbGlua0ludGVyZmFjZXMSJAoNcG9wdWxhdGVfbnNpZBjmASAB' + 'KAhSDHBvcHVsYXRlTnNpZBIrChFlbnJpY2hfYXNuX2VuYWJsZRjwASABKAhSD2VucmljaEFzbk' + 'VuYWJsZRIpCgthc25fZGJfcGF0aBjxASABKAlCCLpIBXIDGP8BUglhc25EYlBhdGgSTAoUYXNu' + 'X3JlZnJlc2hfaW50ZXJ2YWwY8gEgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uUhJhc2' + '5SZWZyZXNoSW50ZXJ2YWwSPQoVaXBtZXRhX2Jvb3RzdHJhcF9wYXRoGPMBIAEoCUIIukgFcgMY' + '/wFSE2lwbWV0YUJvb3RzdHJhcFBhdGgSNQoRaXBtZXRhX2NhY2hlX3BhdGgY9AEgASgJQgi6SA' + 'VyAxj/AVIPaXBtZXRhQ2FjaGVQYXRoEjUKFmVucmljaF9sb2NhbGl0eV9lbmFibGUY9QEgASgI' + 'UhRlbnJpY2hMb2NhbGl0eUVuYWJsZRJWChlsb2NhbGl0eV9yZWZyZXNoX2ludGVydmFsGPYBIA' + 'EoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvblIXbG9jYWxpdHlSZWZyZXNoSW50ZXJ2YWwS' + 'NQoWbG9jYWxpdHlfZXZlbnRzX2VuYWJsZRj3ASABKAhSFGxvY2FsaXR5RXZlbnRzRW5hYmxlEk' + 'UKDGxpbmtfbW9uaXRvchj6ASABKAsyIS54dGNwX2NvbmZpZy52MS5MaW5rTW9uaXRvckNvbmZp' + 'Z1ILbGlua01vbml0b3I6c7pIcBpuCg9YdGNwQ29uZmlnLnBvbGwSMlBvbGwgdGltZW91dCBtdX' + 'N0IGJlIGxlc3MgdGhhbiBwb2xsIHBvbGxfZnJlcXVlbmN5Gid0aGlzLnBvbGxfZnJlcXVlbmN5' + 'ID4gdGhpcy5wb2xsX3RpbWVvdXQ='); @$core.Deprecated('Use enabledDeserializersDescriptor instead') const EnabledDeserializers$json = { diff --git a/gen/go/xtcp_config/xtcp_config.pb.go b/gen/go/xtcp_config/xtcp_config.pb.go index 7b94e166e..690e1a974 100644 --- a/gen/go/xtcp_config/xtcp_config.pb.go +++ b/gen/go/xtcp_config/xtcp_config.pb.go @@ -136,6 +136,84 @@ func (ListenerAuthMode) EnumDescriptor() ([]byte, []int) { return file_xtcp_config_v1_xtcp_config_proto_rawDescGZIP(), []int{1} } +// EndpointClass groups the paths and RPCs a listener can serve. Every served +// path or RPC belongs to exactly one class, and a class is served by at most +// one listener; a class no listener names is not served at all. +type EndpointClass int32 + +const ( + EndpointClass_ENDPOINT_CLASS_UNSPECIFIED EndpointClass = 0 + // /healthz, /readyz. + EndpointClass_ENDPOINT_CLASS_HEALTH EndpointClass = 1 + // The core Prometheus path (-promPath, /metrics). + EndpointClass_ENDPOINT_CLASS_METRICS EndpointClass = 2 + // The link monitor detail paths: /metrics/[/] and + // /metrics-all[/]. + EndpointClass_ENDPOINT_CLASS_METRICS_DETAIL EndpointClass = 3 + // /ip and /i (goip show, GET-only). Needs link_monitor.ip_paths. + EndpointClass_ENDPOINT_CLASS_IP EndpointClass = 4 + // /debug/pprof/* except cmdline, which is never served. + EndpointClass_ENDPOINT_CLASS_DEBUG EndpointClass = 5 + // gRPC read methods: FlatRecords, ConfigService.Get, the link monitor's + // GetStatus/List*, health and reflection. Admin methods answer + // Unimplemented on a listener that serves only this class. + EndpointClass_ENDPOINT_CLASS_GRPC_READ EndpointClass = 6 + // Every gRPC method, admin ones included (Set*, TriggerPoll*, + // PollFlatRecords, Rebaseline, Resync). + EndpointClass_ENDPOINT_CLASS_GRPC_ADMIN EndpointClass = 7 +) + +// Enum value maps for EndpointClass. +var ( + EndpointClass_name = map[int32]string{ + 0: "ENDPOINT_CLASS_UNSPECIFIED", + 1: "ENDPOINT_CLASS_HEALTH", + 2: "ENDPOINT_CLASS_METRICS", + 3: "ENDPOINT_CLASS_METRICS_DETAIL", + 4: "ENDPOINT_CLASS_IP", + 5: "ENDPOINT_CLASS_DEBUG", + 6: "ENDPOINT_CLASS_GRPC_READ", + 7: "ENDPOINT_CLASS_GRPC_ADMIN", + } + EndpointClass_value = map[string]int32{ + "ENDPOINT_CLASS_UNSPECIFIED": 0, + "ENDPOINT_CLASS_HEALTH": 1, + "ENDPOINT_CLASS_METRICS": 2, + "ENDPOINT_CLASS_METRICS_DETAIL": 3, + "ENDPOINT_CLASS_IP": 4, + "ENDPOINT_CLASS_DEBUG": 5, + "ENDPOINT_CLASS_GRPC_READ": 6, + "ENDPOINT_CLASS_GRPC_ADMIN": 7, + } +) + +func (x EndpointClass) Enum() *EndpointClass { + p := new(EndpointClass) + *p = x + return p +} + +func (x EndpointClass) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (EndpointClass) Descriptor() protoreflect.EnumDescriptor { + return file_xtcp_config_v1_xtcp_config_proto_enumTypes[2].Descriptor() +} + +func (EndpointClass) Type() protoreflect.EnumType { + return &file_xtcp_config_v1_xtcp_config_proto_enumTypes[2] +} + +func (x EndpointClass) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use EndpointClass.Descriptor instead. +func (EndpointClass) EnumDescriptor() ([]byte, []int) { + return file_xtcp_config_v1_xtcp_config_proto_rawDescGZIP(), []int{2} +} + type GetRequest struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields @@ -890,8 +968,15 @@ type ListenerAuth struct { SignedTokenSkewMinutes *uint32 `protobuf:"varint,4,opt,name=signed_token_skew_minutes,json=signedTokenSkewMinutes,proto3,oneof" json:"signed_token_skew_minutes,omitempty"` FailureJitterMin *durationpb.Duration `protobuf:"bytes,5,opt,name=failure_jitter_min,json=failureJitterMin,proto3" json:"failure_jitter_min,omitempty"` FailureJitterMax *durationpb.Duration `protobuf:"bytes,6,opt,name=failure_jitter_max,json=failureJitterMax,proto3" json:"failure_jitter_max,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // Path to a file holding raw_token, read when the listener starts. For a + // per-listener credential (Listener.auth / admin_auth), so the config + // carries a path rather than the secret. The file must be a regular file + // with no group or other permission bits. + RawTokenFile string `protobuf:"bytes,7,opt,name=raw_token_file,json=rawTokenFile,proto3" json:"raw_token_file,omitempty"` + // Path to a file holding hmac_shared_key; as raw_token_file. + HmacSharedKeyFile string `protobuf:"bytes,8,opt,name=hmac_shared_key_file,json=hmacSharedKeyFile,proto3" json:"hmac_shared_key_file,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ListenerAuth) Reset() { @@ -966,6 +1051,103 @@ func (x *ListenerAuth) GetFailureJitterMax() *durationpb.Duration { return nil } +func (x *ListenerAuth) GetRawTokenFile() string { + if x != nil { + return x.RawTokenFile + } + return "" +} + +func (x *ListenerAuth) GetHmacSharedKeyFile() string { + if x != nil { + return x.HmacSharedKeyFile + } + return "" +} + +// A listener: one socket, one credential pair, and the endpoint classes it +// serves. See docs/security.md#listeners for the rules checked at startup. +type Listener struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // network unix, or tcp typed explicitly. An unset network with an + // address that is an absolute path means unix. + Endpoint *ListenerEndpoint `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + // Unset: the daemon-wide listener_auth (-listenerAuthMode and the + // LISTENER_* variables). An unspecified mode means raw. + Auth *ListenerAuth `protobuf:"bytes,3,opt,name=auth,proto3" json:"auth,omitempty"` + // Unset: the daemon-wide admin_listener_auth. + AdminAuth *ListenerAuth `protobuf:"bytes,4,opt,name=admin_auth,json=adminAuth,proto3" json:"admin_auth,omitempty"` + Serves []EndpointClass `protobuf:"varint,5,rep,packed,name=serves,proto3,enum=xtcp_config.v1.EndpointClass" json:"serves,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Listener) Reset() { + *x = Listener{} + mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Listener) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Listener) ProtoMessage() {} + +func (x *Listener) ProtoReflect() protoreflect.Message { + mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Listener.ProtoReflect.Descriptor instead. +func (*Listener) Descriptor() ([]byte, []int) { + return file_xtcp_config_v1_xtcp_config_proto_rawDescGZIP(), []int{16} +} + +func (x *Listener) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Listener) GetEndpoint() *ListenerEndpoint { + if x != nil { + return x.Endpoint + } + return nil +} + +func (x *Listener) GetAuth() *ListenerAuth { + if x != nil { + return x.Auth + } + return nil +} + +func (x *Listener) GetAdminAuth() *ListenerAuth { + if x != nil { + return x.AdminAuth + } + return nil +} + +func (x *Listener) GetServes() []EndpointClass { + if x != nil { + return x.Serves + } + return nil +} + // Embedded physical link monitor (pkg/linkmonitor), the same one the // standalone go-link-monitor runs. Unset durations and empty strings take the // library defaults (see linkmonitor.DefaultConfig); xtcp2 supplies its own @@ -1059,7 +1241,7 @@ type LinkMonitorConfig struct { func (x *LinkMonitorConfig) Reset() { *x = LinkMonitorConfig{} - mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[16] + mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1071,7 +1253,7 @@ func (x *LinkMonitorConfig) String() string { func (*LinkMonitorConfig) ProtoMessage() {} func (x *LinkMonitorConfig) ProtoReflect() protoreflect.Message { - mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[16] + mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1084,7 +1266,7 @@ func (x *LinkMonitorConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use LinkMonitorConfig.ProtoReflect.Descriptor instead. func (*LinkMonitorConfig) Descriptor() ([]byte, []int) { - return file_xtcp_config_v1_xtcp_config_proto_rawDescGZIP(), []int{16} + return file_xtcp_config_v1_xtcp_config_proto_rawDescGZIP(), []int{17} } func (x *LinkMonitorConfig) GetEnable() bool { @@ -1572,10 +1754,17 @@ type XtcpConfig struct { // responses. AdminListenerAuth *ListenerAuth `protobuf:"bytes,154,opt,name=admin_listener_auth,json=adminListenerAuth,proto3" json:"admin_listener_auth,omitempty"` // GRPC listening port + // Legacy: the gRPC port when -grpcPort (or GRPC_PORT) expands into a + // listener. 0 when the listener model configures gRPC. GrpcPort uint32 `protobuf:"varint,160,opt,name=grpc_port,json=grpcPort,proto3" json:"grpc_port,omitempty"` // gRPC listener endpoint. When unset, the daemon keeps the legacy TCP // behavior derived from grpc_port. GrpcListener *ListenerEndpoint `protobuf:"bytes,161,opt,name=grpc_listener,json=grpcListener,proto3" json:"grpc_listener,omitempty"` + // Every listener the daemon opens (-listener, LISTENERS). Empty means the + // default: one UDS, /run/xtcp2/metrics.sock mode 0600, raw bearer auth, + // serving health, metrics and metrics-detail. The legacy -promListen*, + // -grpc* and -linkMonitorIPListen flags expand into entries here. + Listeners []*Listener `protobuf:"bytes,162,rep,name=listeners,proto3" json:"listeners,omitempty"` // Pyroscope continuous-profiling server URL (e.g. // http://127.0.0.1:4040). When set, the daemon streams CPU, // memory, goroutine, mutex, and block profiles to that endpoint. @@ -1680,7 +1869,7 @@ type XtcpConfig struct { func (x *XtcpConfig) Reset() { *x = XtcpConfig{} - mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[17] + mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1692,7 +1881,7 @@ func (x *XtcpConfig) String() string { func (*XtcpConfig) ProtoMessage() {} func (x *XtcpConfig) ProtoReflect() protoreflect.Message { - mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[17] + mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1705,7 +1894,7 @@ func (x *XtcpConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use XtcpConfig.ProtoReflect.Descriptor instead. func (*XtcpConfig) Descriptor() ([]byte, []int) { - return file_xtcp_config_v1_xtcp_config_proto_rawDescGZIP(), []int{17} + return file_xtcp_config_v1_xtcp_config_proto_rawDescGZIP(), []int{18} } func (x *XtcpConfig) GetNlTimeoutMilliseconds() uint64 { @@ -2121,6 +2310,13 @@ func (x *XtcpConfig) GetGrpcListener() *ListenerEndpoint { return nil } +func (x *XtcpConfig) GetListeners() []*Listener { + if x != nil { + return x.Listeners + } + return nil +} + func (x *XtcpConfig) GetPyroscopeUrl() string { if x != nil { return x.PyroscopeUrl @@ -2291,7 +2487,7 @@ type EnabledDeserializers struct { func (x *EnabledDeserializers) Reset() { *x = EnabledDeserializers{} - mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[18] + mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2303,7 +2499,7 @@ func (x *EnabledDeserializers) String() string { func (*EnabledDeserializers) ProtoMessage() {} func (x *EnabledDeserializers) ProtoReflect() protoreflect.Message { - mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[18] + mi := &file_xtcp_config_v1_xtcp_config_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2316,7 +2512,7 @@ func (x *EnabledDeserializers) ProtoReflect() protoreflect.Message { // Deprecated: Use EnabledDeserializers.ProtoReflect.Descriptor instead. func (*EnabledDeserializers) Descriptor() ([]byte, []int) { - return file_xtcp_config_v1_xtcp_config_proto_rawDescGZIP(), []int{18} + return file_xtcp_config_v1_xtcp_config_proto_rawDescGZIP(), []int{19} } func (x *EnabledDeserializers) GetEnabled() map[string]bool { @@ -2378,16 +2574,25 @@ const file_xtcp_config_v1_xtcp_config_proto_rawDesc = "" + "\x18unlink_stale_unix_socket\x18\x04 \x01(\bR\x15unlinkStaleUnixSocket\x122\n" + "\x0fmax_connections\x18\x05 \x01(\rB\t\xbaH\x06*\x04\x18\xa0\x8d\x06R\x0emaxConnections\x12>\n" + "\x16accept_rate_per_second\x18\x06 \x01(\rB\t\xbaH\x06*\x04\x18\xa0\x8d\x06R\x13acceptRatePerSecond\x12,\n" + - "\faccept_burst\x18\a \x01(\rB\t\xbaH\x06*\x04\x18\xa0\x8d\x06R\vacceptBurst\"\x98\x05\n" + + "\faccept_burst\x18\a \x01(\rB\t\xbaH\x06*\x04\x18\xa0\x8d\x06R\vacceptBurst\"\x83\x06\n" + "\fListenerAuth\x12>\n" + "\x04mode\x18\x01 \x01(\x0e2 .xtcp_config.v1.ListenerAuthModeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04mode\x12%\n" + "\traw_token\x18\x02 \x01(\tB\b\xbaH\x05r\x03\x18\x80 R\brawToken\x120\n" + "\x0fhmac_shared_key\x18\x03 \x01(\tB\b\xbaH\x05r\x03\x18\x80 R\rhmacSharedKey\x12G\n" + "\x19signed_token_skew_minutes\x18\x04 \x01(\rB\a\xbaH\x04*\x02\x18\x05H\x00R\x16signedTokenSkewMinutes\x88\x01\x01\x12Q\n" + "\x12failure_jitter_min\x18\x05 \x01(\v2\x19.google.protobuf.DurationB\b\xbaH\x05\xaa\x01\x022\x00R\x10failureJitterMin\x12Q\n" + - "\x12failure_jitter_max\x18\x06 \x01(\v2\x19.google.protobuf.DurationB\b\xbaH\x05\xaa\x01\x022\x00R\x10failureJitterMax:\xe1\x01\xbaH\xdd\x01\x1a\xda\x01\n" + + "\x12failure_jitter_max\x18\x06 \x01(\v2\x19.google.protobuf.DurationB\b\xbaH\x05\xaa\x01\x022\x00R\x10failureJitterMax\x12.\n" + + "\x0eraw_token_file\x18\a \x01(\tB\b\xbaH\x05r\x03\x18\x80 R\frawTokenFile\x129\n" + + "\x14hmac_shared_key_file\x18\b \x01(\tB\b\xbaH\x05r\x03\x18\x80 R\x11hmacSharedKeyFile:\xe1\x01\xbaH\xdd\x01\x1a\xda\x01\n" + "\x1aListenerAuth.failureJitter\x12Ffailure_jitter_max must be greater than or equal to failure_jitter_min\x1at!has(this.failure_jitter_min) || !has(this.failure_jitter_max) || this.failure_jitter_max >= this.failure_jitter_minB\x1c\n" + - "\x1a_signed_token_skew_minutes\"\x9a\x0e\n" + + "\x1a_signed_token_skew_minutes\"\xbf\x02\n" + + "\bListener\x120\n" + + "\x04name\x18\x01 \x01(\tB\x1c\xbaH\x19r\x17\x10\x01\x18 2\x11^[a-z][a-z0-9-]*$R\x04name\x12D\n" + + "\bendpoint\x18\x02 \x01(\v2 .xtcp_config.v1.ListenerEndpointB\x06\xbaH\x03\xc8\x01\x01R\bendpoint\x120\n" + + "\x04auth\x18\x03 \x01(\v2\x1c.xtcp_config.v1.ListenerAuthR\x04auth\x12;\n" + + "\n" + + "admin_auth\x18\x04 \x01(\v2\x1c.xtcp_config.v1.ListenerAuthR\tadminAuth\x12L\n" + + "\x06serves\x18\x05 \x03(\x0e2\x1d.xtcp_config.v1.EndpointClassB\x15\xbaH\x12\x92\x01\x0f\b\x01\x10\a\x18\x01\"\a\x82\x01\x04\x10\x01 \x00R\x06serves\"\x9a\x0e\n" + "\x11LinkMonitorConfig\x12\x16\n" + "\x06enable\x18\x01 \x01(\bR\x06enable\x12-\n" + "\rbaseline_file\x18\x02 \x01(\tB\b\xbaH\x05r\x03\x18\x80 R\fbaselineFile\x12A\n" + @@ -2425,7 +2630,7 @@ const file_xtcp_config_v1_xtcp_config_proto_rawDesc = "" + "\x0e_error_classesB\x15\n" + "\x13_metrics_categoriesB\x1a\n" + "\x18_metrics_interface_pathsB\x13\n" + - "\x11_metrics_all_path\"\xea%\n" + + "\x11_metrics_all_path\"\xa8&\n" + "\n" + "XtcpConfig\x12F\n" + "\x17nl_timeout_milliseconds\x18\n" + @@ -2507,9 +2712,10 @@ const file_xtcp_config_v1_xtcp_config_proto_rawDesc = "" + "\x0eipv6_hop_limit\x18\x97\x01 \x01(\rB\v\xbaH\b\xc8\x01\x00*\x03\x18\xff\x01R\fipv6HopLimit\x12J\n" + "\rlistener_auth\x18\x98\x01 \x01(\v2\x1c.xtcp_config.v1.ListenerAuthB\x06\xbaH\x03\xc8\x01\x00R\flistenerAuth\x12Z\n" + "\x13prometheus_listener\x18\x99\x01 \x01(\v2 .xtcp_config.v1.ListenerEndpointB\x06\xbaH\x03\xc8\x01\x00R\x12prometheusListener\x12U\n" + - "\x13admin_listener_auth\x18\x9a\x01 \x01(\v2\x1c.xtcp_config.v1.ListenerAuthB\x06\xbaH\x03\xc8\x01\x00R\x11adminListenerAuth\x12,\n" + - "\tgrpc_port\x18\xa0\x01 \x01(\rB\x0e\xbaH\v\xc8\x01\x01*\x06\x18\xff\xff\x03(\x01R\bgrpcPort\x12N\n" + - "\rgrpc_listener\x18\xa1\x01 \x01(\v2 .xtcp_config.v1.ListenerEndpointB\x06\xbaH\x03\xc8\x01\x00R\fgrpcListener\x12,\n" + + "\x13admin_listener_auth\x18\x9a\x01 \x01(\v2\x1c.xtcp_config.v1.ListenerAuthB\x06\xbaH\x03\xc8\x01\x00R\x11adminListenerAuth\x12'\n" + + "\tgrpc_port\x18\xa0\x01 \x01(\rB\t\xbaH\x06*\x04\x18\xff\xff\x03R\bgrpcPort\x12N\n" + + "\rgrpc_listener\x18\xa1\x01 \x01(\v2 .xtcp_config.v1.ListenerEndpointB\x06\xbaH\x03\xc8\x01\x00R\fgrpcListener\x12A\n" + + "\tlisteners\x18\xa2\x01 \x03(\v2\x18.xtcp_config.v1.ListenerB\b\xbaH\x05\x92\x01\x02\x10\x10R\tlisteners\x12,\n" + "\rpyroscope_url\x18\xaa\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\fpyroscopeUrl\x125\n" + "\x12pyroscope_app_name\x18\xab\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x10pyroscopeAppName\x127\n" + "\x13pyroscope_sample_hz\x18\xac\x01 \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x11pyroscopeSampleHz\x12J\n" + @@ -2547,7 +2753,16 @@ const file_xtcp_config_v1_xtcp_config_proto_rawDesc = "" + "\x1eLISTENER_AUTH_MODE_UNSPECIFIED\x10\x00\x12\x1f\n" + "\x1bLISTENER_AUTH_MODE_DISABLED\x10\x01\x12 \n" + "\x1cLISTENER_AUTH_MODE_RAW_TOKEN\x10\x02\x12&\n" + - "\"LISTENER_AUTH_MODE_HMAC_UTC_MINUTE\x10\x032\xa5\a\n" + + "\"LISTENER_AUTH_MODE_HMAC_UTC_MINUTE\x10\x03*\xf7\x01\n" + + "\rEndpointClass\x12\x1e\n" + + "\x1aENDPOINT_CLASS_UNSPECIFIED\x10\x00\x12\x19\n" + + "\x15ENDPOINT_CLASS_HEALTH\x10\x01\x12\x1a\n" + + "\x16ENDPOINT_CLASS_METRICS\x10\x02\x12!\n" + + "\x1dENDPOINT_CLASS_METRICS_DETAIL\x10\x03\x12\x15\n" + + "\x11ENDPOINT_CLASS_IP\x10\x04\x12\x18\n" + + "\x14ENDPOINT_CLASS_DEBUG\x10\x05\x12\x1c\n" + + "\x18ENDPOINT_CLASS_GRPC_READ\x10\x06\x12\x1d\n" + + "\x19ENDPOINT_CLASS_GRPC_ADMIN\x10\a2\xa5\a\n" + "\rConfigService\x12a\n" + "\x03Get\x12\x1a.xtcp_config.v1.GetRequest\x1a\x1b.xtcp_config.v1.GetResponse\"!\xc8\xf3\x18\x01\x82\xd3\xe4\x93\x02\x17:\x01*\x1a\x12/ConfigService/Get\x12a\n" + "\x03Set\x12\x1a.xtcp_config.v1.SetRequest\x1a\x1b.xtcp_config.v1.SetResponse\"!\xc8\xf3\x18\x02\x82\xd3\xe4\x93\x02\x17:\x01*\x1a\x12/ConfigService/Set\x12\x95\x01\n" + @@ -2570,93 +2785,100 @@ func file_xtcp_config_v1_xtcp_config_proto_rawDescGZIP() []byte { return file_xtcp_config_v1_xtcp_config_proto_rawDescData } -var file_xtcp_config_v1_xtcp_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_xtcp_config_v1_xtcp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_xtcp_config_v1_xtcp_config_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_xtcp_config_v1_xtcp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_xtcp_config_v1_xtcp_config_proto_goTypes = []any{ (ListenerNetwork)(0), // 0: xtcp_config.v1.ListenerNetwork (ListenerAuthMode)(0), // 1: xtcp_config.v1.ListenerAuthMode - (*GetRequest)(nil), // 2: xtcp_config.v1.GetRequest - (*GetResponse)(nil), // 3: xtcp_config.v1.GetResponse - (*SetRequest)(nil), // 4: xtcp_config.v1.SetRequest - (*SetResponse)(nil), // 5: xtcp_config.v1.SetResponse - (*SetPollFrequencyRequest)(nil), // 6: xtcp_config.v1.SetPollFrequencyRequest - (*SetPollFrequencyResponse)(nil), // 7: xtcp_config.v1.SetPollFrequencyResponse - (*TriggerPollRequest)(nil), // 8: xtcp_config.v1.TriggerPollRequest - (*TriggerPollResponse)(nil), // 9: xtcp_config.v1.TriggerPollResponse - (*TriggerPollBurstRequest)(nil), // 10: xtcp_config.v1.TriggerPollBurstRequest - (*TriggerPollBurstResponse)(nil), // 11: xtcp_config.v1.TriggerPollBurstResponse - (*SetS3UploadRequest)(nil), // 12: xtcp_config.v1.SetS3UploadRequest - (*SetS3UploadResponse)(nil), // 13: xtcp_config.v1.SetS3UploadResponse - (*SetEnvelopeFlushRequest)(nil), // 14: xtcp_config.v1.SetEnvelopeFlushRequest - (*SetEnvelopeFlushResponse)(nil), // 15: xtcp_config.v1.SetEnvelopeFlushResponse - (*ListenerEndpoint)(nil), // 16: xtcp_config.v1.ListenerEndpoint - (*ListenerAuth)(nil), // 17: xtcp_config.v1.ListenerAuth - (*LinkMonitorConfig)(nil), // 18: xtcp_config.v1.LinkMonitorConfig - (*XtcpConfig)(nil), // 19: xtcp_config.v1.XtcpConfig - (*EnabledDeserializers)(nil), // 20: xtcp_config.v1.EnabledDeserializers - nil, // 21: xtcp_config.v1.EnabledDeserializers.EnabledEntry - (*durationpb.Duration)(nil), // 22: google.protobuf.Duration + (EndpointClass)(0), // 2: xtcp_config.v1.EndpointClass + (*GetRequest)(nil), // 3: xtcp_config.v1.GetRequest + (*GetResponse)(nil), // 4: xtcp_config.v1.GetResponse + (*SetRequest)(nil), // 5: xtcp_config.v1.SetRequest + (*SetResponse)(nil), // 6: xtcp_config.v1.SetResponse + (*SetPollFrequencyRequest)(nil), // 7: xtcp_config.v1.SetPollFrequencyRequest + (*SetPollFrequencyResponse)(nil), // 8: xtcp_config.v1.SetPollFrequencyResponse + (*TriggerPollRequest)(nil), // 9: xtcp_config.v1.TriggerPollRequest + (*TriggerPollResponse)(nil), // 10: xtcp_config.v1.TriggerPollResponse + (*TriggerPollBurstRequest)(nil), // 11: xtcp_config.v1.TriggerPollBurstRequest + (*TriggerPollBurstResponse)(nil), // 12: xtcp_config.v1.TriggerPollBurstResponse + (*SetS3UploadRequest)(nil), // 13: xtcp_config.v1.SetS3UploadRequest + (*SetS3UploadResponse)(nil), // 14: xtcp_config.v1.SetS3UploadResponse + (*SetEnvelopeFlushRequest)(nil), // 15: xtcp_config.v1.SetEnvelopeFlushRequest + (*SetEnvelopeFlushResponse)(nil), // 16: xtcp_config.v1.SetEnvelopeFlushResponse + (*ListenerEndpoint)(nil), // 17: xtcp_config.v1.ListenerEndpoint + (*ListenerAuth)(nil), // 18: xtcp_config.v1.ListenerAuth + (*Listener)(nil), // 19: xtcp_config.v1.Listener + (*LinkMonitorConfig)(nil), // 20: xtcp_config.v1.LinkMonitorConfig + (*XtcpConfig)(nil), // 21: xtcp_config.v1.XtcpConfig + (*EnabledDeserializers)(nil), // 22: xtcp_config.v1.EnabledDeserializers + nil, // 23: xtcp_config.v1.EnabledDeserializers.EnabledEntry + (*durationpb.Duration)(nil), // 24: google.protobuf.Duration } var file_xtcp_config_v1_xtcp_config_proto_depIdxs = []int32{ - 19, // 0: xtcp_config.v1.GetResponse.config:type_name -> xtcp_config.v1.XtcpConfig - 19, // 1: xtcp_config.v1.SetRequest.config:type_name -> xtcp_config.v1.XtcpConfig - 19, // 2: xtcp_config.v1.SetResponse.config:type_name -> xtcp_config.v1.XtcpConfig - 22, // 3: xtcp_config.v1.SetPollFrequencyRequest.poll_frequency:type_name -> google.protobuf.Duration - 22, // 4: xtcp_config.v1.SetPollFrequencyRequest.poll_timeout:type_name -> google.protobuf.Duration - 19, // 5: xtcp_config.v1.SetPollFrequencyResponse.config:type_name -> xtcp_config.v1.XtcpConfig - 22, // 6: xtcp_config.v1.TriggerPollBurstRequest.interval:type_name -> google.protobuf.Duration - 22, // 7: xtcp_config.v1.TriggerPollBurstResponse.interval:type_name -> google.protobuf.Duration - 22, // 8: xtcp_config.v1.SetS3UploadRequest.s3_flush_interval:type_name -> google.protobuf.Duration - 19, // 9: xtcp_config.v1.SetS3UploadResponse.config:type_name -> xtcp_config.v1.XtcpConfig - 19, // 10: xtcp_config.v1.SetEnvelopeFlushResponse.config:type_name -> xtcp_config.v1.XtcpConfig + 21, // 0: xtcp_config.v1.GetResponse.config:type_name -> xtcp_config.v1.XtcpConfig + 21, // 1: xtcp_config.v1.SetRequest.config:type_name -> xtcp_config.v1.XtcpConfig + 21, // 2: xtcp_config.v1.SetResponse.config:type_name -> xtcp_config.v1.XtcpConfig + 24, // 3: xtcp_config.v1.SetPollFrequencyRequest.poll_frequency:type_name -> google.protobuf.Duration + 24, // 4: xtcp_config.v1.SetPollFrequencyRequest.poll_timeout:type_name -> google.protobuf.Duration + 21, // 5: xtcp_config.v1.SetPollFrequencyResponse.config:type_name -> xtcp_config.v1.XtcpConfig + 24, // 6: xtcp_config.v1.TriggerPollBurstRequest.interval:type_name -> google.protobuf.Duration + 24, // 7: xtcp_config.v1.TriggerPollBurstResponse.interval:type_name -> google.protobuf.Duration + 24, // 8: xtcp_config.v1.SetS3UploadRequest.s3_flush_interval:type_name -> google.protobuf.Duration + 21, // 9: xtcp_config.v1.SetS3UploadResponse.config:type_name -> xtcp_config.v1.XtcpConfig + 21, // 10: xtcp_config.v1.SetEnvelopeFlushResponse.config:type_name -> xtcp_config.v1.XtcpConfig 0, // 11: xtcp_config.v1.ListenerEndpoint.network:type_name -> xtcp_config.v1.ListenerNetwork 1, // 12: xtcp_config.v1.ListenerAuth.mode:type_name -> xtcp_config.v1.ListenerAuthMode - 22, // 13: xtcp_config.v1.ListenerAuth.failure_jitter_min:type_name -> google.protobuf.Duration - 22, // 14: xtcp_config.v1.ListenerAuth.failure_jitter_max:type_name -> google.protobuf.Duration - 22, // 15: xtcp_config.v1.LinkMonitorConfig.settle:type_name -> google.protobuf.Duration - 22, // 16: xtcp_config.v1.LinkMonitorConfig.resync:type_name -> google.protobuf.Duration - 22, // 17: xtcp_config.v1.LinkMonitorConfig.stats_interval:type_name -> google.protobuf.Duration - 22, // 18: xtcp_config.v1.LinkMonitorConfig.watch_interval:type_name -> google.protobuf.Duration - 22, // 19: xtcp_config.v1.LinkMonitorConfig.slow_interval:type_name -> google.protobuf.Duration - 22, // 20: xtcp_config.v1.LinkMonitorConfig.on_demand_ttl:type_name -> google.protobuf.Duration - 22, // 21: xtcp_config.v1.LinkMonitorConfig.on_demand_wait:type_name -> google.protobuf.Duration - 22, // 22: xtcp_config.v1.LinkMonitorConfig.error_window:type_name -> google.protobuf.Duration - 22, // 23: xtcp_config.v1.LinkMonitorConfig.flap_window:type_name -> google.protobuf.Duration - 22, // 24: xtcp_config.v1.LinkMonitorConfig.learn_deadline:type_name -> google.protobuf.Duration - 22, // 25: xtcp_config.v1.XtcpConfig.poll_frequency:type_name -> google.protobuf.Duration - 22, // 26: xtcp_config.v1.XtcpConfig.poll_timeout:type_name -> google.protobuf.Duration - 20, // 27: xtcp_config.v1.XtcpConfig.enabled_deserializers:type_name -> xtcp_config.v1.EnabledDeserializers - 22, // 28: xtcp_config.v1.XtcpConfig.reconcile_frequency:type_name -> google.protobuf.Duration - 22, // 29: xtcp_config.v1.XtcpConfig.kafka_produce_timeout:type_name -> google.protobuf.Duration - 22, // 30: xtcp_config.v1.XtcpConfig.s3_flush_interval:type_name -> google.protobuf.Duration - 22, // 31: xtcp_config.v1.XtcpConfig.s3_upload_backoff_cap:type_name -> google.protobuf.Duration - 17, // 32: xtcp_config.v1.XtcpConfig.listener_auth:type_name -> xtcp_config.v1.ListenerAuth - 16, // 33: xtcp_config.v1.XtcpConfig.prometheus_listener:type_name -> xtcp_config.v1.ListenerEndpoint - 17, // 34: xtcp_config.v1.XtcpConfig.admin_listener_auth:type_name -> xtcp_config.v1.ListenerAuth - 16, // 35: xtcp_config.v1.XtcpConfig.grpc_listener:type_name -> xtcp_config.v1.ListenerEndpoint - 22, // 36: xtcp_config.v1.XtcpConfig.asn_refresh_interval:type_name -> google.protobuf.Duration - 22, // 37: xtcp_config.v1.XtcpConfig.locality_refresh_interval:type_name -> google.protobuf.Duration - 18, // 38: xtcp_config.v1.XtcpConfig.link_monitor:type_name -> xtcp_config.v1.LinkMonitorConfig - 21, // 39: xtcp_config.v1.EnabledDeserializers.enabled:type_name -> xtcp_config.v1.EnabledDeserializers.EnabledEntry - 2, // 40: xtcp_config.v1.ConfigService.Get:input_type -> xtcp_config.v1.GetRequest - 4, // 41: xtcp_config.v1.ConfigService.Set:input_type -> xtcp_config.v1.SetRequest - 6, // 42: xtcp_config.v1.ConfigService.SetPollFrequency:input_type -> xtcp_config.v1.SetPollFrequencyRequest - 8, // 43: xtcp_config.v1.ConfigService.TriggerPoll:input_type -> xtcp_config.v1.TriggerPollRequest - 10, // 44: xtcp_config.v1.ConfigService.TriggerPollBurst:input_type -> xtcp_config.v1.TriggerPollBurstRequest - 12, // 45: xtcp_config.v1.ConfigService.SetS3Upload:input_type -> xtcp_config.v1.SetS3UploadRequest - 14, // 46: xtcp_config.v1.ConfigService.SetEnvelopeFlush:input_type -> xtcp_config.v1.SetEnvelopeFlushRequest - 3, // 47: xtcp_config.v1.ConfigService.Get:output_type -> xtcp_config.v1.GetResponse - 5, // 48: xtcp_config.v1.ConfigService.Set:output_type -> xtcp_config.v1.SetResponse - 7, // 49: xtcp_config.v1.ConfigService.SetPollFrequency:output_type -> xtcp_config.v1.SetPollFrequencyResponse - 9, // 50: xtcp_config.v1.ConfigService.TriggerPoll:output_type -> xtcp_config.v1.TriggerPollResponse - 11, // 51: xtcp_config.v1.ConfigService.TriggerPollBurst:output_type -> xtcp_config.v1.TriggerPollBurstResponse - 13, // 52: xtcp_config.v1.ConfigService.SetS3Upload:output_type -> xtcp_config.v1.SetS3UploadResponse - 15, // 53: xtcp_config.v1.ConfigService.SetEnvelopeFlush:output_type -> xtcp_config.v1.SetEnvelopeFlushResponse - 47, // [47:54] is the sub-list for method output_type - 40, // [40:47] is the sub-list for method input_type - 40, // [40:40] is the sub-list for extension type_name - 40, // [40:40] is the sub-list for extension extendee - 0, // [0:40] is the sub-list for field type_name + 24, // 13: xtcp_config.v1.ListenerAuth.failure_jitter_min:type_name -> google.protobuf.Duration + 24, // 14: xtcp_config.v1.ListenerAuth.failure_jitter_max:type_name -> google.protobuf.Duration + 17, // 15: xtcp_config.v1.Listener.endpoint:type_name -> xtcp_config.v1.ListenerEndpoint + 18, // 16: xtcp_config.v1.Listener.auth:type_name -> xtcp_config.v1.ListenerAuth + 18, // 17: xtcp_config.v1.Listener.admin_auth:type_name -> xtcp_config.v1.ListenerAuth + 2, // 18: xtcp_config.v1.Listener.serves:type_name -> xtcp_config.v1.EndpointClass + 24, // 19: xtcp_config.v1.LinkMonitorConfig.settle:type_name -> google.protobuf.Duration + 24, // 20: xtcp_config.v1.LinkMonitorConfig.resync:type_name -> google.protobuf.Duration + 24, // 21: xtcp_config.v1.LinkMonitorConfig.stats_interval:type_name -> google.protobuf.Duration + 24, // 22: xtcp_config.v1.LinkMonitorConfig.watch_interval:type_name -> google.protobuf.Duration + 24, // 23: xtcp_config.v1.LinkMonitorConfig.slow_interval:type_name -> google.protobuf.Duration + 24, // 24: xtcp_config.v1.LinkMonitorConfig.on_demand_ttl:type_name -> google.protobuf.Duration + 24, // 25: xtcp_config.v1.LinkMonitorConfig.on_demand_wait:type_name -> google.protobuf.Duration + 24, // 26: xtcp_config.v1.LinkMonitorConfig.error_window:type_name -> google.protobuf.Duration + 24, // 27: xtcp_config.v1.LinkMonitorConfig.flap_window:type_name -> google.protobuf.Duration + 24, // 28: xtcp_config.v1.LinkMonitorConfig.learn_deadline:type_name -> google.protobuf.Duration + 24, // 29: xtcp_config.v1.XtcpConfig.poll_frequency:type_name -> google.protobuf.Duration + 24, // 30: xtcp_config.v1.XtcpConfig.poll_timeout:type_name -> google.protobuf.Duration + 22, // 31: xtcp_config.v1.XtcpConfig.enabled_deserializers:type_name -> xtcp_config.v1.EnabledDeserializers + 24, // 32: xtcp_config.v1.XtcpConfig.reconcile_frequency:type_name -> google.protobuf.Duration + 24, // 33: xtcp_config.v1.XtcpConfig.kafka_produce_timeout:type_name -> google.protobuf.Duration + 24, // 34: xtcp_config.v1.XtcpConfig.s3_flush_interval:type_name -> google.protobuf.Duration + 24, // 35: xtcp_config.v1.XtcpConfig.s3_upload_backoff_cap:type_name -> google.protobuf.Duration + 18, // 36: xtcp_config.v1.XtcpConfig.listener_auth:type_name -> xtcp_config.v1.ListenerAuth + 17, // 37: xtcp_config.v1.XtcpConfig.prometheus_listener:type_name -> xtcp_config.v1.ListenerEndpoint + 18, // 38: xtcp_config.v1.XtcpConfig.admin_listener_auth:type_name -> xtcp_config.v1.ListenerAuth + 17, // 39: xtcp_config.v1.XtcpConfig.grpc_listener:type_name -> xtcp_config.v1.ListenerEndpoint + 19, // 40: xtcp_config.v1.XtcpConfig.listeners:type_name -> xtcp_config.v1.Listener + 24, // 41: xtcp_config.v1.XtcpConfig.asn_refresh_interval:type_name -> google.protobuf.Duration + 24, // 42: xtcp_config.v1.XtcpConfig.locality_refresh_interval:type_name -> google.protobuf.Duration + 20, // 43: xtcp_config.v1.XtcpConfig.link_monitor:type_name -> xtcp_config.v1.LinkMonitorConfig + 23, // 44: xtcp_config.v1.EnabledDeserializers.enabled:type_name -> xtcp_config.v1.EnabledDeserializers.EnabledEntry + 3, // 45: xtcp_config.v1.ConfigService.Get:input_type -> xtcp_config.v1.GetRequest + 5, // 46: xtcp_config.v1.ConfigService.Set:input_type -> xtcp_config.v1.SetRequest + 7, // 47: xtcp_config.v1.ConfigService.SetPollFrequency:input_type -> xtcp_config.v1.SetPollFrequencyRequest + 9, // 48: xtcp_config.v1.ConfigService.TriggerPoll:input_type -> xtcp_config.v1.TriggerPollRequest + 11, // 49: xtcp_config.v1.ConfigService.TriggerPollBurst:input_type -> xtcp_config.v1.TriggerPollBurstRequest + 13, // 50: xtcp_config.v1.ConfigService.SetS3Upload:input_type -> xtcp_config.v1.SetS3UploadRequest + 15, // 51: xtcp_config.v1.ConfigService.SetEnvelopeFlush:input_type -> xtcp_config.v1.SetEnvelopeFlushRequest + 4, // 52: xtcp_config.v1.ConfigService.Get:output_type -> xtcp_config.v1.GetResponse + 6, // 53: xtcp_config.v1.ConfigService.Set:output_type -> xtcp_config.v1.SetResponse + 8, // 54: xtcp_config.v1.ConfigService.SetPollFrequency:output_type -> xtcp_config.v1.SetPollFrequencyResponse + 10, // 55: xtcp_config.v1.ConfigService.TriggerPoll:output_type -> xtcp_config.v1.TriggerPollResponse + 12, // 56: xtcp_config.v1.ConfigService.TriggerPollBurst:output_type -> xtcp_config.v1.TriggerPollBurstResponse + 14, // 57: xtcp_config.v1.ConfigService.SetS3Upload:output_type -> xtcp_config.v1.SetS3UploadResponse + 16, // 58: xtcp_config.v1.ConfigService.SetEnvelopeFlush:output_type -> xtcp_config.v1.SetEnvelopeFlushResponse + 52, // [52:59] is the sub-list for method output_type + 45, // [45:52] is the sub-list for method input_type + 45, // [45:45] is the sub-list for extension type_name + 45, // [45:45] is the sub-list for extension extendee + 0, // [0:45] is the sub-list for field type_name } func init() { file_xtcp_config_v1_xtcp_config_proto_init() } @@ -2665,14 +2887,14 @@ func file_xtcp_config_v1_xtcp_config_proto_init() { return } file_xtcp_config_v1_xtcp_config_proto_msgTypes[15].OneofWrappers = []any{} - file_xtcp_config_v1_xtcp_config_proto_msgTypes[16].OneofWrappers = []any{} + file_xtcp_config_v1_xtcp_config_proto_msgTypes[17].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_xtcp_config_v1_xtcp_config_proto_rawDesc), len(file_xtcp_config_v1_xtcp_config_proto_rawDesc)), - NumEnums: 2, - NumMessages: 20, + NumEnums: 3, + NumMessages: 21, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/go/xtcp_config/xtcp_config_vtproto.pb.go b/gen/go/xtcp_config/xtcp_config_vtproto.pb.go index 880854d89..71b397772 100644 --- a/gen/go/xtcp_config/xtcp_config_vtproto.pb.go +++ b/gen/go/xtcp_config/xtcp_config_vtproto.pb.go @@ -734,6 +734,20 @@ func (m *ListenerAuth) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.HmacSharedKeyFile) > 0 { + i -= len(m.HmacSharedKeyFile) + copy(dAtA[i:], m.HmacSharedKeyFile) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.HmacSharedKeyFile))) + i-- + dAtA[i] = 0x42 + } + if len(m.RawTokenFile) > 0 { + i -= len(m.RawTokenFile) + copy(dAtA[i:], m.RawTokenFile) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RawTokenFile))) + i-- + dAtA[i] = 0x3a + } if m.FailureJitterMax != nil { size, err := (*durationpb.Duration)(m.FailureJitterMax).MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -781,6 +795,97 @@ func (m *ListenerAuth) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Listener) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Listener) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Listener) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Serves) > 0 { + var pksize2 int + for _, num := range m.Serves { + pksize2 += protohelpers.SizeOfVarint(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num1 := range m.Serves { + num := uint64(num1) + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) + i-- + dAtA[i] = 0x2a + } + if m.AdminAuth != nil { + size, err := m.AdminAuth.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if m.Auth != nil { + size, err := m.Auth.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.Endpoint != nil { + size, err := m.Endpoint.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *LinkMonitorConfig) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -1344,6 +1449,20 @@ func (m *XtcpConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0xd2 } + if len(m.Listeners) > 0 { + for iNdEx := len(m.Listeners) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Listeners[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + i-- + dAtA[i] = 0x92 + } + } if m.GrpcListener != nil { size, err := m.GrpcListener.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -2182,6 +2301,47 @@ func (m *ListenerAuth) SizeVT() (n int) { l = (*durationpb.Duration)(m.FailureJitterMax).SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + l = len(m.RawTokenFile) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.HmacSharedKeyFile) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Listener) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Endpoint != nil { + l = m.Endpoint.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Auth != nil { + l = m.Auth.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.AdminAuth != nil { + l = m.AdminAuth.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Serves) > 0 { + l = 0 + for _, e := range m.Serves { + l += protohelpers.SizeOfVarint(uint64(e)) + } + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l + } n += len(m.unknownFields) return n } @@ -2519,6 +2679,12 @@ func (m *XtcpConfig) SizeVT() (n int) { l = m.GrpcListener.SizeVT() n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } + if len(m.Listeners) > 0 { + for _, e := range m.Listeners { + l = e.SizeVT() + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } l = len(m.PyroscopeUrl) if l > 0 { n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) @@ -4231,6 +4397,330 @@ func (m *ListenerAuth) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RawTokenFile", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RawTokenFile = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HmacSharedKeyFile", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HmacSharedKeyFile = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Listener) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Listener: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Listener: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Endpoint == nil { + m.Endpoint = &ListenerEndpoint{} + } + if err := m.Endpoint.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &ListenerAuth{} + } + if err := m.Auth.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AdminAuth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AdminAuth == nil { + m.AdminAuth = &ListenerAuth{} + } + if err := m.AdminAuth.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType == 0 { + var v EndpointClass + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= EndpointClass(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Serves = append(m.Serves, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + if elementCount != 0 && len(m.Serves) == 0 { + m.Serves = make([]EndpointClass, 0, elementCount) + } + for iNdEx < postIndex { + var v EndpointClass + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= EndpointClass(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Serves = append(m.Serves, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Serves", wireType) + } default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -6785,6 +7275,40 @@ func (m *XtcpConfig) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 162: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Listeners", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Listeners = append(m.Listeners, &Listener{}) + if err := m.Listeners[len(m.Listeners)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 170: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PyroscopeUrl", wireType) diff --git a/gen/openapi/xtcp_config/v1/xtcp_config.swagger.json b/gen/openapi/xtcp_config/v1/xtcp_config.swagger.json index 0ced49bd5..1733cfa54 100644 --- a/gen/openapi/xtcp_config/v1/xtcp_config.swagger.json +++ b/gen/openapi/xtcp_config/v1/xtcp_config.swagger.json @@ -285,6 +285,21 @@ } } }, + "v1EndpointClass": { + "type": "string", + "enum": [ + "ENDPOINT_CLASS_UNSPECIFIED", + "ENDPOINT_CLASS_HEALTH", + "ENDPOINT_CLASS_METRICS", + "ENDPOINT_CLASS_METRICS_DETAIL", + "ENDPOINT_CLASS_IP", + "ENDPOINT_CLASS_DEBUG", + "ENDPOINT_CLASS_GRPC_READ", + "ENDPOINT_CLASS_GRPC_ADMIN" + ], + "default": "ENDPOINT_CLASS_UNSPECIFIED", + "description": "EndpointClass groups the paths and RPCs a listener can serve. Every served\npath or RPC belongs to exactly one class, and a class is served by at most\none listener; a class no listener names is not served at all.\n\n - ENDPOINT_CLASS_HEALTH: /healthz, /readyz.\n - ENDPOINT_CLASS_METRICS: The core Prometheus path (-promPath, /metrics).\n - ENDPOINT_CLASS_METRICS_DETAIL: The link monitor detail paths: /metrics/\u003ccategory\u003e[/\u003ciface\u003e] and\n/metrics-all[/\u003ciface\u003e].\n - ENDPOINT_CLASS_IP: /ip and /i (goip show, GET-only). Needs link_monitor.ip_paths.\n - ENDPOINT_CLASS_DEBUG: /debug/pprof/* except cmdline, which is never served.\n - ENDPOINT_CLASS_GRPC_READ: gRPC read methods: FlatRecords, ConfigService.Get, the link monitor's\nGetStatus/List*, health and reflection. Admin methods answer\nUnimplemented on a listener that serves only this class.\n - ENDPOINT_CLASS_GRPC_ADMIN: Every gRPC method, admin ones included (Set*, TriggerPoll*,\nPollFlatRecords, Rebaseline, Resync)." + }, "v1GetRequest": { "type": "object", "title": "empty" @@ -416,6 +431,33 @@ }, "description": "Embedded physical link monitor (pkg/linkmonitor), the same one the\nstandalone go-link-monitor runs. Unset durations and empty strings take the\nlibrary defaults (see linkmonitor.DefaultConfig); xtcp2 supplies its own\nbaseline_file default. An embedded and a standalone monitor must not share a\nbaseline file: the second fails to take the lock and xtcp2 exits." }, + "v1Listener": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "endpoint": { + "$ref": "#/definitions/v1ListenerEndpoint", + "description": "network unix, or tcp typed explicitly. An unset network with an\naddress that is an absolute path means unix." + }, + "auth": { + "$ref": "#/definitions/v1ListenerAuth", + "description": "Unset: the daemon-wide listener_auth (-listenerAuthMode and the\nLISTENER_* variables). An unspecified mode means raw." + }, + "adminAuth": { + "$ref": "#/definitions/v1ListenerAuth", + "description": "Unset: the daemon-wide admin_listener_auth." + }, + "serves": { + "type": "array", + "items": { + "$ref": "#/definitions/v1EndpointClass" + } + } + }, + "description": "A listener: one socket, one credential pair, and the endpoint classes it\nserves. See docs/security.md#listeners for the rules checked at startup." + }, "v1ListenerAuth": { "type": "object", "properties": { @@ -437,6 +479,14 @@ }, "failureJitterMax": { "type": "string" + }, + "rawTokenFile": { + "type": "string", + "description": "Path to a file holding raw_token, read when the listener starts. For a\nper-listener credential (Listener.auth / admin_auth), so the config\ncarries a path rather than the secret. The file must be a regular file\nwith no group or other permission bits." + }, + "hmacSharedKeyFile": { + "type": "string", + "description": "Path to a file holding hmac_shared_key; as raw_token_file." } } }, @@ -862,12 +912,20 @@ "grpcPort": { "type": "integer", "format": "int64", - "title": "GRPC listening port" + "description": "GRPC listening port\nLegacy: the gRPC port when -grpcPort (or GRPC_PORT) expands into a\nlistener. 0 when the listener model configures gRPC." }, "grpcListener": { "$ref": "#/definitions/v1ListenerEndpoint", "description": "gRPC listener endpoint. When unset, the daemon keeps the legacy TCP\nbehavior derived from grpc_port." }, + "listeners": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Listener" + }, + "description": "Every listener the daemon opens (-listener, LISTENERS). Empty means the\ndefault: one UDS, /run/xtcp2/metrics.sock mode 0600, raw bearer auth,\nserving health, metrics and metrics-detail. The legacy -promListen*,\n-grpc* and -linkMonitorIPListen flags expand into entries here." + }, "pyroscopeUrl": { "type": "string", "description": "Pyroscope continuous-profiling server URL (e.g.\nhttp://127.0.0.1:4040). When set, the daemon streams CPU,\nmemory, goroutine, mutex, and block profiles to that endpoint.\nEmpty disables the agent — no overhead in production runs that\ndon't need it. Operators bring up a Pyroscope OSS server (or\nGrafana Cloud Pyroscope) and point xtcp2 at it for live profile\ndata without restarts." diff --git a/gen/python/xtcp_config/v1/xtcp_config_pb2.py b/gen/python/xtcp_config/v1/xtcp_config_pb2.py index 25fdeb721..652d4af6e 100644 --- a/gen/python/xtcp_config/v1/xtcp_config_pb2.py +++ b/gen/python/xtcp_config/v1/xtcp_config_pb2.py @@ -28,7 +28,7 @@ from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n xtcp_config/v1/xtcp_config.proto\x12\x0extcp_config.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1cxtcp_auth/v1/xtcp_auth.proto\x1a\x1b\x62uf/validate/validate.proto\"\x0c\n\nGetRequest\"A\n\x0bGetResponse\x12\x32\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1a.xtcp_config.v1.XtcpConfigR\x06\x63onfig\"@\n\nSetRequest\x12\x32\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1a.xtcp_config.v1.XtcpConfigR\x06\x63onfig\"A\n\x0bSetResponse\x12\x32\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1a.xtcp_config.v1.XtcpConfigR\x06\x63onfig\"\xb4\x02\n\x17SetPollFrequencyRequest\x12S\n\x0epoll_frequency\x18\x14 \x01(\x0b\x32\x19.google.protobuf.DurationB\x11\xbaH\x0e\xaa\x01\x08\"\x04\x08\x80\xf5$2\x00\xc8\x01\x01R\rpollFrequency\x12O\n\x0cpoll_timeout\x18\x1e \x01(\x0b\x32\x19.google.protobuf.DurationB\x11\xbaH\x0e\xaa\x01\x08\"\x04\x08\x80\xf5$2\x00\xc8\x01\x01R\x0bpollTimeout:s\xbaHp\x1an\n\x0fXtcpConfig.poll\x12\x32Poll timeout must be less than poll poll_frequency\x1a\'this.poll_timeout < this.poll_frequency\"N\n\x18SetPollFrequencyResponse\x12\x32\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1a.xtcp_config.v1.XtcpConfigR\x06\x63onfig\"\x14\n\x12TriggerPollRequest\"\x15\n\x13TriggerPollResponse\"\x89\x01\n\x17TriggerPollBurstRequest\x12#\n\x05\x63ount\x18\n \x01(\rB\r\xbaH\n*\x05\x18\xe8\x07(\x01\xc8\x01\x01R\x05\x63ount\x12I\n\x08interval\x18\x14 \x01(\x0b\x32\x19.google.protobuf.DurationB\x12\xbaH\x0f\xaa\x01\t\"\x03\x08\x90\x1c\x32\x02\x08\x01\xc8\x01\x01R\x08interval\"g\n\x18TriggerPollBurstResponse\x12\x14\n\x05\x63ount\x18\n \x01(\rR\x05\x63ount\x12\x35\n\x08interval\x18\x14 \x01(\x0b\x32\x19.google.protobuf.DurationR\x08interval\"\xe3\x02\n\x12SetS3UploadRequest\x12R\n\x11s3_flush_interval\x18\n \x01(\x0b\x32\x19.google.protobuf.DurationB\x0b\xbaH\x08\xaa\x01\x02\x32\x00\xc8\x01\x00R\x0fs3FlushInterval\x12N\n s3_parquet_flush_threshold_bytes\x18\x14 \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1cs3ParquetFlushThresholdBytes:\xa8\x01\xbaH\xa4\x01\x1a\xa1\x01\n\x16SetS3Upload.atLeastOne\x12=set s3_flush_interval and/or s3_parquet_flush_threshold_bytes\x1aHhas(this.s3_flush_interval) || this.s3_parquet_flush_threshold_bytes > 0\"I\n\x13SetS3UploadResponse\x12\x32\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1a.xtcp_config.v1.XtcpConfigR\x06\x63onfig\"\xf4\x02\n\x17SetEnvelopeFlushRequest\x12K\n\x1e\x65nvelope_flush_threshold_bytes\x18\n \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1b\x65nvelopeFlushThresholdBytes\x12I\n\x1d\x65nvelope_flush_threshold_rows\x18\x14 \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1a\x65nvelopeFlushThresholdRows:\xc0\x01\xbaH\xbc\x01\x1a\xb9\x01\n\x1bSetEnvelopeFlush.atLeastOne\x12Gset envelope_flush_threshold_bytes and/or envelope_flush_threshold_rows\x1aQthis.envelope_flush_threshold_bytes > 0 || this.envelope_flush_threshold_rows > 0\"N\n\x18SetEnvelopeFlushResponse\x12\x32\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1a.xtcp_config.v1.XtcpConfigR\x06\x63onfig\"\x8a\x03\n\x10ListenerEndpoint\x12\x43\n\x07network\x18\x01 \x01(\x0e\x32\x1f.xtcp_config.v1.ListenerNetworkB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x07network\x12\"\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x04R\x07\x61\x64\x64ress\x12\x32\n\x10unix_socket_mode\x18\x03 \x01(\rB\x08\xbaH\x05*\x03\x18\xff\x03R\x0eunixSocketMode\x12\x37\n\x18unlink_stale_unix_socket\x18\x04 \x01(\x08R\x15unlinkStaleUnixSocket\x12\x32\n\x0fmax_connections\x18\x05 \x01(\rB\t\xbaH\x06*\x04\x18\xa0\x8d\x06R\x0emaxConnections\x12>\n\x16\x61\x63\x63\x65pt_rate_per_second\x18\x06 \x01(\rB\t\xbaH\x06*\x04\x18\xa0\x8d\x06R\x13\x61\x63\x63\x65ptRatePerSecond\x12,\n\x0c\x61\x63\x63\x65pt_burst\x18\x07 \x01(\rB\t\xbaH\x06*\x04\x18\xa0\x8d\x06R\x0b\x61\x63\x63\x65ptBurst\"\x98\x05\n\x0cListenerAuth\x12>\n\x04mode\x18\x01 \x01(\x0e\x32 .xtcp_config.v1.ListenerAuthModeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04mode\x12%\n\traw_token\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x08rawToken\x12\x30\n\x0fhmac_shared_key\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\rhmacSharedKey\x12G\n\x19signed_token_skew_minutes\x18\x04 \x01(\rB\x07\xbaH\x04*\x02\x18\x05H\x00R\x16signedTokenSkewMinutes\x88\x01\x01\x12Q\n\x12\x66\x61ilure_jitter_min\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x08\xbaH\x05\xaa\x01\x02\x32\x00R\x10\x66\x61ilureJitterMin\x12Q\n\x12\x66\x61ilure_jitter_max\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x08\xbaH\x05\xaa\x01\x02\x32\x00R\x10\x66\x61ilureJitterMax:\xe1\x01\xbaH\xdd\x01\x1a\xda\x01\n\x1aListenerAuth.failureJitter\x12\x46\x66\x61ilure_jitter_max must be greater than or equal to failure_jitter_min\x1at!has(this.failure_jitter_min) || !has(this.failure_jitter_max) || this.failure_jitter_max >= this.failure_jitter_minB\x1c\n\x1a_signed_token_skew_minutes\"\x9a\x0e\n\x11LinkMonitorConfig\x12\x16\n\x06\x65nable\x18\x01 \x01(\x08R\x06\x65nable\x12-\n\rbaseline_file\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x0c\x62\x61selineFile\x12\x41\n\x06settle\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xa3\x05\x32\x00R\x06settle\x12\x41\n\x06resync\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xf5$*\x00R\x06resync\x12P\n\x0estats_interval\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xa3\x05*\x00R\rstatsInterval\x12-\n\rstats_include\x18\x06 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x0cstatsInclude\x12-\n\rstats_exclude\x18\x07 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x0cstatsExclude\x12/\n\x0enetstat_fields\x18\x08 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\rnetstatFields\x12\x44\n\x14max_speed_exceptions\x18\t \x03(\tB\x12\xbaH\x0f\x92\x01\x0c\x10\x80\x02\"\x07r\x05\x10\x01\x18\x80\x01R\x12maxSpeedExceptions\x12:\n\x14metrics_core_include\x18\n \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x12metricsCoreInclude\x12:\n\x14metrics_core_exclude\x18\x0b \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x12metricsCoreExclude\x12\x1f\n\x0bmetrics_all\x18\x0c \x01(\x08R\nmetricsAll\x12\x41\n\x0f\x63ollection_mode\x18\r \x01(\tB\x18\xbaH\x15r\x13R\x00R\x04pollR\ton-demandR\x0e\x63ollectionMode\x12P\n\x0ewatch_interval\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xa3\x05*\x00R\rwatchInterval\x12N\n\rslow_interval\x18\x0f \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xa3\x05*\x00R\x0cslowInterval\x12M\n\ron_demand_ttl\x18\x10 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xa3\x05\x32\x00R\x0bonDemandTtl\x12M\n\x0eon_demand_wait\x18\x11 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0c\xbaH\t\xaa\x01\x06\x1a\x02\x08\n*\x00R\x0conDemandWait\x12L\n\x0c\x65rror_window\x18\x12 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xf5$2\x00R\x0b\x65rrorWindow\x12J\n\x0b\x66lap_window\x18\x13 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xf5$2\x00R\nflapWindow\x12\\\n\rerror_classes\x18\x14 \x01(\tB2\xbaH/r-\x18@2)^((link|rdma|drop)(,(link|rdma|drop))*)?$H\x00R\x0c\x65rrorClasses\x88\x01\x01\x12-\n\rerror_exclude\x18\x15 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x0c\x65rrorExclude\x12<\n\x12metrics_categories\x18\x16 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x02H\x01R\x11metricsCategories\x88\x01\x01\x12;\n\x17metrics_interface_paths\x18\x17 \x01(\x08H\x02R\x15metricsInterfacePaths\x88\x01\x01\x12\x37\n\x10metrics_all_path\x18\x18 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x02H\x03R\x0emetricsAllPath\x88\x01\x01\x12\x19\n\x08ip_paths\x18\x19 \x01(\x08R\x07ipPaths\x12-\n\x0cip_max_bytes\x18\x1a \x01(\rB\x0b\xbaH\x08*\x06\x18\x80\x80\x80\x80\x04R\nipMaxBytes\x12$\n\tip_listen\x18\x1b \x01(\tB\x07\xbaH\x04r\x02\x18@R\x08ipListen\x12P\n\x0elearn_deadline\x18\x1c \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xa3\x05\x32\x00R\rlearnDeadlineB\x10\n\x0e_error_classesB\x15\n\x13_metrics_categoriesB\x1a\n\x18_metrics_interface_pathsB\x13\n\x11_metrics_all_path\"\xea%\n\nXtcpConfig\x12\x46\n\x17nl_timeout_milliseconds\x18\n \x01(\x04\x42\x0e\xbaH\x0b\x32\x06\x18\xa0\x8d\x06(\x00\xc8\x01\x01R\x15nlTimeoutMilliseconds\x12S\n\x0epoll_frequency\x18\x0b \x01(\x0b\x32\x19.google.protobuf.DurationB\x11\xbaH\x0e\xaa\x01\x08\"\x04\x08\x80\xf5$*\x00\xc8\x01\x01R\rpollFrequency\x12O\n\x0cpoll_timeout\x18\x0c \x01(\x0b\x32\x19.google.protobuf.DurationB\x11\xbaH\x0e\xaa\x01\x08\"\x04\x08\x80\xf5$*\x00\xc8\x01\x01R\x0bpollTimeout\x12\x32\n\x0fpoll_jitter_pct\x18\r \x01(\rB\n\xbaH\x07*\x02\x18\x64\xc8\x01\x00R\rpollJitterPct\x12+\n\tmax_loops\x18\x0e \x01(\x04\x42\x0e\xbaH\x0b\x32\x06\x18\xa0\x8d\x06(\x00\xc8\x01\x00R\x08maxLoops\x12,\n\nnetlinkers\x18\x0f \x01(\rB\x0c\xbaH\t*\x04\x18\x64(\x01\xc8\x01\x01R\nnetlinkers\x12H\n\x19netlinkers_done_chan_size\x18\x10 \x01(\rB\r\xbaH\n*\x05\x18\xe8\x07(\x01\xc8\x01\x01R\x16netlinkersDoneChanSize\x12*\n\tnlmsg_seq\x18\x11 \x01(\rB\r\xbaH\n*\x05\x18\x90N(\x00\xc8\x01\x01R\x08nlmsgSeq\x12/\n\x0bpacket_size\x18\x12 \x01(\x04\x42\x0e\xbaH\x0b\x32\x06\x18\xc0\x84=(\x00\xc8\x01\x00R\npacketSize\x12\x36\n\x10packet_size_mply\x18\x13 \x01(\rB\x0c\xbaH\t*\x04\x18\x64(\x00\xc8\x01\x00R\x0epacketSizeMply\x12(\n\x07modulus\x18\x14 \x01(\x04\x42\x0e\xbaH\x0b\x32\x06\x18\xc0\x84=(\x01\xc8\x01\x01R\x07modulus\x12\x61\n\x15\x65nabled_deserializers\x18\x15 \x01(\x0b\x32$.xtcp_config.v1.EnabledDeserializersB\x06\xbaH\x03\xc8\x01\x00R\x14\x65nabledDeserializers\x12!\n\x08io_uring\x18\x16 \x01(\x08\x42\x06\xbaH\x03\xc8\x01\x00R\x07ioUring\x12\x45\n\x18io_uring_recv_batch_size\x18\x17 \x01(\rB\r\xbaH\n*\x05\x18\x80 (\x01\xc8\x01\x00R\x14ioUringRecvBatchSize\x12\x43\n\x17io_uring_cqe_batch_size\x18\x18 \x01(\rB\r\xbaH\n*\x05\x18\x80 (\x01\xc8\x01\x00R\x13ioUringCqeBatchSize\x12W\n\x13reconcile_frequency\x18( \x01(\x0b\x32\x19.google.protobuf.DurationB\x0b\xbaH\x08\xaa\x01\x02\x32\x00\xc8\x01\x00R\x12reconcileFrequency\x12\x32\n\x15reconcile_before_poll\x18) \x01(\x08R\x13reconcileBeforePoll\x12.\n\x0bwrite_files\x18\x32 \x01(\rB\r\xbaH\n*\x05\x18\xe8\x07(\x00\xc8\x01\x00R\nwriteFiles\x12/\n\x0c\x63\x61pture_path\x18\x33 \x01(\tB\x0c\xbaH\tr\x04\x10\x01\x18P\xc8\x01\x00R\x0b\x63\x61pturePath\x12\x37\n\x10\x64\x65st_write_files\x18\x34 \x01(\rB\r\xbaH\n*\x05\x18\xe8\x07(\x00\xc8\x01\x00R\x0e\x64\x65stWriteFiles\x12.\n\x0b\x64\x65\x62ug_level\x18\x35 \x01(\rB\r\xbaH\n*\x05\x18\xe8\x07(\x00\xc8\x01\x01R\ndebugLevel\x12\x31\n\x10\x64\x65\x62ug_prometheus\x18\x36 \x01(\x08\x42\x06\xbaH\x03\xc8\x01\x00R\x0f\x64\x65\x62ugPrometheus\x12!\n\x04\x64\x65st\x18< \x01(\tB\r\xbaH\nr\x05\x10\x04\x18\x80\x04\xc8\x01\x01R\x04\x64\x65st\x12+\n\nmarshal_to\x18= \x01(\tB\x0c\xbaH\tr\x04\x10\x03\x18(\xc8\x01\x01R\tmarshalTo\x12\'\n\x0b\x63sv_columns\x18> \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\ncsvColumns\x12\x34\n\x0fxtcp_proto_file\x18? \x01(\tB\x0c\xbaH\tr\x04\x10\x01\x18P\xc8\x01\x00R\rxtcpProtoFile\x12K\n\x1e\x65nvelope_flush_threshold_bytes\x18@ \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1b\x65nvelopeFlushThresholdBytes\x12I\n\x1d\x65nvelope_flush_threshold_rows\x18\x41 \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1a\x65nvelopeFlushThresholdRows\x12\"\n\x05topic\x18P \x01(\tB\x0c\xbaH\tr\x04\x10\x01\x18(\xc8\x01\x00R\x05topic\x12\x36\n\x10kafka_schema_url\x18Q \x01(\tB\x0c\xbaH\tr\x04\x10\x01\x18<\xc8\x01\x00R\x0ekafkaSchemaUrl\x12_\n\x15kafka_produce_timeout\x18R \x01(\x0b\x32\x19.google.protobuf.DurationB\x10\xbaH\r\xaa\x01\x07\"\x03\x08\xd8\x04\x32\x00\xc8\x01\x00R\x13kafkaProduceTimeout\x12\x33\n\x11kafka_compression\x18S \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x10kafkaCompression\x12\'\n\x0bs3_endpoint\x18\x64 \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\ns3Endpoint\x12#\n\ts3_region\x18\x65 \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x08s3Region\x12#\n\ts3_bucket\x18\x66 \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x08s3Bucket\x12#\n\ts3_prefix\x18g \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x08s3Prefix\x12*\n\rs3_access_key\x18h \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x0bs3AccessKey\x12*\n\rs3_secret_key\x18i \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x0bs3SecretKey\x12\x37\n\x14s3_skip_bucket_probe\x18j \x01(\x08\x42\x06\xbaH\x03\xc8\x01\x00R\x11s3SkipBucketProbe\x12\x32\n\x11s3_allow_insecure\x18k \x01(\x08\x42\x06\xbaH\x03\xc8\x01\x00R\x0fs3AllowInsecure\x12)\n\ns3_ca_file\x18l \x01(\tB\x0b\xbaH\x08r\x03\x18\x80 \xc8\x01\x00R\x08s3CaFile\x12N\n s3_parquet_flush_threshold_bytes\x18n \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1cs3ParquetFlushThresholdBytes\x12R\n\x11s3_flush_interval\x18o \x01(\x0b\x32\x19.google.protobuf.DurationB\x0b\xbaH\x08\xaa\x01\x02\x32\x00\xc8\x01\x00R\x0fs3FlushInterval\x12\x39\n\x13s3_flush_jitter_pct\x18p \x01(\rB\n\xbaH\x07*\x02\x18\x64\xc8\x01\x00R\x10s3FlushJitterPct\x12L\n\x1ds3_flush_threshold_jitter_pct\x18q \x01(\rB\n\xbaH\x07*\x02\x18\x64\xc8\x01\x00R\x19s3FlushThresholdJitterPct\x12\x41\n\x16s3_upload_max_attempts\x18r \x01(\rB\x0c\xbaH\t*\x04\x18\x64(\x01\xc8\x01\x00R\x13s3UploadMaxAttempts\x12Y\n\x15s3_upload_backoff_cap\x18s \x01(\x0b\x32\x19.google.protobuf.DurationB\x0b\xbaH\x08\xaa\x01\x02\x32\x00\xc8\x01\x00R\x12s3UploadBackoffCap\x12(\n\x08hostname\x18\x82\x01 \x01(\tB\x0b\xbaH\x08r\x03\x18\xfd\x01\xc8\x01\x00R\x08hostname\x12(\n\x08location\x18\x83\x01 \x01(\tB\x0b\xbaH\x08r\x03\x18\xfd\x01\xc8\x01\x00R\x08location\x12!\n\x05label\x18\x84\x01 \x01(\tB\n\xbaH\x07r\x02\x18(\xc8\x01\x00R\x05label\x12\x1d\n\x03tag\x18\x85\x01 \x01(\tB\n\xbaH\x07r\x02\x18(\xc8\x01\x00R\x03tag\x12\x33\n\x0e\x64\x61\x65mon_version\x18\x86\x01 \x01(\tB\x0b\xbaH\x08r\x03\x18\xfd\x01\xc8\x01\x00R\rdaemonVersion\x12\'\n\x08ipv4_ttl\x18\x96\x01 \x01(\rB\x0b\xbaH\x08*\x03\x18\xff\x01\xc8\x01\x00R\x07ipv4Ttl\x12\x32\n\x0eipv6_hop_limit\x18\x97\x01 \x01(\rB\x0b\xbaH\x08*\x03\x18\xff\x01\xc8\x01\x00R\x0cipv6HopLimit\x12J\n\rlistener_auth\x18\x98\x01 \x01(\x0b\x32\x1c.xtcp_config.v1.ListenerAuthB\x06\xbaH\x03\xc8\x01\x00R\x0clistenerAuth\x12Z\n\x13prometheus_listener\x18\x99\x01 \x01(\x0b\x32 .xtcp_config.v1.ListenerEndpointB\x06\xbaH\x03\xc8\x01\x00R\x12prometheusListener\x12U\n\x13\x61\x64min_listener_auth\x18\x9a\x01 \x01(\x0b\x32\x1c.xtcp_config.v1.ListenerAuthB\x06\xbaH\x03\xc8\x01\x00R\x11\x61\x64minListenerAuth\x12,\n\tgrpc_port\x18\xa0\x01 \x01(\rB\x0e\xbaH\x0b*\x06\x18\xff\xff\x03(\x01\xc8\x01\x01R\x08grpcPort\x12N\n\rgrpc_listener\x18\xa1\x01 \x01(\x0b\x32 .xtcp_config.v1.ListenerEndpointB\x06\xbaH\x03\xc8\x01\x00R\x0cgrpcListener\x12,\n\rpyroscope_url\x18\xaa\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x0cpyroscopeUrl\x12\x35\n\x12pyroscope_app_name\x18\xab\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x10pyroscopeAppName\x12\x37\n\x13pyroscope_sample_hz\x18\xac\x01 \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x11pyroscopeSampleHz\x12J\n\x1dpyroscope_upload_interval_sec\x18\xad\x01 \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1apyroscopeUploadIntervalSec\x12\x39\n\x14resolve_container_id\x18\xc8\x01 \x01(\x08\x42\x06\xbaH\x03\xc8\x01\x00R\x12resolveContainerId\x12\x37\n\x17\x65nrich_container_enable\x18\xc9\x01 \x01(\x08R\x15\x65nrichContainerEnable\x12\x37\n\x12\x64ocker_socket_path\x18\xca\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\xff\x01R\x10\x64ockerSocketPath\x12-\n\x12\x65nrich_lldp_enable\x18\xd2\x01 \x01(\x08R\x10\x65nrichLldpEnable\x12\x35\n\x11lldpd_socket_path\x18\xd3\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\xff\x01R\x0flldpdSocketPath\x12\x36\n\x12lldpd_version_hint\x18\xd4\x01 \x01(\tB\x07\xbaH\x04r\x02\x18\x10R\x10lldpdVersionHint\x12+\n\x11\x65nrich_nic_enable\x18\xdc\x01 \x01(\x08R\x0f\x65nrichNicEnable\x12+\n\x0cuplink_count\x18\xdd\x01 \x01(\rB\x07\xbaH\x04*\x02\x18\x02R\x0buplinkCount\x12\x36\n\x11uplink_interfaces\x18\xde\x01 \x03(\tB\x08\xbaH\x05\x92\x01\x02\x10\x02R\x10uplinkInterfaces\x12$\n\rpopulate_nsid\x18\xe6\x01 \x01(\x08R\x0cpopulateNsid\x12+\n\x11\x65nrich_asn_enable\x18\xf0\x01 \x01(\x08R\x0f\x65nrichAsnEnable\x12)\n\x0b\x61sn_db_path\x18\xf1\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\xff\x01R\tasnDbPath\x12L\n\x14\x61sn_refresh_interval\x18\xf2\x01 \x01(\x0b\x32\x19.google.protobuf.DurationR\x12\x61snRefreshInterval\x12=\n\x15ipmeta_bootstrap_path\x18\xf3\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\xff\x01R\x13ipmetaBootstrapPath\x12\x35\n\x11ipmeta_cache_path\x18\xf4\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\xff\x01R\x0fipmetaCachePath\x12\x35\n\x16\x65nrich_locality_enable\x18\xf5\x01 \x01(\x08R\x14\x65nrichLocalityEnable\x12V\n\x19locality_refresh_interval\x18\xf6\x01 \x01(\x0b\x32\x19.google.protobuf.DurationR\x17localityRefreshInterval\x12\x35\n\x16locality_events_enable\x18\xf7\x01 \x01(\x08R\x14localityEventsEnable\x12\x45\n\x0clink_monitor\x18\xfa\x01 \x01(\x0b\x32!.xtcp_config.v1.LinkMonitorConfigR\x0blinkMonitor:s\xbaHp\x1an\n\x0fXtcpConfig.poll\x12\x32Poll timeout must be less than poll poll_frequency\x1a\'this.poll_frequency > this.poll_timeout\"\x9f\x01\n\x14\x45nabledDeserializers\x12K\n\x07\x65nabled\x18\x01 \x03(\x0b\x32\x31.xtcp_config.v1.EnabledDeserializers.EnabledEntryR\x07\x65nabled\x1a:\n\x0c\x45nabledEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\x08R\x05value:\x02\x38\x01*h\n\x0fListenerNetwork\x12 \n\x1cLISTENER_NETWORK_UNSPECIFIED\x10\x00\x12\x18\n\x14LISTENER_NETWORK_TCP\x10\x01\x12\x19\n\x15LISTENER_NETWORK_UNIX\x10\x02*\xa1\x01\n\x10ListenerAuthMode\x12\"\n\x1eLISTENER_AUTH_MODE_UNSPECIFIED\x10\x00\x12\x1f\n\x1bLISTENER_AUTH_MODE_DISABLED\x10\x01\x12 \n\x1cLISTENER_AUTH_MODE_RAW_TOKEN\x10\x02\x12&\n\"LISTENER_AUTH_MODE_HMAC_UTC_MINUTE\x10\x03\x32\xa5\x07\n\rConfigService\x12\x61\n\x03Get\x12\x1a.xtcp_config.v1.GetRequest\x1a\x1b.xtcp_config.v1.GetResponse\"!\xc8\xf3\x18\x01\x82\xd3\xe4\x93\x02\x17\x1a\x12/ConfigService/Get:\x01*\x12\x61\n\x03Set\x12\x1a.xtcp_config.v1.SetRequest\x1a\x1b.xtcp_config.v1.SetResponse\"!\xc8\xf3\x18\x02\x82\xd3\xe4\x93\x02\x17\x1a\x12/ConfigService/Set:\x01*\x12\x95\x01\n\x10SetPollFrequency\x12\'.xtcp_config.v1.SetPollFrequencyRequest\x1a(.xtcp_config.v1.SetPollFrequencyResponse\".\xc8\xf3\x18\x02\x82\xd3\xe4\x93\x02$\x1a\x1f/ConfigService/SetPollFrequency:\x01*\x12\x81\x01\n\x0bTriggerPoll\x12\".xtcp_config.v1.TriggerPollRequest\x1a#.xtcp_config.v1.TriggerPollResponse\")\xc8\xf3\x18\x02\x82\xd3\xe4\x93\x02\x1f\x1a\x1a/ConfigService/TriggerPoll:\x01*\x12\x95\x01\n\x10TriggerPollBurst\x12\'.xtcp_config.v1.TriggerPollBurstRequest\x1a(.xtcp_config.v1.TriggerPollBurstResponse\".\xc8\xf3\x18\x02\x82\xd3\xe4\x93\x02$\x1a\x1f/ConfigService/TriggerPollBurst:\x01*\x12\x81\x01\n\x0bSetS3Upload\x12\".xtcp_config.v1.SetS3UploadRequest\x1a#.xtcp_config.v1.SetS3UploadResponse\")\xc8\xf3\x18\x02\x82\xd3\xe4\x93\x02\x1f\x1a\x1a/ConfigService/SetS3Upload:\x01*\x12\x95\x01\n\x10SetEnvelopeFlush\x12\'.xtcp_config.v1.SetEnvelopeFlushRequest\x1a(.xtcp_config.v1.SetEnvelopeFlushResponse\".\xc8\xf3\x18\x02\x82\xd3\xe4\x93\x02$\x1a\x1f/ConfigService/SetEnvelopeFlush:\x01*B\xaf\x01\n\x12\x63om.xtcp_config.v1B\x0fXtcpConfigProtoP\x01Z3github.com/randomizedcoder/xtcp2/gen/go/xtcp_config\xa2\x02\x03XXX\xaa\x02\rXtcpConfig.V1\xca\x02\rXtcpConfig\\V1\xe2\x02\x19XtcpConfig\\V1\\GPBMetadata\xea\x02\x0eXtcpConfig::V1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n xtcp_config/v1/xtcp_config.proto\x12\x0extcp_config.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1cxtcp_auth/v1/xtcp_auth.proto\x1a\x1b\x62uf/validate/validate.proto\"\x0c\n\nGetRequest\"A\n\x0bGetResponse\x12\x32\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1a.xtcp_config.v1.XtcpConfigR\x06\x63onfig\"@\n\nSetRequest\x12\x32\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1a.xtcp_config.v1.XtcpConfigR\x06\x63onfig\"A\n\x0bSetResponse\x12\x32\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1a.xtcp_config.v1.XtcpConfigR\x06\x63onfig\"\xb4\x02\n\x17SetPollFrequencyRequest\x12S\n\x0epoll_frequency\x18\x14 \x01(\x0b\x32\x19.google.protobuf.DurationB\x11\xbaH\x0e\xaa\x01\x08\"\x04\x08\x80\xf5$2\x00\xc8\x01\x01R\rpollFrequency\x12O\n\x0cpoll_timeout\x18\x1e \x01(\x0b\x32\x19.google.protobuf.DurationB\x11\xbaH\x0e\xaa\x01\x08\"\x04\x08\x80\xf5$2\x00\xc8\x01\x01R\x0bpollTimeout:s\xbaHp\x1an\n\x0fXtcpConfig.poll\x12\x32Poll timeout must be less than poll poll_frequency\x1a\'this.poll_timeout < this.poll_frequency\"N\n\x18SetPollFrequencyResponse\x12\x32\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1a.xtcp_config.v1.XtcpConfigR\x06\x63onfig\"\x14\n\x12TriggerPollRequest\"\x15\n\x13TriggerPollResponse\"\x89\x01\n\x17TriggerPollBurstRequest\x12#\n\x05\x63ount\x18\n \x01(\rB\r\xbaH\n*\x05\x18\xe8\x07(\x01\xc8\x01\x01R\x05\x63ount\x12I\n\x08interval\x18\x14 \x01(\x0b\x32\x19.google.protobuf.DurationB\x12\xbaH\x0f\xaa\x01\t\"\x03\x08\x90\x1c\x32\x02\x08\x01\xc8\x01\x01R\x08interval\"g\n\x18TriggerPollBurstResponse\x12\x14\n\x05\x63ount\x18\n \x01(\rR\x05\x63ount\x12\x35\n\x08interval\x18\x14 \x01(\x0b\x32\x19.google.protobuf.DurationR\x08interval\"\xe3\x02\n\x12SetS3UploadRequest\x12R\n\x11s3_flush_interval\x18\n \x01(\x0b\x32\x19.google.protobuf.DurationB\x0b\xbaH\x08\xaa\x01\x02\x32\x00\xc8\x01\x00R\x0fs3FlushInterval\x12N\n s3_parquet_flush_threshold_bytes\x18\x14 \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1cs3ParquetFlushThresholdBytes:\xa8\x01\xbaH\xa4\x01\x1a\xa1\x01\n\x16SetS3Upload.atLeastOne\x12=set s3_flush_interval and/or s3_parquet_flush_threshold_bytes\x1aHhas(this.s3_flush_interval) || this.s3_parquet_flush_threshold_bytes > 0\"I\n\x13SetS3UploadResponse\x12\x32\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1a.xtcp_config.v1.XtcpConfigR\x06\x63onfig\"\xf4\x02\n\x17SetEnvelopeFlushRequest\x12K\n\x1e\x65nvelope_flush_threshold_bytes\x18\n \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1b\x65nvelopeFlushThresholdBytes\x12I\n\x1d\x65nvelope_flush_threshold_rows\x18\x14 \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1a\x65nvelopeFlushThresholdRows:\xc0\x01\xbaH\xbc\x01\x1a\xb9\x01\n\x1bSetEnvelopeFlush.atLeastOne\x12Gset envelope_flush_threshold_bytes and/or envelope_flush_threshold_rows\x1aQthis.envelope_flush_threshold_bytes > 0 || this.envelope_flush_threshold_rows > 0\"N\n\x18SetEnvelopeFlushResponse\x12\x32\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1a.xtcp_config.v1.XtcpConfigR\x06\x63onfig\"\x8a\x03\n\x10ListenerEndpoint\x12\x43\n\x07network\x18\x01 \x01(\x0e\x32\x1f.xtcp_config.v1.ListenerNetworkB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x07network\x12\"\n\x07\x61\x64\x64ress\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x04R\x07\x61\x64\x64ress\x12\x32\n\x10unix_socket_mode\x18\x03 \x01(\rB\x08\xbaH\x05*\x03\x18\xff\x03R\x0eunixSocketMode\x12\x37\n\x18unlink_stale_unix_socket\x18\x04 \x01(\x08R\x15unlinkStaleUnixSocket\x12\x32\n\x0fmax_connections\x18\x05 \x01(\rB\t\xbaH\x06*\x04\x18\xa0\x8d\x06R\x0emaxConnections\x12>\n\x16\x61\x63\x63\x65pt_rate_per_second\x18\x06 \x01(\rB\t\xbaH\x06*\x04\x18\xa0\x8d\x06R\x13\x61\x63\x63\x65ptRatePerSecond\x12,\n\x0c\x61\x63\x63\x65pt_burst\x18\x07 \x01(\rB\t\xbaH\x06*\x04\x18\xa0\x8d\x06R\x0b\x61\x63\x63\x65ptBurst\"\x83\x06\n\x0cListenerAuth\x12>\n\x04mode\x18\x01 \x01(\x0e\x32 .xtcp_config.v1.ListenerAuthModeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04mode\x12%\n\traw_token\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x08rawToken\x12\x30\n\x0fhmac_shared_key\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\rhmacSharedKey\x12G\n\x19signed_token_skew_minutes\x18\x04 \x01(\rB\x07\xbaH\x04*\x02\x18\x05H\x00R\x16signedTokenSkewMinutes\x88\x01\x01\x12Q\n\x12\x66\x61ilure_jitter_min\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x08\xbaH\x05\xaa\x01\x02\x32\x00R\x10\x66\x61ilureJitterMin\x12Q\n\x12\x66\x61ilure_jitter_max\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x08\xbaH\x05\xaa\x01\x02\x32\x00R\x10\x66\x61ilureJitterMax\x12.\n\x0eraw_token_file\x18\x07 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x0crawTokenFile\x12\x39\n\x14hmac_shared_key_file\x18\x08 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x11hmacSharedKeyFile:\xe1\x01\xbaH\xdd\x01\x1a\xda\x01\n\x1aListenerAuth.failureJitter\x12\x46\x66\x61ilure_jitter_max must be greater than or equal to failure_jitter_min\x1at!has(this.failure_jitter_min) || !has(this.failure_jitter_max) || this.failure_jitter_max >= this.failure_jitter_minB\x1c\n\x1a_signed_token_skew_minutes\"\xbf\x02\n\x08Listener\x12\x30\n\x04name\x18\x01 \x01(\tB\x1c\xbaH\x19r\x17\x10\x01\x18 2\x11^[a-z][a-z0-9-]*$R\x04name\x12\x44\n\x08\x65ndpoint\x18\x02 \x01(\x0b\x32 .xtcp_config.v1.ListenerEndpointB\x06\xbaH\x03\xc8\x01\x01R\x08\x65ndpoint\x12\x30\n\x04\x61uth\x18\x03 \x01(\x0b\x32\x1c.xtcp_config.v1.ListenerAuthR\x04\x61uth\x12;\n\nadmin_auth\x18\x04 \x01(\x0b\x32\x1c.xtcp_config.v1.ListenerAuthR\tadminAuth\x12L\n\x06serves\x18\x05 \x03(\x0e\x32\x1d.xtcp_config.v1.EndpointClassB\x15\xbaH\x12\x92\x01\x0f\x08\x01\x10\x07\x18\x01\"\x07\x82\x01\x04\x10\x01 \x00R\x06serves\"\x9a\x0e\n\x11LinkMonitorConfig\x12\x16\n\x06\x65nable\x18\x01 \x01(\x08R\x06\x65nable\x12-\n\rbaseline_file\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x0c\x62\x61selineFile\x12\x41\n\x06settle\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xa3\x05\x32\x00R\x06settle\x12\x41\n\x06resync\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xf5$*\x00R\x06resync\x12P\n\x0estats_interval\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xa3\x05*\x00R\rstatsInterval\x12-\n\rstats_include\x18\x06 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x0cstatsInclude\x12-\n\rstats_exclude\x18\x07 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x0cstatsExclude\x12/\n\x0enetstat_fields\x18\x08 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\rnetstatFields\x12\x44\n\x14max_speed_exceptions\x18\t \x03(\tB\x12\xbaH\x0f\x92\x01\x0c\x10\x80\x02\"\x07r\x05\x10\x01\x18\x80\x01R\x12maxSpeedExceptions\x12:\n\x14metrics_core_include\x18\n \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x12metricsCoreInclude\x12:\n\x14metrics_core_exclude\x18\x0b \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x12metricsCoreExclude\x12\x1f\n\x0bmetrics_all\x18\x0c \x01(\x08R\nmetricsAll\x12\x41\n\x0f\x63ollection_mode\x18\r \x01(\tB\x18\xbaH\x15r\x13R\x00R\x04pollR\ton-demandR\x0e\x63ollectionMode\x12P\n\x0ewatch_interval\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xa3\x05*\x00R\rwatchInterval\x12N\n\rslow_interval\x18\x0f \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xa3\x05*\x00R\x0cslowInterval\x12M\n\ron_demand_ttl\x18\x10 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xa3\x05\x32\x00R\x0bonDemandTtl\x12M\n\x0eon_demand_wait\x18\x11 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0c\xbaH\t\xaa\x01\x06\x1a\x02\x08\n*\x00R\x0conDemandWait\x12L\n\x0c\x65rror_window\x18\x12 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xf5$2\x00R\x0b\x65rrorWindow\x12J\n\x0b\x66lap_window\x18\x13 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xf5$2\x00R\nflapWindow\x12\\\n\rerror_classes\x18\x14 \x01(\tB2\xbaH/r-\x18@2)^((link|rdma|drop)(,(link|rdma|drop))*)?$H\x00R\x0c\x65rrorClasses\x88\x01\x01\x12-\n\rerror_exclude\x18\x15 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x0c\x65rrorExclude\x12<\n\x12metrics_categories\x18\x16 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x02H\x01R\x11metricsCategories\x88\x01\x01\x12;\n\x17metrics_interface_paths\x18\x17 \x01(\x08H\x02R\x15metricsInterfacePaths\x88\x01\x01\x12\x37\n\x10metrics_all_path\x18\x18 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x02H\x03R\x0emetricsAllPath\x88\x01\x01\x12\x19\n\x08ip_paths\x18\x19 \x01(\x08R\x07ipPaths\x12-\n\x0cip_max_bytes\x18\x1a \x01(\rB\x0b\xbaH\x08*\x06\x18\x80\x80\x80\x80\x04R\nipMaxBytes\x12$\n\tip_listen\x18\x1b \x01(\tB\x07\xbaH\x04r\x02\x18@R\x08ipListen\x12P\n\x0elearn_deadline\x18\x1c \x01(\x0b\x32\x19.google.protobuf.DurationB\x0e\xbaH\x0b\xaa\x01\x08\"\x04\x08\x80\xa3\x05\x32\x00R\rlearnDeadlineB\x10\n\x0e_error_classesB\x15\n\x13_metrics_categoriesB\x1a\n\x18_metrics_interface_pathsB\x13\n\x11_metrics_all_path\"\xa8&\n\nXtcpConfig\x12\x46\n\x17nl_timeout_milliseconds\x18\n \x01(\x04\x42\x0e\xbaH\x0b\x32\x06\x18\xa0\x8d\x06(\x00\xc8\x01\x01R\x15nlTimeoutMilliseconds\x12S\n\x0epoll_frequency\x18\x0b \x01(\x0b\x32\x19.google.protobuf.DurationB\x11\xbaH\x0e\xaa\x01\x08\"\x04\x08\x80\xf5$*\x00\xc8\x01\x01R\rpollFrequency\x12O\n\x0cpoll_timeout\x18\x0c \x01(\x0b\x32\x19.google.protobuf.DurationB\x11\xbaH\x0e\xaa\x01\x08\"\x04\x08\x80\xf5$*\x00\xc8\x01\x01R\x0bpollTimeout\x12\x32\n\x0fpoll_jitter_pct\x18\r \x01(\rB\n\xbaH\x07*\x02\x18\x64\xc8\x01\x00R\rpollJitterPct\x12+\n\tmax_loops\x18\x0e \x01(\x04\x42\x0e\xbaH\x0b\x32\x06\x18\xa0\x8d\x06(\x00\xc8\x01\x00R\x08maxLoops\x12,\n\nnetlinkers\x18\x0f \x01(\rB\x0c\xbaH\t*\x04\x18\x64(\x01\xc8\x01\x01R\nnetlinkers\x12H\n\x19netlinkers_done_chan_size\x18\x10 \x01(\rB\r\xbaH\n*\x05\x18\xe8\x07(\x01\xc8\x01\x01R\x16netlinkersDoneChanSize\x12*\n\tnlmsg_seq\x18\x11 \x01(\rB\r\xbaH\n*\x05\x18\x90N(\x00\xc8\x01\x01R\x08nlmsgSeq\x12/\n\x0bpacket_size\x18\x12 \x01(\x04\x42\x0e\xbaH\x0b\x32\x06\x18\xc0\x84=(\x00\xc8\x01\x00R\npacketSize\x12\x36\n\x10packet_size_mply\x18\x13 \x01(\rB\x0c\xbaH\t*\x04\x18\x64(\x00\xc8\x01\x00R\x0epacketSizeMply\x12(\n\x07modulus\x18\x14 \x01(\x04\x42\x0e\xbaH\x0b\x32\x06\x18\xc0\x84=(\x01\xc8\x01\x01R\x07modulus\x12\x61\n\x15\x65nabled_deserializers\x18\x15 \x01(\x0b\x32$.xtcp_config.v1.EnabledDeserializersB\x06\xbaH\x03\xc8\x01\x00R\x14\x65nabledDeserializers\x12!\n\x08io_uring\x18\x16 \x01(\x08\x42\x06\xbaH\x03\xc8\x01\x00R\x07ioUring\x12\x45\n\x18io_uring_recv_batch_size\x18\x17 \x01(\rB\r\xbaH\n*\x05\x18\x80 (\x01\xc8\x01\x00R\x14ioUringRecvBatchSize\x12\x43\n\x17io_uring_cqe_batch_size\x18\x18 \x01(\rB\r\xbaH\n*\x05\x18\x80 (\x01\xc8\x01\x00R\x13ioUringCqeBatchSize\x12W\n\x13reconcile_frequency\x18( \x01(\x0b\x32\x19.google.protobuf.DurationB\x0b\xbaH\x08\xaa\x01\x02\x32\x00\xc8\x01\x00R\x12reconcileFrequency\x12\x32\n\x15reconcile_before_poll\x18) \x01(\x08R\x13reconcileBeforePoll\x12.\n\x0bwrite_files\x18\x32 \x01(\rB\r\xbaH\n*\x05\x18\xe8\x07(\x00\xc8\x01\x00R\nwriteFiles\x12/\n\x0c\x63\x61pture_path\x18\x33 \x01(\tB\x0c\xbaH\tr\x04\x10\x01\x18P\xc8\x01\x00R\x0b\x63\x61pturePath\x12\x37\n\x10\x64\x65st_write_files\x18\x34 \x01(\rB\r\xbaH\n*\x05\x18\xe8\x07(\x00\xc8\x01\x00R\x0e\x64\x65stWriteFiles\x12.\n\x0b\x64\x65\x62ug_level\x18\x35 \x01(\rB\r\xbaH\n*\x05\x18\xe8\x07(\x00\xc8\x01\x01R\ndebugLevel\x12\x31\n\x10\x64\x65\x62ug_prometheus\x18\x36 \x01(\x08\x42\x06\xbaH\x03\xc8\x01\x00R\x0f\x64\x65\x62ugPrometheus\x12!\n\x04\x64\x65st\x18< \x01(\tB\r\xbaH\nr\x05\x10\x04\x18\x80\x04\xc8\x01\x01R\x04\x64\x65st\x12+\n\nmarshal_to\x18= \x01(\tB\x0c\xbaH\tr\x04\x10\x03\x18(\xc8\x01\x01R\tmarshalTo\x12\'\n\x0b\x63sv_columns\x18> \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\ncsvColumns\x12\x34\n\x0fxtcp_proto_file\x18? \x01(\tB\x0c\xbaH\tr\x04\x10\x01\x18P\xc8\x01\x00R\rxtcpProtoFile\x12K\n\x1e\x65nvelope_flush_threshold_bytes\x18@ \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1b\x65nvelopeFlushThresholdBytes\x12I\n\x1d\x65nvelope_flush_threshold_rows\x18\x41 \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1a\x65nvelopeFlushThresholdRows\x12\"\n\x05topic\x18P \x01(\tB\x0c\xbaH\tr\x04\x10\x01\x18(\xc8\x01\x00R\x05topic\x12\x36\n\x10kafka_schema_url\x18Q \x01(\tB\x0c\xbaH\tr\x04\x10\x01\x18<\xc8\x01\x00R\x0ekafkaSchemaUrl\x12_\n\x15kafka_produce_timeout\x18R \x01(\x0b\x32\x19.google.protobuf.DurationB\x10\xbaH\r\xaa\x01\x07\"\x03\x08\xd8\x04\x32\x00\xc8\x01\x00R\x13kafkaProduceTimeout\x12\x33\n\x11kafka_compression\x18S \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x10kafkaCompression\x12\'\n\x0bs3_endpoint\x18\x64 \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\ns3Endpoint\x12#\n\ts3_region\x18\x65 \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x08s3Region\x12#\n\ts3_bucket\x18\x66 \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x08s3Bucket\x12#\n\ts3_prefix\x18g \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x08s3Prefix\x12*\n\rs3_access_key\x18h \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x0bs3AccessKey\x12*\n\rs3_secret_key\x18i \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x0bs3SecretKey\x12\x37\n\x14s3_skip_bucket_probe\x18j \x01(\x08\x42\x06\xbaH\x03\xc8\x01\x00R\x11s3SkipBucketProbe\x12\x32\n\x11s3_allow_insecure\x18k \x01(\x08\x42\x06\xbaH\x03\xc8\x01\x00R\x0fs3AllowInsecure\x12)\n\ns3_ca_file\x18l \x01(\tB\x0b\xbaH\x08r\x03\x18\x80 \xc8\x01\x00R\x08s3CaFile\x12N\n s3_parquet_flush_threshold_bytes\x18n \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1cs3ParquetFlushThresholdBytes\x12R\n\x11s3_flush_interval\x18o \x01(\x0b\x32\x19.google.protobuf.DurationB\x0b\xbaH\x08\xaa\x01\x02\x32\x00\xc8\x01\x00R\x0fs3FlushInterval\x12\x39\n\x13s3_flush_jitter_pct\x18p \x01(\rB\n\xbaH\x07*\x02\x18\x64\xc8\x01\x00R\x10s3FlushJitterPct\x12L\n\x1ds3_flush_threshold_jitter_pct\x18q \x01(\rB\n\xbaH\x07*\x02\x18\x64\xc8\x01\x00R\x19s3FlushThresholdJitterPct\x12\x41\n\x16s3_upload_max_attempts\x18r \x01(\rB\x0c\xbaH\t*\x04\x18\x64(\x01\xc8\x01\x00R\x13s3UploadMaxAttempts\x12Y\n\x15s3_upload_backoff_cap\x18s \x01(\x0b\x32\x19.google.protobuf.DurationB\x0b\xbaH\x08\xaa\x01\x02\x32\x00\xc8\x01\x00R\x12s3UploadBackoffCap\x12(\n\x08hostname\x18\x82\x01 \x01(\tB\x0b\xbaH\x08r\x03\x18\xfd\x01\xc8\x01\x00R\x08hostname\x12(\n\x08location\x18\x83\x01 \x01(\tB\x0b\xbaH\x08r\x03\x18\xfd\x01\xc8\x01\x00R\x08location\x12!\n\x05label\x18\x84\x01 \x01(\tB\n\xbaH\x07r\x02\x18(\xc8\x01\x00R\x05label\x12\x1d\n\x03tag\x18\x85\x01 \x01(\tB\n\xbaH\x07r\x02\x18(\xc8\x01\x00R\x03tag\x12\x33\n\x0e\x64\x61\x65mon_version\x18\x86\x01 \x01(\tB\x0b\xbaH\x08r\x03\x18\xfd\x01\xc8\x01\x00R\rdaemonVersion\x12\'\n\x08ipv4_ttl\x18\x96\x01 \x01(\rB\x0b\xbaH\x08*\x03\x18\xff\x01\xc8\x01\x00R\x07ipv4Ttl\x12\x32\n\x0eipv6_hop_limit\x18\x97\x01 \x01(\rB\x0b\xbaH\x08*\x03\x18\xff\x01\xc8\x01\x00R\x0cipv6HopLimit\x12J\n\rlistener_auth\x18\x98\x01 \x01(\x0b\x32\x1c.xtcp_config.v1.ListenerAuthB\x06\xbaH\x03\xc8\x01\x00R\x0clistenerAuth\x12Z\n\x13prometheus_listener\x18\x99\x01 \x01(\x0b\x32 .xtcp_config.v1.ListenerEndpointB\x06\xbaH\x03\xc8\x01\x00R\x12prometheusListener\x12U\n\x13\x61\x64min_listener_auth\x18\x9a\x01 \x01(\x0b\x32\x1c.xtcp_config.v1.ListenerAuthB\x06\xbaH\x03\xc8\x01\x00R\x11\x61\x64minListenerAuth\x12\'\n\tgrpc_port\x18\xa0\x01 \x01(\rB\t\xbaH\x06*\x04\x18\xff\xff\x03R\x08grpcPort\x12N\n\rgrpc_listener\x18\xa1\x01 \x01(\x0b\x32 .xtcp_config.v1.ListenerEndpointB\x06\xbaH\x03\xc8\x01\x00R\x0cgrpcListener\x12\x41\n\tlisteners\x18\xa2\x01 \x03(\x0b\x32\x18.xtcp_config.v1.ListenerB\x08\xbaH\x05\x92\x01\x02\x10\x10R\tlisteners\x12,\n\rpyroscope_url\x18\xaa\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x0cpyroscopeUrl\x12\x35\n\x12pyroscope_app_name\x18\xab\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x00R\x10pyroscopeAppName\x12\x37\n\x13pyroscope_sample_hz\x18\xac\x01 \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x11pyroscopeSampleHz\x12J\n\x1dpyroscope_upload_interval_sec\x18\xad\x01 \x01(\rB\x06\xbaH\x03\xc8\x01\x00R\x1apyroscopeUploadIntervalSec\x12\x39\n\x14resolve_container_id\x18\xc8\x01 \x01(\x08\x42\x06\xbaH\x03\xc8\x01\x00R\x12resolveContainerId\x12\x37\n\x17\x65nrich_container_enable\x18\xc9\x01 \x01(\x08R\x15\x65nrichContainerEnable\x12\x37\n\x12\x64ocker_socket_path\x18\xca\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\xff\x01R\x10\x64ockerSocketPath\x12-\n\x12\x65nrich_lldp_enable\x18\xd2\x01 \x01(\x08R\x10\x65nrichLldpEnable\x12\x35\n\x11lldpd_socket_path\x18\xd3\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\xff\x01R\x0flldpdSocketPath\x12\x36\n\x12lldpd_version_hint\x18\xd4\x01 \x01(\tB\x07\xbaH\x04r\x02\x18\x10R\x10lldpdVersionHint\x12+\n\x11\x65nrich_nic_enable\x18\xdc\x01 \x01(\x08R\x0f\x65nrichNicEnable\x12+\n\x0cuplink_count\x18\xdd\x01 \x01(\rB\x07\xbaH\x04*\x02\x18\x02R\x0buplinkCount\x12\x36\n\x11uplink_interfaces\x18\xde\x01 \x03(\tB\x08\xbaH\x05\x92\x01\x02\x10\x02R\x10uplinkInterfaces\x12$\n\rpopulate_nsid\x18\xe6\x01 \x01(\x08R\x0cpopulateNsid\x12+\n\x11\x65nrich_asn_enable\x18\xf0\x01 \x01(\x08R\x0f\x65nrichAsnEnable\x12)\n\x0b\x61sn_db_path\x18\xf1\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\xff\x01R\tasnDbPath\x12L\n\x14\x61sn_refresh_interval\x18\xf2\x01 \x01(\x0b\x32\x19.google.protobuf.DurationR\x12\x61snRefreshInterval\x12=\n\x15ipmeta_bootstrap_path\x18\xf3\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\xff\x01R\x13ipmetaBootstrapPath\x12\x35\n\x11ipmeta_cache_path\x18\xf4\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\xff\x01R\x0fipmetaCachePath\x12\x35\n\x16\x65nrich_locality_enable\x18\xf5\x01 \x01(\x08R\x14\x65nrichLocalityEnable\x12V\n\x19locality_refresh_interval\x18\xf6\x01 \x01(\x0b\x32\x19.google.protobuf.DurationR\x17localityRefreshInterval\x12\x35\n\x16locality_events_enable\x18\xf7\x01 \x01(\x08R\x14localityEventsEnable\x12\x45\n\x0clink_monitor\x18\xfa\x01 \x01(\x0b\x32!.xtcp_config.v1.LinkMonitorConfigR\x0blinkMonitor:s\xbaHp\x1an\n\x0fXtcpConfig.poll\x12\x32Poll timeout must be less than poll poll_frequency\x1a\'this.poll_frequency > this.poll_timeout\"\x9f\x01\n\x14\x45nabledDeserializers\x12K\n\x07\x65nabled\x18\x01 \x03(\x0b\x32\x31.xtcp_config.v1.EnabledDeserializers.EnabledEntryR\x07\x65nabled\x1a:\n\x0c\x45nabledEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\x08R\x05value:\x02\x38\x01*h\n\x0fListenerNetwork\x12 \n\x1cLISTENER_NETWORK_UNSPECIFIED\x10\x00\x12\x18\n\x14LISTENER_NETWORK_TCP\x10\x01\x12\x19\n\x15LISTENER_NETWORK_UNIX\x10\x02*\xa1\x01\n\x10ListenerAuthMode\x12\"\n\x1eLISTENER_AUTH_MODE_UNSPECIFIED\x10\x00\x12\x1f\n\x1bLISTENER_AUTH_MODE_DISABLED\x10\x01\x12 \n\x1cLISTENER_AUTH_MODE_RAW_TOKEN\x10\x02\x12&\n\"LISTENER_AUTH_MODE_HMAC_UTC_MINUTE\x10\x03*\xf7\x01\n\rEndpointClass\x12\x1e\n\x1a\x45NDPOINT_CLASS_UNSPECIFIED\x10\x00\x12\x19\n\x15\x45NDPOINT_CLASS_HEALTH\x10\x01\x12\x1a\n\x16\x45NDPOINT_CLASS_METRICS\x10\x02\x12!\n\x1d\x45NDPOINT_CLASS_METRICS_DETAIL\x10\x03\x12\x15\n\x11\x45NDPOINT_CLASS_IP\x10\x04\x12\x18\n\x14\x45NDPOINT_CLASS_DEBUG\x10\x05\x12\x1c\n\x18\x45NDPOINT_CLASS_GRPC_READ\x10\x06\x12\x1d\n\x19\x45NDPOINT_CLASS_GRPC_ADMIN\x10\x07\x32\xa5\x07\n\rConfigService\x12\x61\n\x03Get\x12\x1a.xtcp_config.v1.GetRequest\x1a\x1b.xtcp_config.v1.GetResponse\"!\xc8\xf3\x18\x01\x82\xd3\xe4\x93\x02\x17\x1a\x12/ConfigService/Get:\x01*\x12\x61\n\x03Set\x12\x1a.xtcp_config.v1.SetRequest\x1a\x1b.xtcp_config.v1.SetResponse\"!\xc8\xf3\x18\x02\x82\xd3\xe4\x93\x02\x17\x1a\x12/ConfigService/Set:\x01*\x12\x95\x01\n\x10SetPollFrequency\x12\'.xtcp_config.v1.SetPollFrequencyRequest\x1a(.xtcp_config.v1.SetPollFrequencyResponse\".\xc8\xf3\x18\x02\x82\xd3\xe4\x93\x02$\x1a\x1f/ConfigService/SetPollFrequency:\x01*\x12\x81\x01\n\x0bTriggerPoll\x12\".xtcp_config.v1.TriggerPollRequest\x1a#.xtcp_config.v1.TriggerPollResponse\")\xc8\xf3\x18\x02\x82\xd3\xe4\x93\x02\x1f\x1a\x1a/ConfigService/TriggerPoll:\x01*\x12\x95\x01\n\x10TriggerPollBurst\x12\'.xtcp_config.v1.TriggerPollBurstRequest\x1a(.xtcp_config.v1.TriggerPollBurstResponse\".\xc8\xf3\x18\x02\x82\xd3\xe4\x93\x02$\x1a\x1f/ConfigService/TriggerPollBurst:\x01*\x12\x81\x01\n\x0bSetS3Upload\x12\".xtcp_config.v1.SetS3UploadRequest\x1a#.xtcp_config.v1.SetS3UploadResponse\")\xc8\xf3\x18\x02\x82\xd3\xe4\x93\x02\x1f\x1a\x1a/ConfigService/SetS3Upload:\x01*\x12\x95\x01\n\x10SetEnvelopeFlush\x12\'.xtcp_config.v1.SetEnvelopeFlushRequest\x1a(.xtcp_config.v1.SetEnvelopeFlushResponse\".\xc8\xf3\x18\x02\x82\xd3\xe4\x93\x02$\x1a\x1f/ConfigService/SetEnvelopeFlush:\x01*B\xaf\x01\n\x12\x63om.xtcp_config.v1B\x0fXtcpConfigProtoP\x01Z3github.com/randomizedcoder/xtcp2/gen/go/xtcp_config\xa2\x02\x03XXX\xaa\x02\rXtcpConfig.V1\xca\x02\rXtcpConfig\\V1\xe2\x02\x19XtcpConfig\\V1\\GPBMetadata\xea\x02\x0eXtcpConfig::V1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -82,8 +82,18 @@ _globals['_LISTENERAUTH'].fields_by_name['failure_jitter_min']._serialized_options = b'\272H\005\252\001\0022\000' _globals['_LISTENERAUTH'].fields_by_name['failure_jitter_max']._loaded_options = None _globals['_LISTENERAUTH'].fields_by_name['failure_jitter_max']._serialized_options = b'\272H\005\252\001\0022\000' + _globals['_LISTENERAUTH'].fields_by_name['raw_token_file']._loaded_options = None + _globals['_LISTENERAUTH'].fields_by_name['raw_token_file']._serialized_options = b'\272H\005r\003\030\200 ' + _globals['_LISTENERAUTH'].fields_by_name['hmac_shared_key_file']._loaded_options = None + _globals['_LISTENERAUTH'].fields_by_name['hmac_shared_key_file']._serialized_options = b'\272H\005r\003\030\200 ' _globals['_LISTENERAUTH']._loaded_options = None _globals['_LISTENERAUTH']._serialized_options = b'\272H\335\001\032\332\001\n\032ListenerAuth.failureJitter\022Ffailure_jitter_max must be greater than or equal to failure_jitter_min\032t!has(this.failure_jitter_min) || !has(this.failure_jitter_max) || this.failure_jitter_max >= this.failure_jitter_min' + _globals['_LISTENER'].fields_by_name['name']._loaded_options = None + _globals['_LISTENER'].fields_by_name['name']._serialized_options = b'\272H\031r\027\020\001\030 2\021^[a-z][a-z0-9-]*$' + _globals['_LISTENER'].fields_by_name['endpoint']._loaded_options = None + _globals['_LISTENER'].fields_by_name['endpoint']._serialized_options = b'\272H\003\310\001\001' + _globals['_LISTENER'].fields_by_name['serves']._loaded_options = None + _globals['_LISTENER'].fields_by_name['serves']._serialized_options = b'\272H\022\222\001\017\010\001\020\007\030\001\"\007\202\001\004\020\001 \000' _globals['_LINKMONITORCONFIG'].fields_by_name['baseline_file']._loaded_options = None _globals['_LINKMONITORCONFIG'].fields_by_name['baseline_file']._serialized_options = b'\272H\005r\003\030\200 ' _globals['_LINKMONITORCONFIG'].fields_by_name['settle']._loaded_options = None @@ -245,9 +255,11 @@ _globals['_XTCPCONFIG'].fields_by_name['admin_listener_auth']._loaded_options = None _globals['_XTCPCONFIG'].fields_by_name['admin_listener_auth']._serialized_options = b'\272H\003\310\001\000' _globals['_XTCPCONFIG'].fields_by_name['grpc_port']._loaded_options = None - _globals['_XTCPCONFIG'].fields_by_name['grpc_port']._serialized_options = b'\272H\013*\006\030\377\377\003(\001\310\001\001' + _globals['_XTCPCONFIG'].fields_by_name['grpc_port']._serialized_options = b'\272H\006*\004\030\377\377\003' _globals['_XTCPCONFIG'].fields_by_name['grpc_listener']._loaded_options = None _globals['_XTCPCONFIG'].fields_by_name['grpc_listener']._serialized_options = b'\272H\003\310\001\000' + _globals['_XTCPCONFIG'].fields_by_name['listeners']._loaded_options = None + _globals['_XTCPCONFIG'].fields_by_name['listeners']._serialized_options = b'\272H\005\222\001\002\020\020' _globals['_XTCPCONFIG'].fields_by_name['pyroscope_url']._loaded_options = None _globals['_XTCPCONFIG'].fields_by_name['pyroscope_url']._serialized_options = b'\272H\003\310\001\000' _globals['_XTCPCONFIG'].fields_by_name['pyroscope_app_name']._loaded_options = None @@ -292,10 +304,12 @@ _globals['_CONFIGSERVICE'].methods_by_name['SetS3Upload']._serialized_options = b'\310\363\030\002\202\323\344\223\002\037\032\032/ConfigService/SetS3Upload:\001*' _globals['_CONFIGSERVICE'].methods_by_name['SetEnvelopeFlush']._loaded_options = None _globals['_CONFIGSERVICE'].methods_by_name['SetEnvelopeFlush']._serialized_options = b'\310\363\030\002\202\323\344\223\002$\032\037/ConfigService/SetEnvelopeFlush:\001*' - _globals['_LISTENERNETWORK']._serialized_start=9848 - _globals['_LISTENERNETWORK']._serialized_end=9952 - _globals['_LISTENERAUTHMODE']._serialized_start=9955 - _globals['_LISTENERAUTHMODE']._serialized_end=10116 + _globals['_LISTENERNETWORK']._serialized_start=10339 + _globals['_LISTENERNETWORK']._serialized_end=10443 + _globals['_LISTENERAUTHMODE']._serialized_start=10446 + _globals['_LISTENERAUTHMODE']._serialized_end=10607 + _globals['_ENDPOINTCLASS']._serialized_start=10610 + _globals['_ENDPOINTCLASS']._serialized_end=10857 _globals['_GETREQUEST']._serialized_start=173 _globals['_GETREQUEST']._serialized_end=185 _globals['_GETRESPONSE']._serialized_start=187 @@ -327,15 +341,17 @@ _globals['_LISTENERENDPOINT']._serialized_start=1957 _globals['_LISTENERENDPOINT']._serialized_end=2351 _globals['_LISTENERAUTH']._serialized_start=2354 - _globals['_LISTENERAUTH']._serialized_end=3018 - _globals['_LINKMONITORCONFIG']._serialized_start=3021 - _globals['_LINKMONITORCONFIG']._serialized_end=4839 - _globals['_XTCPCONFIG']._serialized_start=4842 - _globals['_XTCPCONFIG']._serialized_end=9684 - _globals['_ENABLEDDESERIALIZERS']._serialized_start=9687 - _globals['_ENABLEDDESERIALIZERS']._serialized_end=9846 - _globals['_ENABLEDDESERIALIZERS_ENABLEDENTRY']._serialized_start=9788 - _globals['_ENABLEDDESERIALIZERS_ENABLEDENTRY']._serialized_end=9846 - _globals['_CONFIGSERVICE']._serialized_start=10119 - _globals['_CONFIGSERVICE']._serialized_end=11052 + _globals['_LISTENERAUTH']._serialized_end=3125 + _globals['_LISTENER']._serialized_start=3128 + _globals['_LISTENER']._serialized_end=3447 + _globals['_LINKMONITORCONFIG']._serialized_start=3450 + _globals['_LINKMONITORCONFIG']._serialized_end=5268 + _globals['_XTCPCONFIG']._serialized_start=5271 + _globals['_XTCPCONFIG']._serialized_end=10175 + _globals['_ENABLEDDESERIALIZERS']._serialized_start=10178 + _globals['_ENABLEDDESERIALIZERS']._serialized_end=10337 + _globals['_ENABLEDDESERIALIZERS_ENABLEDENTRY']._serialized_start=10279 + _globals['_ENABLEDDESERIALIZERS_ENABLEDENTRY']._serialized_end=10337 + _globals['_CONFIGSERVICE']._serialized_start=10860 + _globals['_CONFIGSERVICE']._serialized_end=11793 # @@protoc_insertion_point(module_scope) diff --git a/gen/python/xtcp_config/v1/xtcp_config_pb2.pyi b/gen/python/xtcp_config/v1/xtcp_config_pb2.pyi index 9d6614ad6..66f9b95e8 100644 --- a/gen/python/xtcp_config/v1/xtcp_config_pb2.pyi +++ b/gen/python/xtcp_config/v1/xtcp_config_pb2.pyi @@ -25,6 +25,17 @@ class ListenerAuthMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): LISTENER_AUTH_MODE_DISABLED: _ClassVar[ListenerAuthMode] LISTENER_AUTH_MODE_RAW_TOKEN: _ClassVar[ListenerAuthMode] LISTENER_AUTH_MODE_HMAC_UTC_MINUTE: _ClassVar[ListenerAuthMode] + +class EndpointClass(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + ENDPOINT_CLASS_UNSPECIFIED: _ClassVar[EndpointClass] + ENDPOINT_CLASS_HEALTH: _ClassVar[EndpointClass] + ENDPOINT_CLASS_METRICS: _ClassVar[EndpointClass] + ENDPOINT_CLASS_METRICS_DETAIL: _ClassVar[EndpointClass] + ENDPOINT_CLASS_IP: _ClassVar[EndpointClass] + ENDPOINT_CLASS_DEBUG: _ClassVar[EndpointClass] + ENDPOINT_CLASS_GRPC_READ: _ClassVar[EndpointClass] + ENDPOINT_CLASS_GRPC_ADMIN: _ClassVar[EndpointClass] LISTENER_NETWORK_UNSPECIFIED: ListenerNetwork LISTENER_NETWORK_TCP: ListenerNetwork LISTENER_NETWORK_UNIX: ListenerNetwork @@ -32,6 +43,14 @@ LISTENER_AUTH_MODE_UNSPECIFIED: ListenerAuthMode LISTENER_AUTH_MODE_DISABLED: ListenerAuthMode LISTENER_AUTH_MODE_RAW_TOKEN: ListenerAuthMode LISTENER_AUTH_MODE_HMAC_UTC_MINUTE: ListenerAuthMode +ENDPOINT_CLASS_UNSPECIFIED: EndpointClass +ENDPOINT_CLASS_HEALTH: EndpointClass +ENDPOINT_CLASS_METRICS: EndpointClass +ENDPOINT_CLASS_METRICS_DETAIL: EndpointClass +ENDPOINT_CLASS_IP: EndpointClass +ENDPOINT_CLASS_DEBUG: EndpointClass +ENDPOINT_CLASS_GRPC_READ: EndpointClass +ENDPOINT_CLASS_GRPC_ADMIN: EndpointClass class GetRequest(_message.Message): __slots__ = () @@ -140,20 +159,38 @@ class ListenerEndpoint(_message.Message): def __init__(self, network: _Optional[_Union[ListenerNetwork, str]] = ..., address: _Optional[str] = ..., unix_socket_mode: _Optional[int] = ..., unlink_stale_unix_socket: _Optional[bool] = ..., max_connections: _Optional[int] = ..., accept_rate_per_second: _Optional[int] = ..., accept_burst: _Optional[int] = ...) -> None: ... class ListenerAuth(_message.Message): - __slots__ = ("mode", "raw_token", "hmac_shared_key", "signed_token_skew_minutes", "failure_jitter_min", "failure_jitter_max") + __slots__ = ("mode", "raw_token", "hmac_shared_key", "signed_token_skew_minutes", "failure_jitter_min", "failure_jitter_max", "raw_token_file", "hmac_shared_key_file") MODE_FIELD_NUMBER: _ClassVar[int] RAW_TOKEN_FIELD_NUMBER: _ClassVar[int] HMAC_SHARED_KEY_FIELD_NUMBER: _ClassVar[int] SIGNED_TOKEN_SKEW_MINUTES_FIELD_NUMBER: _ClassVar[int] FAILURE_JITTER_MIN_FIELD_NUMBER: _ClassVar[int] FAILURE_JITTER_MAX_FIELD_NUMBER: _ClassVar[int] + RAW_TOKEN_FILE_FIELD_NUMBER: _ClassVar[int] + HMAC_SHARED_KEY_FILE_FIELD_NUMBER: _ClassVar[int] mode: ListenerAuthMode raw_token: str hmac_shared_key: str signed_token_skew_minutes: int failure_jitter_min: _duration_pb2.Duration failure_jitter_max: _duration_pb2.Duration - def __init__(self, mode: _Optional[_Union[ListenerAuthMode, str]] = ..., raw_token: _Optional[str] = ..., hmac_shared_key: _Optional[str] = ..., signed_token_skew_minutes: _Optional[int] = ..., failure_jitter_min: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., failure_jitter_max: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ...) -> None: ... + raw_token_file: str + hmac_shared_key_file: str + def __init__(self, mode: _Optional[_Union[ListenerAuthMode, str]] = ..., raw_token: _Optional[str] = ..., hmac_shared_key: _Optional[str] = ..., signed_token_skew_minutes: _Optional[int] = ..., failure_jitter_min: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., failure_jitter_max: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., raw_token_file: _Optional[str] = ..., hmac_shared_key_file: _Optional[str] = ...) -> None: ... + +class Listener(_message.Message): + __slots__ = ("name", "endpoint", "auth", "admin_auth", "serves") + NAME_FIELD_NUMBER: _ClassVar[int] + ENDPOINT_FIELD_NUMBER: _ClassVar[int] + AUTH_FIELD_NUMBER: _ClassVar[int] + ADMIN_AUTH_FIELD_NUMBER: _ClassVar[int] + SERVES_FIELD_NUMBER: _ClassVar[int] + name: str + endpoint: ListenerEndpoint + auth: ListenerAuth + admin_auth: ListenerAuth + serves: _containers.RepeatedScalarFieldContainer[EndpointClass] + def __init__(self, name: _Optional[str] = ..., endpoint: _Optional[_Union[ListenerEndpoint, _Mapping]] = ..., auth: _Optional[_Union[ListenerAuth, _Mapping]] = ..., admin_auth: _Optional[_Union[ListenerAuth, _Mapping]] = ..., serves: _Optional[_Iterable[_Union[EndpointClass, str]]] = ...) -> None: ... class LinkMonitorConfig(_message.Message): __slots__ = ("enable", "baseline_file", "settle", "resync", "stats_interval", "stats_include", "stats_exclude", "netstat_fields", "max_speed_exceptions", "metrics_core_include", "metrics_core_exclude", "metrics_all", "collection_mode", "watch_interval", "slow_interval", "on_demand_ttl", "on_demand_wait", "error_window", "flap_window", "error_classes", "error_exclude", "metrics_categories", "metrics_interface_paths", "metrics_all_path", "ip_paths", "ip_max_bytes", "ip_listen", "learn_deadline") @@ -216,7 +253,7 @@ class LinkMonitorConfig(_message.Message): def __init__(self, enable: _Optional[bool] = ..., baseline_file: _Optional[str] = ..., settle: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., resync: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., stats_interval: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., stats_include: _Optional[str] = ..., stats_exclude: _Optional[str] = ..., netstat_fields: _Optional[str] = ..., max_speed_exceptions: _Optional[_Iterable[str]] = ..., metrics_core_include: _Optional[str] = ..., metrics_core_exclude: _Optional[str] = ..., metrics_all: _Optional[bool] = ..., collection_mode: _Optional[str] = ..., watch_interval: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., slow_interval: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., on_demand_ttl: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., on_demand_wait: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., error_window: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., flap_window: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., error_classes: _Optional[str] = ..., error_exclude: _Optional[str] = ..., metrics_categories: _Optional[str] = ..., metrics_interface_paths: _Optional[bool] = ..., metrics_all_path: _Optional[str] = ..., ip_paths: _Optional[bool] = ..., ip_max_bytes: _Optional[int] = ..., ip_listen: _Optional[str] = ..., learn_deadline: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ...) -> None: ... class XtcpConfig(_message.Message): - __slots__ = ("nl_timeout_milliseconds", "poll_frequency", "poll_timeout", "poll_jitter_pct", "max_loops", "netlinkers", "netlinkers_done_chan_size", "nlmsg_seq", "packet_size", "packet_size_mply", "modulus", "enabled_deserializers", "io_uring", "io_uring_recv_batch_size", "io_uring_cqe_batch_size", "reconcile_frequency", "reconcile_before_poll", "write_files", "capture_path", "dest_write_files", "debug_level", "debug_prometheus", "dest", "marshal_to", "csv_columns", "xtcp_proto_file", "envelope_flush_threshold_bytes", "envelope_flush_threshold_rows", "topic", "kafka_schema_url", "kafka_produce_timeout", "kafka_compression", "s3_endpoint", "s3_region", "s3_bucket", "s3_prefix", "s3_access_key", "s3_secret_key", "s3_skip_bucket_probe", "s3_allow_insecure", "s3_ca_file", "s3_parquet_flush_threshold_bytes", "s3_flush_interval", "s3_flush_jitter_pct", "s3_flush_threshold_jitter_pct", "s3_upload_max_attempts", "s3_upload_backoff_cap", "hostname", "location", "label", "tag", "daemon_version", "ipv4_ttl", "ipv6_hop_limit", "listener_auth", "prometheus_listener", "admin_listener_auth", "grpc_port", "grpc_listener", "pyroscope_url", "pyroscope_app_name", "pyroscope_sample_hz", "pyroscope_upload_interval_sec", "resolve_container_id", "enrich_container_enable", "docker_socket_path", "enrich_lldp_enable", "lldpd_socket_path", "lldpd_version_hint", "enrich_nic_enable", "uplink_count", "uplink_interfaces", "populate_nsid", "enrich_asn_enable", "asn_db_path", "asn_refresh_interval", "ipmeta_bootstrap_path", "ipmeta_cache_path", "enrich_locality_enable", "locality_refresh_interval", "locality_events_enable", "link_monitor") + __slots__ = ("nl_timeout_milliseconds", "poll_frequency", "poll_timeout", "poll_jitter_pct", "max_loops", "netlinkers", "netlinkers_done_chan_size", "nlmsg_seq", "packet_size", "packet_size_mply", "modulus", "enabled_deserializers", "io_uring", "io_uring_recv_batch_size", "io_uring_cqe_batch_size", "reconcile_frequency", "reconcile_before_poll", "write_files", "capture_path", "dest_write_files", "debug_level", "debug_prometheus", "dest", "marshal_to", "csv_columns", "xtcp_proto_file", "envelope_flush_threshold_bytes", "envelope_flush_threshold_rows", "topic", "kafka_schema_url", "kafka_produce_timeout", "kafka_compression", "s3_endpoint", "s3_region", "s3_bucket", "s3_prefix", "s3_access_key", "s3_secret_key", "s3_skip_bucket_probe", "s3_allow_insecure", "s3_ca_file", "s3_parquet_flush_threshold_bytes", "s3_flush_interval", "s3_flush_jitter_pct", "s3_flush_threshold_jitter_pct", "s3_upload_max_attempts", "s3_upload_backoff_cap", "hostname", "location", "label", "tag", "daemon_version", "ipv4_ttl", "ipv6_hop_limit", "listener_auth", "prometheus_listener", "admin_listener_auth", "grpc_port", "grpc_listener", "listeners", "pyroscope_url", "pyroscope_app_name", "pyroscope_sample_hz", "pyroscope_upload_interval_sec", "resolve_container_id", "enrich_container_enable", "docker_socket_path", "enrich_lldp_enable", "lldpd_socket_path", "lldpd_version_hint", "enrich_nic_enable", "uplink_count", "uplink_interfaces", "populate_nsid", "enrich_asn_enable", "asn_db_path", "asn_refresh_interval", "ipmeta_bootstrap_path", "ipmeta_cache_path", "enrich_locality_enable", "locality_refresh_interval", "locality_events_enable", "link_monitor") NL_TIMEOUT_MILLISECONDS_FIELD_NUMBER: _ClassVar[int] POLL_FREQUENCY_FIELD_NUMBER: _ClassVar[int] POLL_TIMEOUT_FIELD_NUMBER: _ClassVar[int] @@ -276,6 +313,7 @@ class XtcpConfig(_message.Message): ADMIN_LISTENER_AUTH_FIELD_NUMBER: _ClassVar[int] GRPC_PORT_FIELD_NUMBER: _ClassVar[int] GRPC_LISTENER_FIELD_NUMBER: _ClassVar[int] + LISTENERS_FIELD_NUMBER: _ClassVar[int] PYROSCOPE_URL_FIELD_NUMBER: _ClassVar[int] PYROSCOPE_APP_NAME_FIELD_NUMBER: _ClassVar[int] PYROSCOPE_SAMPLE_HZ_FIELD_NUMBER: _ClassVar[int] @@ -358,6 +396,7 @@ class XtcpConfig(_message.Message): admin_listener_auth: ListenerAuth grpc_port: int grpc_listener: ListenerEndpoint + listeners: _containers.RepeatedCompositeFieldContainer[Listener] pyroscope_url: str pyroscope_app_name: str pyroscope_sample_hz: int @@ -381,7 +420,7 @@ class XtcpConfig(_message.Message): locality_refresh_interval: _duration_pb2.Duration locality_events_enable: bool link_monitor: LinkMonitorConfig - def __init__(self, nl_timeout_milliseconds: _Optional[int] = ..., poll_frequency: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., poll_timeout: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., poll_jitter_pct: _Optional[int] = ..., max_loops: _Optional[int] = ..., netlinkers: _Optional[int] = ..., netlinkers_done_chan_size: _Optional[int] = ..., nlmsg_seq: _Optional[int] = ..., packet_size: _Optional[int] = ..., packet_size_mply: _Optional[int] = ..., modulus: _Optional[int] = ..., enabled_deserializers: _Optional[_Union[EnabledDeserializers, _Mapping]] = ..., io_uring: _Optional[bool] = ..., io_uring_recv_batch_size: _Optional[int] = ..., io_uring_cqe_batch_size: _Optional[int] = ..., reconcile_frequency: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., reconcile_before_poll: _Optional[bool] = ..., write_files: _Optional[int] = ..., capture_path: _Optional[str] = ..., dest_write_files: _Optional[int] = ..., debug_level: _Optional[int] = ..., debug_prometheus: _Optional[bool] = ..., dest: _Optional[str] = ..., marshal_to: _Optional[str] = ..., csv_columns: _Optional[str] = ..., xtcp_proto_file: _Optional[str] = ..., envelope_flush_threshold_bytes: _Optional[int] = ..., envelope_flush_threshold_rows: _Optional[int] = ..., topic: _Optional[str] = ..., kafka_schema_url: _Optional[str] = ..., kafka_produce_timeout: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., kafka_compression: _Optional[str] = ..., s3_endpoint: _Optional[str] = ..., s3_region: _Optional[str] = ..., s3_bucket: _Optional[str] = ..., s3_prefix: _Optional[str] = ..., s3_access_key: _Optional[str] = ..., s3_secret_key: _Optional[str] = ..., s3_skip_bucket_probe: _Optional[bool] = ..., s3_allow_insecure: _Optional[bool] = ..., s3_ca_file: _Optional[str] = ..., s3_parquet_flush_threshold_bytes: _Optional[int] = ..., s3_flush_interval: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., s3_flush_jitter_pct: _Optional[int] = ..., s3_flush_threshold_jitter_pct: _Optional[int] = ..., s3_upload_max_attempts: _Optional[int] = ..., s3_upload_backoff_cap: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., hostname: _Optional[str] = ..., location: _Optional[str] = ..., label: _Optional[str] = ..., tag: _Optional[str] = ..., daemon_version: _Optional[str] = ..., ipv4_ttl: _Optional[int] = ..., ipv6_hop_limit: _Optional[int] = ..., listener_auth: _Optional[_Union[ListenerAuth, _Mapping]] = ..., prometheus_listener: _Optional[_Union[ListenerEndpoint, _Mapping]] = ..., admin_listener_auth: _Optional[_Union[ListenerAuth, _Mapping]] = ..., grpc_port: _Optional[int] = ..., grpc_listener: _Optional[_Union[ListenerEndpoint, _Mapping]] = ..., pyroscope_url: _Optional[str] = ..., pyroscope_app_name: _Optional[str] = ..., pyroscope_sample_hz: _Optional[int] = ..., pyroscope_upload_interval_sec: _Optional[int] = ..., resolve_container_id: _Optional[bool] = ..., enrich_container_enable: _Optional[bool] = ..., docker_socket_path: _Optional[str] = ..., enrich_lldp_enable: _Optional[bool] = ..., lldpd_socket_path: _Optional[str] = ..., lldpd_version_hint: _Optional[str] = ..., enrich_nic_enable: _Optional[bool] = ..., uplink_count: _Optional[int] = ..., uplink_interfaces: _Optional[_Iterable[str]] = ..., populate_nsid: _Optional[bool] = ..., enrich_asn_enable: _Optional[bool] = ..., asn_db_path: _Optional[str] = ..., asn_refresh_interval: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., ipmeta_bootstrap_path: _Optional[str] = ..., ipmeta_cache_path: _Optional[str] = ..., enrich_locality_enable: _Optional[bool] = ..., locality_refresh_interval: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., locality_events_enable: _Optional[bool] = ..., link_monitor: _Optional[_Union[LinkMonitorConfig, _Mapping]] = ...) -> None: ... + def __init__(self, nl_timeout_milliseconds: _Optional[int] = ..., poll_frequency: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., poll_timeout: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., poll_jitter_pct: _Optional[int] = ..., max_loops: _Optional[int] = ..., netlinkers: _Optional[int] = ..., netlinkers_done_chan_size: _Optional[int] = ..., nlmsg_seq: _Optional[int] = ..., packet_size: _Optional[int] = ..., packet_size_mply: _Optional[int] = ..., modulus: _Optional[int] = ..., enabled_deserializers: _Optional[_Union[EnabledDeserializers, _Mapping]] = ..., io_uring: _Optional[bool] = ..., io_uring_recv_batch_size: _Optional[int] = ..., io_uring_cqe_batch_size: _Optional[int] = ..., reconcile_frequency: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., reconcile_before_poll: _Optional[bool] = ..., write_files: _Optional[int] = ..., capture_path: _Optional[str] = ..., dest_write_files: _Optional[int] = ..., debug_level: _Optional[int] = ..., debug_prometheus: _Optional[bool] = ..., dest: _Optional[str] = ..., marshal_to: _Optional[str] = ..., csv_columns: _Optional[str] = ..., xtcp_proto_file: _Optional[str] = ..., envelope_flush_threshold_bytes: _Optional[int] = ..., envelope_flush_threshold_rows: _Optional[int] = ..., topic: _Optional[str] = ..., kafka_schema_url: _Optional[str] = ..., kafka_produce_timeout: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., kafka_compression: _Optional[str] = ..., s3_endpoint: _Optional[str] = ..., s3_region: _Optional[str] = ..., s3_bucket: _Optional[str] = ..., s3_prefix: _Optional[str] = ..., s3_access_key: _Optional[str] = ..., s3_secret_key: _Optional[str] = ..., s3_skip_bucket_probe: _Optional[bool] = ..., s3_allow_insecure: _Optional[bool] = ..., s3_ca_file: _Optional[str] = ..., s3_parquet_flush_threshold_bytes: _Optional[int] = ..., s3_flush_interval: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., s3_flush_jitter_pct: _Optional[int] = ..., s3_flush_threshold_jitter_pct: _Optional[int] = ..., s3_upload_max_attempts: _Optional[int] = ..., s3_upload_backoff_cap: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., hostname: _Optional[str] = ..., location: _Optional[str] = ..., label: _Optional[str] = ..., tag: _Optional[str] = ..., daemon_version: _Optional[str] = ..., ipv4_ttl: _Optional[int] = ..., ipv6_hop_limit: _Optional[int] = ..., listener_auth: _Optional[_Union[ListenerAuth, _Mapping]] = ..., prometheus_listener: _Optional[_Union[ListenerEndpoint, _Mapping]] = ..., admin_listener_auth: _Optional[_Union[ListenerAuth, _Mapping]] = ..., grpc_port: _Optional[int] = ..., grpc_listener: _Optional[_Union[ListenerEndpoint, _Mapping]] = ..., listeners: _Optional[_Iterable[_Union[Listener, _Mapping]]] = ..., pyroscope_url: _Optional[str] = ..., pyroscope_app_name: _Optional[str] = ..., pyroscope_sample_hz: _Optional[int] = ..., pyroscope_upload_interval_sec: _Optional[int] = ..., resolve_container_id: _Optional[bool] = ..., enrich_container_enable: _Optional[bool] = ..., docker_socket_path: _Optional[str] = ..., enrich_lldp_enable: _Optional[bool] = ..., lldpd_socket_path: _Optional[str] = ..., lldpd_version_hint: _Optional[str] = ..., enrich_nic_enable: _Optional[bool] = ..., uplink_count: _Optional[int] = ..., uplink_interfaces: _Optional[_Iterable[str]] = ..., populate_nsid: _Optional[bool] = ..., enrich_asn_enable: _Optional[bool] = ..., asn_db_path: _Optional[str] = ..., asn_refresh_interval: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., ipmeta_bootstrap_path: _Optional[str] = ..., ipmeta_cache_path: _Optional[str] = ..., enrich_locality_enable: _Optional[bool] = ..., locality_refresh_interval: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., locality_events_enable: _Optional[bool] = ..., link_monitor: _Optional[_Union[LinkMonitorConfig, _Mapping]] = ...) -> None: ... class EnabledDeserializers(_message.Message): __slots__ = ("enabled",) diff --git a/nix/containers/default.nix b/nix/containers/default.nix index b717d55f9..7c0770e5d 100644 --- a/nix/containers/default.nix +++ b/nix/containers/default.nix @@ -65,7 +65,9 @@ let ); # Self-contained container HEALTHCHECK for the xtcp2-daemon images (scratch, - # no shell/curl): the binary probes its own /readyz via `-healthcheck`. + # no shell/curl): the binary probes /readyz on its health listener via + # `-healthcheck`, from the same LISTENERS / LISTENER_RAW_TOKEN_FILE env as + # the daemon. # Durations are integer nanoseconds. NOT applied to the tcp-stress image # (different entrypoint, no daemon). xtcp2Healthcheck = { @@ -179,10 +181,8 @@ let inherit tag; binaries = binaries.${attr}; protoFile = src + "/proto/xtcp_flat_record/v1/xtcp_flat_record.proto"; - exposedPorts = [ - 9088 - 8889 - ]; + # No exposed ports: the daemon serves its default Unix socket, + # /run/xtcp2/metrics.sock; mount /run/xtcp2 to scrape it from the host. entrypoint = "/bin/xtcp2"; healthcheck = xtcp2Healthcheck; env = xtcp2Env; @@ -201,10 +201,8 @@ let tag = "${dest}${lib.optionalString (enrich != "none") "-${enrich}"}${daemonTagSuffix}"; binaries = binaries.xtcp2OnlyByFlavor.${dest}.${enrich}; protoFile = src + "/proto/xtcp_flat_record/v1/xtcp_flat_record.proto"; - exposedPorts = [ - 9088 - 8889 - ]; + # No exposed ports: the daemon serves its default Unix socket, + # /run/xtcp2/metrics.sock; mount /run/xtcp2 to scrape it from the host. entrypoint = "/bin/xtcp2"; healthcheck = xtcp2Healthcheck; env = xtcp2Env; diff --git a/nix/microvms/mkVm.nix b/nix/microvms/mkVm.nix index 4b3b746c3..37185db49 100644 --- a/nix/microvms/mkVm.nix +++ b/nix/microvms/mkVm.nix @@ -159,12 +159,27 @@ let isMinimal = sink == "minimal"; isTcpStress = sink == "tcp-stress"; # uds-security exercises both operator-facing listener transports through - # the real packaged clients, with bearer auth enabled on both sockets. + # the real packaged clients, with bearer auth enabled on both sockets: the + # default metrics socket plus the documented gRPC socket. isUdsSecurity = sink == "uds-security"; udsRuntimeDir = "/run/xtcp2"; udsGrpcSocket = "${udsRuntimeDir}/grpc.sock"; - udsPromSocket = "${udsRuntimeDir}/prometheus.sock"; - udsAuthToken = "xtcp2-uds-integration-test-token"; + udsPromSocket = "${udsRuntimeDir}/metrics.sock"; + udsAuthToken = vmListenerToken; + # Every guest listener checks this token, which each scrape and client + # call sends. It is test data, not a deployment secret. + vmListenerToken = "xtcp2-vm-integration-test-token"; + vmListenerTokenFile = "/etc/xtcp2/listener-token"; + vmAuthHeader = ''-H "Authorization: Bearer $(cat ${vmListenerTokenFile})"''; + vmGrpcTcp = + port: "-network tcp -target 127.0.0.1 -port ${port} -auth-token-file ${vmListenerTokenFile}"; + # The TCP listeners the VM checks scrape and dial. TCP needs a credential, + # so both check the test token; the gRPC listener serves every method + # under it (grpc-admin alone carries no read/admin split). + mkTcpListenerArgs = promPort: grpcPort: [ + "-listener=name=prometheus,serves=health+metrics+metrics-detail,address=:${toString promPort},network=tcp,tokenFile=${vmListenerTokenFile}" + "-listener=name=grpc,serves=grpc-admin,address=:${toString grpcPort},network=tcp,tokenFile=${vmListenerTokenFile}" + ]; # interface-naming = a docker-free host-ns flavor that proves xtcp2 names # interfaces correctly end-to-end. It builds two veth pairs (a peer netns holds # the far ends), runs the tcp_client/tcp_server generators bound to specific @@ -533,6 +548,7 @@ let inherit fileOutputPath; runUdsSecurityCheck = isUdsSecurity; inherit udsGrpcSocket udsPromSocket udsAuthToken; + listenerTokenFile = vmListenerTokenFile; # interface-naming flavor only: assert the bound + egress interface names. runInterfaceNamingCheck = isInterfaceNaming; ifnameBound = ifnBoundIf; @@ -1094,7 +1110,7 @@ let # Each scrape is a JSON-shaped record so jq can post-process later. while true; do ts=$(date -u +%FT%TZ) - body=$(curl --silent --fail --max-time 5 \ + body=$(curl --silent --fail --max-time 5 ${vmAuthHeader} \ "http://127.0.0.1:${toString cfg.promPort}/metrics" \ | grep '^xtcp_' || true) if [ -z "$body" ]; then @@ -1532,12 +1548,12 @@ let # Sum a Poller counter row (function="Poller",variable=$1) from /metrics. # Handles integer or scientific-notation values (awk coerces both). poller_counter() { - curl --silent --fail --max-time 3 "$PROM" 2>/dev/null \ + curl --silent --fail --max-time 3 ${vmAuthHeader} "$PROM" 2>/dev/null \ | awk -v v="variable=\"$1\"" ' /^xtcp_counts/ && index($0,"function=\"Poller\"")>0 && index($0,v)>0 { s += $NF + 0 } END { printf "%d", s+0 }' } - setfreq() { xtcp2ctl set-poll-frequency -frequency "$1" -timeout "$2" -target 127.0.0.1 -port "$GPORT" >/dev/null 2>&1; } + setfreq() { xtcp2ctl set-poll-frequency -frequency "$1" -timeout "$2" ${vmGrpcTcp ''"$GPORT"''} >/dev/null 2>&1; } # within_tol ACTUAL EXPECTED → true when |actual-expected|*100/expected <= TOL. within_tol() { local a="$1" e="$2" d @@ -1569,7 +1585,7 @@ let # ── Ready gate: xtcp2 metrics up AND rows already flowing into ClickHouse. ready=0 for _ in $(seq 1 90); do - if curl --silent --fail --max-time 3 "$PROM" 2>/dev/null | grep -q '^xtcp_'; then + if curl --silent --fail --max-time 3 ${vmAuthHeader} "$PROM" 2>/dev/null | grep -q '^xtcp_'; then r=$(ch_rows); r=''${r:-0} if [ "$r" -gt 0 ]; then ready=1; break; fi fi @@ -1629,14 +1645,14 @@ let # poll counter advanced by >=6 and 6× the rows were produced AND delivered. setfreq 3600s 1s; sleep "$SETTLE" pe0=$(poller_counter envelopeRows) - xtcp2ctl trigger-poll -target 127.0.0.1 -port "$GPORT" >/dev/null 2>&1 + xtcp2ctl trigger-poll ${vmGrpcTcp ''"$GPORT"''} >/dev/null 2>&1 sleep 8 pe1=$(poller_counter envelopeRows) perpoll=$(( pe1 - pe0 )) pr0=$(poller_counter pollRequestCh); be0=$(poller_counter envelopeRows) bc0=$(ch_rows); bc0=''${bc0:-0} - xtcp2ctl poll-burst -count 6 -interval 10s -target 127.0.0.1 -port "$GPORT" >/dev/null 2>&1 + xtcp2ctl poll-burst -count 6 -interval 10s ${vmGrpcTcp ''"$GPORT"''} >/dev/null 2>&1 sleep 80 # 6 × 10s spacing + ClickHouse consume lag pr1=$(poller_counter pollRequestCh); be1=$(poller_counter envelopeRows) bc1=$(ch_rows); bc1=''${bc1:-0} @@ -1767,7 +1783,7 @@ let # No S3 probe — xtcp2 itself owns the upload counter we # rely on, so the metrics endpoint is the right readiness gate. for _ in $(seq 1 60); do - if curl --silent --fail --max-time 2 \ + if curl --silent --fail --max-time 2 ${vmAuthHeader} \ http://127.0.0.1:9088/metrics >/dev/null 2>&1; then break fi @@ -1808,7 +1824,7 @@ let while true; do sleep "$interval" - metrics=$(curl --silent --fail --max-time 5 \ + metrics=$(curl --silent --fail --max-time 5 ${vmAuthHeader} \ http://127.0.0.1:9088/metrics 2>/dev/null || echo "") files=$(get_counter "$metrics" 'variable="upload"') bytes=$(get_counter "$metrics" 'variable="uploadBytes"') @@ -2338,11 +2354,8 @@ let "xtcp2testsecretkey" "-s3ParquetFlushBytes" "262144" - "-promListen" - ":9089" - "-grpcPort" - "8890" - ]; + ] + ++ mkTcpListenerArgs 9089 8890; # Both the basic and coverage flavors override the default dest. The # default in cmd/xtcp2 is `kafka:redpanda-0:9092` which makes the kafka @@ -2397,29 +2410,13 @@ let "1s" ]; - # UDS security flavor: private sockets plus a deterministic fixture token. - # This token is test data, not a deployment secret. The two *UnlinkStale* - # flags are Go bools, so their value must be attached (`-name=true`): a - # separate "true" is a positional argument, which xtcp2 rejects. + # UDS security flavor: the default metrics socket (the shape xtcp2 serves + # with no -listener) and the documented gRPC socket, both 0600 with the + # test token; the gRPC socket splits read and admin, with the same token + # file for both. xtcp2UdsSecurityArgs = xtcp2FileArgs ++ [ - "-grpcListenNetwork" - "unix" - "-grpcListenAddress" - udsGrpcSocket - "-grpcUnixSocketMode" - "384" - "-grpcUnlinkStaleUnixSocket=true" - "-promListenNetwork" - "unix" - "-promListen" - udsPromSocket - "-promUnixSocketMode" - "384" - "-promUnlinkStaleUnixSocket=true" - "-listenerAuthMode" - "raw" - "-listenerRawToken" - udsAuthToken + "-listener=name=metrics,serves=health+metrics+metrics-detail,address=${udsPromSocket},tokenFile=${vmListenerTokenFile}" + "-listener=name=grpc,serves=grpc-read+grpc-admin,address=${udsGrpcSocket},tokenFile=${vmListenerTokenFile},adminTokenFile=${vmListenerTokenFile}" "-listenerAuthFailureJitterMin" "0s" "-listenerAuthFailureJitterMax" @@ -2999,10 +2996,6 @@ in }) (lib.mkIf isUdsSecurity { environment = { - PROM_LISTEN_NETWORK = "unix"; - PROM_LISTEN = udsPromSocket; - LISTENER_AUTH_MODE = "raw"; - LISTENER_RAW_TOKEN = udsAuthToken; LISTENER_AUTH_FAILURE_JITTER_MIN = "0s"; LISTENER_AUTH_FAILURE_JITTER_MAX = "0s"; }; @@ -3051,6 +3044,11 @@ in }; }; + environment.etc."xtcp2/listener-token" = { + text = vmListenerToken; + mode = "0600"; + }; + services.getty.autologinUser = "root"; systemd.enableEmergencyMode = false; @@ -3072,121 +3070,124 @@ in package = xtcp2Package; configFile = vmConfig; extraArgs = - if isCoverage then - xtcp2CoverageArgs - else if isClickPipeRate then - # Rate test: kafka pipeline with poll jitter disabled for a - # deterministic per-window poll count (see xtcp2ClickPipeRateArgs). - xtcp2ClickPipeRateArgs - else if isClickHttp then - # Direct HTTP→ClickHouse: insert straight into CH over HTTP, - # bypassing Kafka (must come before isAnyClickPipe, which it is - # a member of, so it doesn't fall into the kafka-dest branch). - xtcp2ClickHttpArgs - else if isClickPipeStress then - # Kafka pipeline + container-id resolution (before isAnyClickPipe). - xtcp2ClickPipeStressArgs - else if isClickPipe then - # Plain kafka pipeline + metadata enrichment (container/nic/lldp/ - # nsid). Enrichers are best-effort; the ENRICH_* self-test checks - # assert they reach ClickHouse. Must precede isAnyClickPipe (of - # which isClickPipe is a member). - xtcp2ClickPipeEnrichArgs - else if isAnyClickPipe then - # Phase E: produce to redpanda → clickhouse via kafka dest. - # The mixed flavor uses these args for its primary xtcp2 - # instance (kafka path); a second instance writing parquet - # is declared separately below. - xtcp2ClickPipeArgs - else if isS3Parquet then - # s3parquet lifecycle flavor: 1 MiB flush threshold so the - # 90 s boot exercise triggers a finalize+upload. - xtcp2S3ParquetArgs - else if isS3ParquetLong || isCapCheckFail then - # s3parquet-long flavor: production 63 MiB flush threshold, - # 10 s polling. Pairs with mkS3ParquetRunner. - # capcheck-fail reuses the same args (so the daemon's - # config is otherwise valid; the capability check is the - # only thing that fails). - xtcp2S3ParquetLongArgs - else if isS3ParquetStress then - # s3parquet-stress flavor: production parquet config under the - # tcp-stress load containers. Pairs with mkS3ParquetStressRunner. - xtcp2S3ParquetStressArgs - else if isS3ParquetLowfreq then - # s3parquet-lowfreq: 1h poll + 2 sockets/container — timer-only - # parquet flush. Reuses mkS3ParquetStressRunner. - xtcp2S3ParquetLowfreqArgs - else if isValkey then - # valkey flavor: PUBLISH each poll's records to the in-VM Valkey - # pub/sub channel; the self-test's subscriber counts deliveries. - xtcp2ValkeyArgs - else if isNats then - # nats flavor: PUBLISH each poll's records to the in-VM NATS - # subject; the self-test's subscriber counts deliveries. - xtcp2NatsArgs - else if isNsq then - # nsq flavor: PUBLISH each poll's records to the in-VM nsqd topic; - # the self-test reads nsqd's per-channel finish_count. - xtcp2NsqArgs - else if isInterfaceNaming then - # interface-naming: jsonl to a file (so the IFNAME check can read - # the enrich_socket_*_ifname fields) + the locality enricher, kept - # current by -localityEvents. The 10m refresh is only the - # listener's backstop, so it never runs inside the self-test: a - # change xtcp2 sees (the veths if it raced ahead, the - # LOCALITY_EVENTS check's address) has to come from the listener. - # -enrichAsn against the collector-produced artifact; the 5s - # -asnRefreshInterval is what picks the late-arriving file up (see - # asnDbPath above). - ( - xtcp2FileArgs - ++ [ - "-enrichLocality" - "-localityEvents" - "-localityRefreshInterval" - "10m" - "-enrichAsn" - "-asnDbPath" - asnDbPath - "-asnRefreshInterval" - "5s" - "-ipmetaBootstrapPath" - "" - "-ipmetaCachePath" - asnCachePath - ] - ) - else if isIpmetaBootstrap then - ( + ( + if isCoverage then + xtcp2CoverageArgs + else if isClickPipeRate then + # Rate test: kafka pipeline with poll jitter disabled for a + # deterministic per-window poll count (see xtcp2ClickPipeRateArgs). + xtcp2ClickPipeRateArgs + else if isClickHttp then + # Direct HTTP→ClickHouse: insert straight into CH over HTTP, + # bypassing Kafka (must come before isAnyClickPipe, which it is + # a member of, so it doesn't fall into the kafka-dest branch). + xtcp2ClickHttpArgs + else if isClickPipeStress then + # Kafka pipeline + container-id resolution (before isAnyClickPipe). + xtcp2ClickPipeStressArgs + else if isClickPipe then + # Plain kafka pipeline + metadata enrichment (container/nic/lldp/ + # nsid). Enrichers are best-effort; the ENRICH_* self-test checks + # assert they reach ClickHouse. Must precede isAnyClickPipe (of + # which isClickPipe is a member). + xtcp2ClickPipeEnrichArgs + else if isAnyClickPipe then + # Phase E: produce to redpanda → clickhouse via kafka dest. + # The mixed flavor uses these args for its primary xtcp2 + # instance (kafka path); a second instance writing parquet + # is declared separately below. + xtcp2ClickPipeArgs + else if isS3Parquet then + # s3parquet lifecycle flavor: 1 MiB flush threshold so the + # 90 s boot exercise triggers a finalize+upload. + xtcp2S3ParquetArgs + else if isS3ParquetLong || isCapCheckFail then + # s3parquet-long flavor: production 63 MiB flush threshold, + # 10 s polling. Pairs with mkS3ParquetRunner. + # capcheck-fail reuses the same args (so the daemon's + # config is otherwise valid; the capability check is the + # only thing that fails). + xtcp2S3ParquetLongArgs + else if isS3ParquetStress then + # s3parquet-stress flavor: production parquet config under the + # tcp-stress load containers. Pairs with mkS3ParquetStressRunner. + xtcp2S3ParquetStressArgs + else if isS3ParquetLowfreq then + # s3parquet-lowfreq: 1h poll + 2 sockets/container — timer-only + # parquet flush. Reuses mkS3ParquetStressRunner. + xtcp2S3ParquetLowfreqArgs + else if isValkey then + # valkey flavor: PUBLISH each poll's records to the in-VM Valkey + # pub/sub channel; the self-test's subscriber counts deliveries. + xtcp2ValkeyArgs + else if isNats then + # nats flavor: PUBLISH each poll's records to the in-VM NATS + # subject; the self-test's subscriber counts deliveries. + xtcp2NatsArgs + else if isNsq then + # nsq flavor: PUBLISH each poll's records to the in-VM nsqd topic; + # the self-test reads nsqd's per-channel finish_count. + xtcp2NsqArgs + else if isInterfaceNaming then + # interface-naming: jsonl to a file (so the IFNAME check can read + # the enrich_socket_*_ifname fields) + the locality enricher, kept + # current by -localityEvents. The 10m refresh is only the + # listener's backstop, so it never runs inside the self-test: a + # change xtcp2 sees (the veths if it raced ahead, the + # LOCALITY_EVENTS check's address) has to come from the listener. + # -enrichAsn against the collector-produced artifact; the 5s + # -asnRefreshInterval is what picks the late-arriving file up (see + # asnDbPath above). + ( + xtcp2FileArgs + ++ [ + "-enrichLocality" + "-localityEvents" + "-localityRefreshInterval" + "10m" + "-enrichAsn" + "-asnDbPath" + asnDbPath + "-asnRefreshInterval" + "5s" + "-ipmetaBootstrapPath" + "" + "-ipmetaCachePath" + asnCachePath + ] + ) + else if isIpmetaBootstrap then + ( + xtcp2FileArgs + ++ [ + "-enrichAsn" + "-asnDbPath" + ipmetaDbPath + "-asnRefreshInterval" + "5s" + "-ipmetaBootstrapPath" + ipmetaBootstrapPath + "-ipmetaCachePath" + ipmetaCachePath + ] + ) + else if isMinimal then + # minimal (lifecycle) writes jsonl to a file so OUTPUT_CONTENT + # can validate the daemon's serialized output. xtcp2FileArgs - ++ [ - "-enrichAsn" - "-asnDbPath" - ipmetaDbPath - "-asnRefreshInterval" - "5s" - "-ipmetaBootstrapPath" - ipmetaBootstrapPath - "-ipmetaCachePath" - ipmetaCachePath - ] - ) - else if isMinimal then - # minimal (lifecycle) writes jsonl to a file so OUTPUT_CONTENT - # can validate the daemon's serialized output. - xtcp2FileArgs - else if isUdsSecurity then - xtcp2UdsSecurityArgs - else if isSocketSink then - # socket-sink: stream jsonl over the raw tcp/udp/unix/unixgram - # dest to the ncat sink. - xtcp2SocketSinkArgs - else - # Soak reuses the basic args (`-dest null`, fast frequency). - # The point of soak is namespace + netlink churn, not - # downstream destination throughput. - xtcp2BasicArgs; + else if isUdsSecurity then + xtcp2UdsSecurityArgs + else if isSocketSink then + # socket-sink: stream jsonl over the raw tcp/udp/unix/unixgram + # dest to the ncat sink. + xtcp2SocketSinkArgs + else + # Soak reuses the basic args (`-dest null`, fast frequency). + # The point of soak is namespace + netlink churn, not + # downstream destination throughput. + xtcp2BasicArgs + ) + ++ lib.optionals (!isUdsSecurity) (mkTcpListenerArgs cfg.promPort cfg.grpcPort); # capcheck-fail intentionally drops CAP_SYS_ADMIN. Anything # else gets the default full set. capabilities = lib.mkIf isCapCheckFail [ @@ -3781,6 +3782,9 @@ in scrapeConfigs = [ { job_name = "xtcp2"; + # The test token inline: the prometheus user cannot read the + # root-only token file. + authorization.credentials = vmListenerToken; static_configs = [ { targets = [ "127.0.0.1:${toString cfg.promPort}" ]; diff --git a/nix/microvms/self-test.nix b/nix/microvms/self-test.nix index 79a6e8a4a..d767e441d 100644 --- a/nix/microvms/self-test.nix +++ b/nix/microvms/self-test.nix @@ -206,8 +206,12 @@ # raw bearer authentication, including negative unauthenticated requests. runUdsSecurityCheck ? false, udsGrpcSocket ? "/run/xtcp2/grpc.sock", - udsPromSocket ? "/run/xtcp2/prometheus.sock", + udsPromSocket ? "/run/xtcp2/metrics.sock", udsAuthToken ? "", + # The token every guest listener checks (mkVm.nix writes it). Each scrape + # and client call sends it explicitly, so the unauthenticated negatives + # stay meaningful. + listenerTokenFile ? "/etc/xtcp2/listener-token", # When true (socket-sink flavors), the RAW_SOCKET check validates the records # xtcp2 streamed over the raw socket destination (tcp/udp/unix/unixgram) to # the in-VM ncat receiver (written to socketSinkFile), and the per-scheme @@ -383,6 +387,9 @@ pkgs.writeShellApplication { ${import ./self-test-wait-metric.nix} uds_security_mode=${if runUdsSecurityCheck then "1" else "0"} + # The TCP listeners check the guest's test token (mkVm.nix). + prom_auth=(-H "Authorization: Bearer $(cat ${listenerTokenFile} 2>/dev/null)") + grpc_tcp=(-network tcp -target 127.0.0.1 -port "${toString grpcPort}" -auth-token-file ${listenerTokenFile}) echo "================================================" echo " xtcp2 microvm self-test" @@ -404,7 +411,7 @@ pkgs.writeShellApplication { local name="$1" local label_a="$2" local label_b="''${3:-}" - metric_curl_args=() + metric_curl_args=("''${prom_auth[@]}") metric_url="http://127.0.0.1:${toString promPort}/metrics" if [ "$uds_security_mode" -eq 1 ]; then metric_curl_args=(--unix-socket "${udsPromSocket}" -H "Authorization: Bearer ${udsAuthToken}") @@ -447,7 +454,7 @@ pkgs.writeShellApplication { check2=0 else for i in $(seq 1 "$(scaled 30)"); do - if curl --silent --fail --max-time 2 \ + if curl --silent --fail --max-time 2 "''${prom_auth[@]}" \ "http://127.0.0.1:${toString promPort}/metrics" \ | grep -q '^xtcp_'; then echo "XTCP2_SELF_TEST_METRICS_PASS (after ''${i}s)" @@ -560,7 +567,7 @@ pkgs.writeShellApplication { # for "it connected"; anything else is a wire/handshake failure. # xtcp2client takes -target (host) + -port (numeric), not -addr. stream_until "$(scaled 3)" /tmp/xtcp2client.log . \ - xtcp2client -target 127.0.0.1 -port "${toString grpcPort}" + xtcp2client "''${grpc_tcp[@]}" rc=$? if [ "$rc" -eq 0 ] || [ "$rc" -eq 124 ]; then if [ -s /tmp/xtcp2client.log ]; then @@ -596,8 +603,7 @@ pkgs.writeShellApplication { elif command -v xtcp2client >/dev/null 2>&1; then before_pfr=$(metric_value "xtcp_counts" 'function="flatRecordServiceSend"' 'variable="pfrSent"') stream_until "$(scaled 12)" /tmp/xtcp2poll.log '^\{' \ - xtcp2client -poll -pollFrequency 2s -format json \ - -target 127.0.0.1 -port "${toString grpcPort}" + xtcp2client -poll -pollFrequency 2s -format json "''${grpc_tcp[@]}" rc=$? after_pfr=$(metric_value "xtcp_counts" 'function="flatRecordServiceSend"' 'variable="pfrSent"') # Records are single-line JSON objects (printer.record); client debug @@ -631,15 +637,17 @@ pkgs.writeShellApplication { echo "XTCP2_SELF_TEST_HEALTH_PASS (covered by authenticated UDS check)" check5c=0 else - hz=$(curl -s -o /dev/null -w '%{http_code}' --max-time 3 \ + hz=$(curl -s -o /dev/null -w '%{http_code}' --max-time 3 "''${prom_auth[@]}" \ "http://127.0.0.1:${toString promPort}/healthz" 2>/dev/null || echo 000) - rz=$(curl -s -o /dev/null -w '%{http_code}' --max-time 3 \ + rz=$(curl -s -o /dev/null -w '%{http_code}' --max-time 3 "''${prom_auth[@]}" \ "http://127.0.0.1:${toString promPort}/readyz" 2>/dev/null || echo 000) # -healthcheck probes /readyz itself and exits 0 (ready) / 1 (not); it does - # NOT start the daemon. Uses -promListen to find the port. + # NOT start the daemon. It finds the health listener from -listener, as + # the daemon does, and sends its token. hc_rc=1 if command -v xtcp2 >/dev/null 2>&1; then - xtcp2 -healthcheck -promListen "127.0.0.1:${toString promPort}" \ + xtcp2 -healthcheck \ + -listener "name=prometheus,serves=health,address=127.0.0.1:${toString promPort},network=tcp,tokenFile=${listenerTokenFile}" \ >/tmp/xtcp2-healthcheck.log 2>&1 hc_rc=$? fi @@ -701,8 +709,7 @@ pkgs.writeShellApplication { elif command -v xtcp2client >/dev/null 2>&1; then before_fr=$(metric_value "xtcp_counts" 'function="flatRecordServiceSend"' 'variable="frSent"') stream_until "$(scaled 12)" /tmp/xtcp2listen.log '^\{' \ - xtcp2client -format json \ - -target 127.0.0.1 -port "${toString grpcPort}" + xtcp2client -format json "''${grpc_tcp[@]}" rc=$? after_fr=$(metric_value "xtcp_counts" 'function="flatRecordServiceSend"' 'variable="frSent"') recs=$(grep -c '^{' /tmp/xtcp2listen.log 2>/dev/null || true) @@ -864,7 +871,7 @@ pkgs.writeShellApplication { ${lib.optionalString (runInterfaceNamingCheck || runAsnCheck) '' enricherCompiledIn() { local want="$1" line - line=$(curl -sf "http://127.0.0.1:${toString promPort}/metrics" 2>/dev/null \ + line=$(curl -sf "''${prom_auth[@]}" "http://127.0.0.1:${toString promPort}/metrics" 2>/dev/null \ | grep -E "^xtcp_gauges\{[^}]*variable=\"compiledInEnrichers\"[^}]*type=\"$want\"[^}]*\} " \ | tail -1) if [ -z "$line" ]; then @@ -995,7 +1002,7 @@ pkgs.writeShellApplication { fetchRetryOk=1 fi echo "--- daemon loadAsn / refreshAsn metrics ---" - asn_metrics=$(curl -sf "http://127.0.0.1:${toString promPort}/metrics" 2>/dev/null || true) + asn_metrics=$(curl -sf "''${prom_auth[@]}" "http://127.0.0.1:${toString promPort}/metrics" 2>/dev/null || true) grep -E 'loadAsn|refreshAsn|initAsnEnricher' <<<"$asn_metrics" || echo "(no asn metrics yet)" asn_prefixes=$(grep -E '^xtcp_gauges\{[^}]*function="loadAsn"[^}]*variable="prefixes"[^}]*\} ' <<<"$asn_metrics" \ | awk '{print $2}' | head -1) @@ -1048,7 +1055,7 @@ pkgs.writeShellApplication { ${lib.optionalString runLocalityEventsCheck '' echo "--- check: locality events (${localityEventsIf} += 203.0.113.1/24) ---" checkLe=1 - le_metrics() { curl -sf "http://127.0.0.1:${toString promPort}/metrics" 2>/dev/null || true; } + le_metrics() { curl -sf "''${prom_auth[@]}" "http://127.0.0.1:${toString promPort}/metrics" 2>/dev/null || true; } le_start=0 for _ in $(seq 1 "$(scaled 20)"); do le_start=$(le_metrics | grep -E '^xtcp_counts\{[^}]*function="localityListener"[^}]*type="start"[^}]*variable="snapshot"[^}]*\} ' \ @@ -1178,7 +1185,7 @@ pkgs.writeShellApplication { fi sleep 2 done - asn_metrics=$(curl -sf "http://127.0.0.1:${toString promPort}/metrics" 2>/dev/null || true) + asn_metrics=$(curl -sf "''${prom_auth[@]}" "http://127.0.0.1:${toString promPort}/metrics" 2>/dev/null || true) ipmeta_prefixes=$(grep -E '^xtcp_gauges\{[^}]*function="loadAsn"[^}]*variable="prefixes"[^}]*\} ' <<<"$asn_metrics" \ | awk '{print $2}' | head -1) if [ "$check5h_recovery" -eq 0 ] && [ "$ipmeta_prefixes" = "${ipmetaExpectedPrefixes}" ]; then @@ -2109,7 +2116,7 @@ pkgs.writeShellApplication { -lldpdVersionHint 1.0.22 \ -enrichContainer -dockerSocket /nonexistent/xtcp2-bogus-docker.sock \ -enrichNic \ - -promListen "$neg_prom" -grpcPort 8899 \ + -listener "name=neg,serves=health+metrics,address=$neg_prom,network=tcp,auth=disabled" \ >/tmp/xtcp2-enrich-neg.log 2>&1 & neg_pid=$! neg_up=0 @@ -2183,7 +2190,7 @@ pkgs.writeShellApplication { if [ "$uds_security_mode" -eq 1 ]; then CTL=(-network unix -unixSocket "${udsGrpcSocket}" -auth-token "${udsAuthToken}") else - CTL=(-target 127.0.0.1 -port ${toString grpcPort}) + CTL=("''${grpc_tcp[@]}") fi echo "--- check 17: xtcp2ctl set-poll-frequency (hot change, no restart) ---" diff --git a/nix/modules/xtcp2-service.nix b/nix/modules/xtcp2-service.nix index 2ec37f830..55e49a692 100644 --- a/nix/modules/xtcp2-service.nix +++ b/nix/modules/xtcp2-service.nix @@ -27,9 +27,38 @@ let "-linkMonitorCollectionMode=${lm.collectionMode}" "-linkMonitorIPPaths=${lib.boolToString lm.ipPaths}" ] - ++ lib.optional (lm.ipListen != null) "-linkMonitorIPListen=${lm.ipListen}" ++ lm.extraArgs ); + + # The listeners, passed as LISTENERS so `xtcp2 -healthcheck` run with the + # unit's environment finds the same ones. Empty leaves the daemon's + # default: health, metrics and metrics-detail on /run/xtcp2/metrics.sock. + # linkMonitor.ipPaths and ipListen add the ip class: on the default + # socket, or on a loopback listener of its own. + serveIP = lm.enable && lm.ipPaths; + defaultListener = "name=metrics,serves=health+metrics+metrics-detail${ + lib.optionalString (serveIP && lm.ipListen == null) "+ip" + },address=/run/xtcp2/metrics.sock"; + ipListener = lib.optional ( + serveIP && lm.ipListen != null + ) "name=ip,serves=ip,address=${lm.ipListen},network=tcp,auth=disabled"; + listeners = + if cfg.listeners != [ ] then + cfg.listeners ++ ipListener + else + lib.optionals serveIP ([ defaultListener ] ++ ipListener); + + generatedTokenFile = "/var/lib/xtcp2/listener-token"; + tokenFile = if cfg.listenerTokenFile != null then cfg.listenerTokenFile else generatedTokenFile; + # A random token, written once: it survives restarts, so scrapers keep + # working, and is replaced only by deleting the file. + generateToken = pkgs.writeShellScript "xtcp2-listener-token" '' + if [ ! -s ${generatedTokenFile} ]; then + umask 077 + ${pkgs.coreutils}/bin/head -c 32 /dev/urandom | ${pkgs.coreutils}/bin/base64 -w0 >${generatedTokenFile}.new + ${pkgs.coreutils}/bin/mv ${generatedTokenFile}.new ${generatedTokenFile} + fi + ''; in { options.services.xtcp2 = { @@ -70,6 +99,34 @@ in ''; }; + listeners = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + example = [ + "name=metrics,serves=health+metrics+metrics-detail,address=/run/xtcp2/metrics.sock" + "name=grpc,serves=grpc-read+grpc-admin,address=/run/xtcp2/grpc.sock,adminTokenFile=/run/secrets/xtcp2-admin" + ]; + description = '' + xtcp2's listeners, one `-listener` spec each (`xtcp2 -help` has the + syntax; docs/security.md#listeners the rules). Empty serves health, + metrics and metrics-detail on /run/xtcp2/metrics.sock (mode 0600), + with the token from `listenerTokenFile`. gRPC, pprof and /ip are + served only by a listener that names them. + ''; + }; + + listenerTokenFile = lib.mkOption { + type = lib.types.nullOr lib.types.str; + default = null; + example = "/run/secrets/xtcp2-listener-token"; + description = '' + File holding the bearer token for listeners without a tokenFile of + their own (LISTENER_RAW_TOKEN_FILE), readable only by the service + user. null generates a random one once, at + /var/lib/xtcp2/listener-token (0600). + ''; + }; + linkMonitor = { enable = lib.mkOption { type = lib.types.bool; @@ -111,9 +168,10 @@ in type = lib.types.bool; default = false; description = '' - Serve the read-only `ip … show` paths under /ip and /i on the - Prometheus listener, or on `ipListen`. They expose host addresses, - so they are off by default. + Serve the read-only `ip … show` paths under /ip and /i: on the + default socket, or on `ipListen`. With `listeners` set, add the ip + class to one of them (or set `ipListen`). They expose host + addresses, so they are off by default. ''; }; @@ -123,10 +181,10 @@ in example = "127.0.0.1:9089"; description = '' A loopback host:port serving /ip and /i on a listener of their own, - without listener auth, instead of on the Prometheus listener. Needs - `ipPaths`. xtcp2 refuses a host that is not a loopback IP literal, - and closes connections from non-loopback source addresses. null - keeps one listener. + without listener auth. Needs `ipPaths`. xtcp2 refuses a host that + is not a loopback IP literal, and closes connections from + non-loopback source addresses. null serves them on the default + socket. ''; }; @@ -170,7 +228,20 @@ in }; config = lib.mkIf cfg.enable { + assertions = [ + { + assertion = lm.ipListen == null || lm.ipPaths; + message = "services.xtcp2.linkMonitor.ipListen needs linkMonitor.ipPaths"; + } + ]; + systemd.services.xtcp2 = { + environment = { + LISTENER_RAW_TOKEN_FILE = lib.mkDefault tokenFile; + } + // lib.optionalAttrs (listeners != [ ]) { + LISTENERS = lib.concatStringsSep ";" listeners; + }; description = "xtcp2 — TCP socket introspection via netlink"; after = [ "network-online.target" ]; wants = [ "network-online.target" ]; @@ -188,6 +259,7 @@ in # `extraArgs` (CLI flags) instead. configFile is kept in the option # surface for forward-compatibility — when the daemon learns to # parse a JSON config, flip this back to `-config ${cfg.configFile}`. + ExecStartPre = lib.mkIf (cfg.listenerTokenFile == null) [ "${generateToken}" ]; ExecStart = xtcp2Exec.mkExecStart cfg.package (linkMonitorArgs ++ cfg.extraArgs); # `systemctl reload xtcp2` asks the link monitor to relearn the # expected up-link count, as SIGUSR1 does for go-link-monitor. diff --git a/nix/tests/xtcp2-ip-listen.nix b/nix/tests/xtcp2-ip-listen.nix index afc51a4af..53c9129a8 100644 --- a/nix/tests/xtcp2-ip-listen.nix +++ b/nix/tests/xtcp2-ip-listen.nix @@ -1,7 +1,7 @@ -# The /ip paths on a loopback listener of their own (-linkMonitorIPListen): -# the real xtcp2 unit from nix/modules/xtcp2-service.nix in a disposable -# guest, with raw listener auth on the Prometheus listener and /ip moved to -# 127.0.0.1:9089. The guest checks, in order, each with a sentinel: +# The /ip paths on a loopback listener of their own (linkMonitor.ipListen, +# an ip-class listener): the real xtcp2 unit from +# nix/modules/xtcp2-service.nix in a disposable guest, with a raw-token +# Prometheus listener on :9088 and /ip on 127.0.0.1:9089. The guest checks, in order, each with a sentinel: # SPLIT /ip and /i answer on 9089 without a token; 9089 serves nothing # else; 9088 still needs the token and no longer serves /ip # BIND 9089 is bound on 127.0.0.1 only @@ -132,7 +132,7 @@ let echo "XTCP2_IP_LISTEN_ROW_FAIL a non-loopback peer got $got from /ip" false fi - logged() { journalctl -u xtcp2 --no-pager | grep -q 'ip listener: closed .* from non-loopback peers, last from 10.77.0.2:'; } + logged() { journalctl -u xtcp2 --no-pager | grep -q 'listener "ip": closed .* from non-loopback peers, last from 10.77.0.2:'; } until_ok 10 logged kill "$control" # Loopback still works after the rejects. @@ -187,16 +187,15 @@ let "-dest" "null" ]; + listeners = [ + "name=prometheus,serves=health+metrics+metrics-detail,address=:9088,network=tcp,tokenFile=${readToken}" + ]; linkMonitor = { ipPaths = true; ipListen = "127.0.0.1:9089"; extraArgs = [ "-linkMonitorSettle=2s" ]; }; }; - systemd.services.xtcp2.environment = { - LISTENER_AUTH_MODE = "raw"; - LISTENER_RAW_TOKEN_FILE = readToken; - }; systemd.services.xtcp2-ip-listen = { wantedBy = [ "multi-user.target" ]; after = [ "xtcp2.service" ]; diff --git a/nix/tests/xtcp2-linkmonitor.nix b/nix/tests/xtcp2-linkmonitor.nix index 95131a30e..b3f77dc6f 100644 --- a/nix/tests/xtcp2-linkmonitor.nix +++ b/nix/tests/xtcp2-linkmonitor.nix @@ -1,6 +1,7 @@ # The link monitor inside xtcp2 (docs/design-linkmonitor-in-xtcp2.md): the # real xtcp2 unit from nix/modules/xtcp2-service.nix in a disposable guest, -# with the monitor on by default. The guest checks, in order, each with a +# with the monitor on by default, scraped where the module's defaults put it: +# the default socket, with the token the unit generated. The guest checks, in order, each with a # sentinel: # PATHS /metrics carries the summary, the detail paths serve, /ip is off # BASELINE the baseline file appears 0600 in a 0750 /var/lib/xtcp2 @@ -21,7 +22,8 @@ xtcp2, }: let - url = "http://127.0.0.1:9088"; + socket = "/run/xtcp2/metrics.sock"; + tokenFile = "/var/lib/xtcp2/listener-token"; baseline = "/var/lib/xtcp2/link-monitor-baseline.json"; guestTest = pkgs.writeShellApplication { name = "xtcp2-linkmonitor-guest"; @@ -35,7 +37,9 @@ let ]; text = '' trap 'echo XTCP2_LINKMONITOR_FAIL; journalctl -u xtcp2 --no-pager | tail -n 80; systemctl poweroff --no-block' ERR - code() { curl -s -o /dev/null -w '%{http_code}' "${url}$1"; } + # The token the unit generates on first start. + auth() { printf 'Authorization: Bearer %s' "$(cat ${tokenFile} 2>/dev/null)"; } + code() { curl -s -o /dev/null -w '%{http_code}' --unix-socket ${socket} -H "$(auth)" "http://xtcp2$1"; } expect() { local got got=$(code "$1") @@ -59,7 +63,7 @@ let ready() { [ "$(code /readyz)" = 200 ]; } # The body is read in full first: grep -q exiting early would fail curl # under pipefail. - scrape() { curl -sf "${url}$1"; } + scrape() { curl -sf --unix-socket ${socket} -H "$(auth)" "http://xtcp2$1"; } metric() { local body body=$(scrape /metrics) || return 1 diff --git a/nix/tests/xtcp2-scrape-auth.nix b/nix/tests/xtcp2-scrape-auth.nix index 6f717553c..af24d2379 100644 --- a/nix/tests/xtcp2-scrape-auth.nix +++ b/nix/tests/xtcp2-scrape-auth.nix @@ -11,8 +11,9 @@ # pprof; the admin token reaches pprof # VMAGENT the credentials_file job is up; a job with no token and one # with a wrong token are down with 401 -# HEALTHCHECK `xtcp2 -healthcheck` with the unit's env exits 0, with no -# token env or a wrong token it exits 1 +# HEALTHCHECK `xtcp2 -healthcheck` with the unit's LISTENERS exits 0; +# without it (the default socket, absent here) or with a +# wrong token file it exits 1 # ROTATE new tokens written for both: vmagent's job goes down against # the old xtcp2 within seconds, then up after `systemctl # restart xtcp2`, with vmagent's MainPID unchanged; the old @@ -34,12 +35,11 @@ let # vmagent's own copy, as ansible-host puts one under /opt/vmagent. vmagentToken = "/etc/vmagent/xtcp2_read_token"; scrapeGroup = "xtcp2scrape"; - listenerEnv = { - LISTENER_AUTH_MODE = "raw"; - LISTENER_RAW_TOKEN_FILE = readToken; - LISTENER_ADMIN_AUTH_MODE = "raw"; - LISTENER_ADMIN_RAW_TOKEN_FILE = adminToken; - }; + # One TCP listener: the read token for metrics and health, the admin + # token for pprof. + listenerSpec = + tokenFile: + "name=prometheus,serves=health+metrics+metrics-detail+debug,address=:9088,network=tcp,tokenFile=${tokenFile},adminAuth=raw,adminTokenFile=${adminToken}"; # mint-tokens: fresh random read and admin tokens, written for xtcp2 and # vmagent. vmagent's copy ends in a newline, as a hand-written file would; # xtcp2's do not. @@ -160,14 +160,15 @@ let # HEALTHCHECK: the probe the container HEALTHCHECK runs, with the unit's env. hc() { env "$@" xtcp2 -healthcheck >/dev/null 2>&1; } - hc ${lib.concatStringsSep " " (lib.mapAttrsToList (k: v: "${k}=${v}") listenerEnv)} + hc LISTENERS="${listenerSpec readToken}" if hc; then - echo "XTCP2_SCRAPE_AUTH_ROW_FAIL -healthcheck with no token env exited 0" + echo "XTCP2_SCRAPE_AUTH_ROW_FAIL -healthcheck without LISTENERS exited 0" false fi wrong=$(mktemp) + chmod 0600 "$wrong" printf 'not-the-token' >"$wrong" - if hc LISTENER_AUTH_MODE=raw LISTENER_RAW_TOKEN_FILE="$wrong"; then + if hc LISTENERS="${listenerSpec "$wrong"}"; then echo "XTCP2_SCRAPE_AUTH_ROW_FAIL -healthcheck with a wrong token exited 0" false fi @@ -245,8 +246,8 @@ let "null" ]; linkMonitor.extraArgs = [ "-linkMonitorSettle=2s" ]; + listeners = [ (listenerSpec readToken) ]; }; - systemd.services.xtcp2.environment = listenerEnv; services.vmagent = { enable = true; # Nothing listens here: the check reads vmagent's targets API, diff --git a/pkg/listeners/listeners.go b/pkg/listeners/listeners.go new file mode 100644 index 000000000..59b7b5d74 --- /dev/null +++ b/pkg/listeners/listeners.go @@ -0,0 +1,456 @@ +// Package listeners maps xtcp2's endpoint classes (health, metrics, +// metrics-detail, ip, debug, grpc-read, grpc-admin) onto the listeners that +// serve them, checks the cross-listener rules, and resolves each listener's +// endpoint and credentials. +// +// With no listener configured the daemon serves one Unix socket, +// DefaultSocketPath, mode 0600, with raw bearer auth, carrying health, +// metrics and metrics-detail. gRPC, pprof and /ip are not served unless a +// listener names them. See docs/security.md#listeners. +package listeners + +import ( + "context" + "errors" + "fmt" + "net" + "os" + "path/filepath" + "slices" + "strings" + + "google.golang.org/protobuf/proto" + + "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" + "github.com/randomizedcoder/xtcp2/pkg/listener" + "github.com/randomizedcoder/xtcp2/pkg/listenerauth" +) + +// ErrConfig marks a listener configuration the operator must change. The +// daemon exits with EX_USAGE (64) on it. +var ErrConfig = errors.New("listener configuration") + +const ( + // DefaultName is the default listener's name. + DefaultName = "metrics" + // DefaultSocketPath is the default listener's Unix socket. + DefaultSocketPath = "/run/xtcp2/metrics.sock" + // DefaultGRPCSocketPath is where xtcp2ctl and xtcp2client look for the + // gRPC listener. No gRPC listener runs unless one is configured; this is + // the documented place for it. + DefaultGRPCSocketPath = "/run/xtcp2/grpc.sock" + + // loopbackTTL is the TTL and hop limit of a loopback TCP listener: + // replies never pass a router. + loopbackTTL = 1 +) + +// Class shorthands. +const ( + Health = xtcp_config.EndpointClass_ENDPOINT_CLASS_HEALTH + Metrics = xtcp_config.EndpointClass_ENDPOINT_CLASS_METRICS + MetricsDetail = xtcp_config.EndpointClass_ENDPOINT_CLASS_METRICS_DETAIL + IP = xtcp_config.EndpointClass_ENDPOINT_CLASS_IP + Debug = xtcp_config.EndpointClass_ENDPOINT_CLASS_DEBUG + GRPCRead = xtcp_config.EndpointClass_ENDPOINT_CLASS_GRPC_READ + GRPCAdmin = xtcp_config.EndpointClass_ENDPOINT_CLASS_GRPC_ADMIN +) + +// classNames is the operator-facing name of each class, as used in -listener +// serves= and in errors. +var classNames = map[xtcp_config.EndpointClass]string{ + Health: "health", + Metrics: "metrics", + MetricsDetail: "metrics-detail", + IP: "ip", + Debug: "debug", + GRPCRead: "grpc-read", + GRPCAdmin: "grpc-admin", +} + +// ClassName is the operator-facing name of c. +func ClassName(c xtcp_config.EndpointClass) string { + if n, ok := classNames[c]; ok { + return n + } + return c.String() +} + +// ParseClass parses an operator-facing class name. +func ParseClass(s string) (xtcp_config.EndpointClass, error) { + s = strings.ToLower(strings.TrimSpace(s)) + for c, n := range classNames { + if n == s { + return c, nil + } + } + names := make([]string, 0, len(classNames)) + for _, n := range classNames { + names = append(names, n) + } + slices.Sort(names) + return 0, fmt.Errorf("%w: unknown endpoint class %q; valid: %s", ErrConfig, s, strings.Join(names, ", ")) +} + +// IsGRPC reports whether c is served by the gRPC server rather than HTTP. +func IsGRPC(c xtcp_config.EndpointClass) bool { + return c == GRPCRead || c == GRPCAdmin +} + +// isAdmin reports whether c needs the admin credential. +func isAdmin(c xtcp_config.EndpointClass) bool { + return c == Debug || c == GRPCAdmin +} + +// Default is the listener set used when none is configured. +func Default() []*xtcp_config.Listener { + return []*xtcp_config.Listener{{ + Name: DefaultName, + Endpoint: &xtcp_config.ListenerEndpoint{ + Network: xtcp_config.ListenerNetwork_LISTENER_NETWORK_UNIX, + Address: DefaultSocketPath, + UnixSocketMode: uint32(listener.DefaultUnixSocketMode), + UnlinkStaleUnixSocket: true, + }, + Serves: []xtcp_config.EndpointClass{Health, Metrics, MetricsDetail}, + }} +} + +// Effective is c's listeners, or Default when it configures none. +func Effective(c *xtcp_config.XtcpConfig) []*xtcp_config.Listener { + if ls := c.GetListeners(); len(ls) > 0 { + return ls + } + return Default() +} + +// network resolves a listener's network: explicit, or unix when the address +// is an absolute path. A TCP address must be typed (network: tcp), so a +// listener never lands on a network interface by accident. +func network(l *xtcp_config.Listener) (string, error) { + ep := l.GetEndpoint() + switch ep.GetNetwork() { + case xtcp_config.ListenerNetwork_LISTENER_NETWORK_TCP: + return listener.NetworkTCP, nil + case xtcp_config.ListenerNetwork_LISTENER_NETWORK_UNIX: + return listener.NetworkUnix, nil + case xtcp_config.ListenerNetwork_LISTENER_NETWORK_UNSPECIFIED: + // Inferred from the address, below. + } + if filepath.IsAbs(ep.GetAddress()) { + return listener.NetworkUnix, nil + } + return "", fmt.Errorf("%w: listener %q: address %q is not a socket path; set network=tcp to listen on TCP", + ErrConfig, l.GetName(), ep.GetAddress()) +} + +// effectiveAuth is the listener's credential, or the daemon-wide one when it +// has none. An unspecified mode follows the credential given (an HMAC key +// file means hmac-utc-minute), and is otherwise raw: disabled has to be +// typed. +func effectiveAuth(l, global *xtcp_config.ListenerAuth) *xtcp_config.ListenerAuth { + out := pick(l, global) + if out.GetMode() == xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_UNSPECIFIED { + out.Mode = inferredMode(out) + if out.Mode == xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_UNSPECIFIED { + out.Mode = xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN + } + } + return out +} + +// effectiveAdminAuth is the listener's admin credential, or the daemon-wide +// one. An unspecified mode follows the credential given; with none there is +// no admin credential. +func effectiveAdminAuth(l, global *xtcp_config.ListenerAuth) *xtcp_config.ListenerAuth { + out := pick(l, global) + if out.GetMode() == xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_UNSPECIFIED { + out.Mode = inferredMode(out) + } + return out +} + +// pick is a copy of the listener's credential, or of the daemon-wide one. +func pick(l, global *xtcp_config.ListenerAuth) *xtcp_config.ListenerAuth { + a := l + if a == nil { + a = global + } + if a == nil { + return &xtcp_config.ListenerAuth{} + } + return proto.CloneOf(a) +} + +// inferredMode is the mode a credential implies: hmac-utc-minute for an HMAC +// key alone, raw for a token, unspecified for neither. +func inferredMode(a *xtcp_config.ListenerAuth) xtcp_config.ListenerAuthMode { + hasToken := a.GetRawToken() != "" || a.GetRawTokenFile() != "" + hasKey := a.GetHmacSharedKey() != "" || a.GetHmacSharedKeyFile() != "" + switch { + case hasKey && !hasToken: + return xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_HMAC_UTC_MINUTE + case hasToken: + return xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN + default: + return xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_UNSPECIFIED + } +} + +func enabled(a *xtcp_config.ListenerAuth) bool { + m := a.GetMode() + return m != xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_UNSPECIFIED && + m != xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_DISABLED +} + +// isLoopbackTCP reports whether a TCP address is a loopback IP literal. +func isLoopbackTCP(address string) bool { + _, err := listener.ParseLoopback(address) + return err == nil +} + +// Validate checks c's effective listeners against the rules that span +// listeners and classes. It reads no files and binds nothing, so +// ConfigService.Set can run it too. Warnings are returned for allowed but +// notable shapes (auth disabled on a loopback TCP listener). +func Validate(c *xtcp_config.XtcpConfig) (warnings []string, err error) { + ls := Effective(c) + owner := map[xtcp_config.EndpointClass]string{} + names := map[string]bool{} + var errs []error + for _, l := range ls { + w, e := validateOne(c, l, owner, names) + warnings = append(warnings, w...) + errs = append(errs, e...) + } + return warnings, errors.Join(errs...) +} + +func validateOne(c *xtcp_config.XtcpConfig, l *xtcp_config.Listener, owner map[xtcp_config.EndpointClass]string, names map[string]bool) (warnings []string, errs []error) { + name := l.GetName() + fail := func(format string, args ...any) { + errs = append(errs, fmt.Errorf("%w: listener %q: "+format, append([]any{ErrConfig, name}, args...)...)) + } + if names[name] { + fail("name used by more than one listener") + } + names[name] = true + if len(l.GetServes()) == 0 { + fail("serves no endpoint class") + } + var grpc, http, adminOnly = false, false, true + for _, cl := range l.GetServes() { + if prev, ok := owner[cl]; ok && prev != name { + fail("class %s is also served by listener %q; a class is served by one listener", ClassName(cl), prev) + } + owner[cl] = name + if IsGRPC(cl) { + grpc = true + } else { + http = true + } + if !isAdmin(cl) { + adminOnly = false + } + if cl == IP && !c.GetLinkMonitor().GetIpPaths() { + fail("serves ip, which needs -linkMonitorIPPaths") + } + } + if grpc && http { + fail("mixes gRPC and HTTP classes; put them on separate listeners") + } + for _, a := range []*xtcp_config.ListenerAuth{l.GetAuth(), l.GetAdminAuth()} { + if a.GetRawToken() != "" || a.GetHmacSharedKey() != "" { + fail("carries a credential inline; use raw_token_file / hmac_shared_key_file (tokenFile= / hmacKeyFile=)") + } + } + + nw, err := network(l) + if err != nil { + errs = append(errs, err) + return warnings, errs + } + auth := effectiveAuth(l.GetAuth(), c.GetListenerAuth()) + admin := effectiveAdminAuth(l.GetAdminAuth(), c.GetAdminListenerAuth()) + healthOnly := len(l.GetServes()) == 1 && l.GetServes()[0] == Health + loopback := nw == listener.NetworkTCP && isLoopbackTCP(l.GetEndpoint().GetAddress()) + if !enabled(auth) { + switch { + case nw == listener.NetworkUnix, healthOnly: + case loopback: + warnings = append(warnings, fmt.Sprintf("listener %q: auth disabled on loopback TCP %s; any local process can reach it", + name, l.GetEndpoint().GetAddress())) + default: + fail("auth disabled on TCP %s; disabled auth is allowed only on a Unix socket, a loopback address, or a listener serving health alone", + l.GetEndpoint().GetAddress()) + } + } + for _, cl := range l.GetServes() { + if !isAdmin(cl) || enabled(admin) || (adminOnly && enabled(auth)) { + continue + } + fail("serves %s, which needs an admin credential: set admin_auth (adminAuth=, adminTokenFile=) or "+ + "-listenerAdminAuthMode, or serve only admin classes on a listener with auth", ClassName(cl)) + } + return warnings, errs +} + +// Spec is a validated listener with its endpoint and credentials resolved. +type Spec struct { + Name string + Endpoint listener.Endpoint + // Auth and AdminAuth carry the secrets read from their files. + Auth, AdminAuth *xtcp_config.ListenerAuth + Classes []xtcp_config.EndpointClass + // Loopback is a TCP listener on a loopback address: it accepts loopback + // peers only and sends with TTL/hop limit 1. + Loopback bool + IPv4TTL, IPv6HopLimit uint32 +} + +// Serves reports whether s serves class c. +func (s Spec) Serves(c xtcp_config.EndpointClass) bool { return slices.Contains(s.Classes, c) } + +// GRPC reports whether s is a gRPC listener. +func (s Spec) GRPC() bool { return s.Serves(GRPCRead) || s.Serves(GRPCAdmin) } + +// Policy is s's auth policy for the given gRPC method table (nil for HTTP). +func (s Spec) Policy(methods listenerauth.Methods) (*listenerauth.Policy, error) { + return listenerauth.NewPolicy(s.Auth, s.AdminAuth, methods) +} + +// ClientAuth is the credential a local client (the -healthcheck probe) sends +// to s's read paths. +func (s Spec) ClientAuth() listenerauth.ClientAuth { + if !enabled(s.Auth) { + return listenerauth.ClientAuth{} + } + return listenerauth.ClientAuth{RawToken: s.Auth.GetRawToken(), HMACSharedKey: s.Auth.GetHmacSharedKey()} +} + +// SecretReader reads a credential file. label names the config field. +type SecretReader func(label, path string) (string, error) + +// Resolve validates c's effective listeners and resolves each: its network, +// socket options and credentials, reading token files with read. The +// returned warnings should be logged; any error is wrapped in ErrConfig. +func Resolve(c *xtcp_config.XtcpConfig, read SecretReader) ([]Spec, []string, error) { + warnings, err := Validate(c) + if err != nil { + return nil, warnings, err + } + var specs []Spec + for _, l := range Effective(c) { + s, err := resolveOne(c, l, read) + if err != nil { + return nil, warnings, err + } + specs = append(specs, s) + } + return specs, warnings, nil +} + +func resolveOne(c *xtcp_config.XtcpConfig, l *xtcp_config.Listener, read SecretReader) (Spec, error) { + nw, err := network(l) + if err != nil { + return Spec{}, err + } + ep, err := listener.EndpointFromProto(l.GetEndpoint(), nw, "") + if err != nil { + return Spec{}, fmt.Errorf("%w: listener %q: %w", ErrConfig, l.GetName(), err) + } + ep.Network = nw + if l.GetEndpoint().GetUnixSocketMode() == 0 { + ep.UnixSocketMode = listener.DefaultUnixSocketMode + } + auth := effectiveAuth(l.GetAuth(), c.GetListenerAuth()) + admin := effectiveAdminAuth(l.GetAdminAuth(), c.GetAdminListenerAuth()) + for _, f := range []struct { + label string + a *xtcp_config.ListenerAuth + }{{l.GetName() + ".auth", auth}, {l.GetName() + ".admin_auth", admin}} { + if err := readFiles(f.label, f.a, read); err != nil { + return Spec{}, fmt.Errorf("%w: listener %q: %w", ErrConfig, l.GetName(), err) + } + } + if _, err := listenerauth.NewPolicy(auth, admin, nil); err != nil { + hint := "" + if l.GetAuth() == nil && auth.GetRawToken() == "" && + auth.GetMode() == xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN { + hint = "; set LISTENER_RAW_TOKEN_FILE to a file holding the bearer token, or LISTENER_AUTH_MODE=disabled " + + "(allowed on a Unix socket or loopback address)" + } + return Spec{}, fmt.Errorf("%w: listener %q: %w%s", ErrConfig, l.GetName(), err, hint) + } + s := Spec{ + Name: l.GetName(), Endpoint: ep, Auth: auth, AdminAuth: admin, + Classes: slices.Clone(l.GetServes()), + IPv4TTL: c.GetIpv4Ttl(), IPv6HopLimit: c.GetIpv6HopLimit(), + } + if nw == listener.NetworkTCP && isLoopbackTCP(ep.Address) { + s.Loopback, s.IPv4TTL, s.IPv6HopLimit = true, loopbackTTL, loopbackTTL + } + return s, nil +} + +// readFiles fills a's secrets from its *_file fields. +func readFiles(label string, a *xtcp_config.ListenerAuth, read SecretReader) error { + if p := a.GetRawTokenFile(); p != "" { + v, err := read(label+".raw_token_file", p) + if err != nil { + return err + } + a.RawToken = v + } + if p := a.GetHmacSharedKeyFile(); p != "" { + v, err := read(label+".hmac_shared_key_file", p) + if err != nil { + return err + } + a.HmacSharedKey = v + } + return nil +} + +// socketDirMode is the mode of a socket directory Listen creates: the +// socket's own mode then decides who connects. +const socketDirMode = 0o750 + +// Listen binds s, creating a Unix socket's directory (DefaultSocketPath's +// /run/xtcp2) when it is missing. A loopback TCP listener closes +// connections from non-loopback peers, calling rejected for each. +func (s Spec) Listen(ctx context.Context, rejected func(net.Addr, error)) (net.Listener, error) { + if s.Endpoint.Network == listener.NetworkUnix { + if err := os.MkdirAll(filepath.Dir(s.Endpoint.Address), socketDirMode); err != nil { + return nil, fmt.Errorf("listener %q: %w", s.Name, err) + } + } + ln, err := listener.Listen(ctx, s.Endpoint, s.IPv4TTL, s.IPv6HopLimit) + if err != nil { + return nil, fmt.Errorf("listener %q: %w", s.Name, err) + } + if s.Loopback { + ln = listener.LoopbackOnly(ln, rejected) + } + return ln, nil +} + +// Find returns the spec serving class c, if any. +func Find(specs []Spec, c xtcp_config.EndpointClass) (Spec, bool) { + for _, s := range specs { + if s.Serves(c) { + return s, true + } + } + return Spec{}, false +} + +// Describe is a one-line summary of s for the startup log. +func (s Spec) Describe() string { + cls := make([]string, 0, len(s.Classes)) + for _, c := range s.Classes { + cls = append(cls, ClassName(c)) + } + return fmt.Sprintf("listener %q on %s %s serving %s (auth %s)", s.Name, s.Endpoint.Network, s.Endpoint.Address, + strings.Join(cls, ","), listenerauth.ModeString(s.Auth.GetMode())) +} diff --git a/pkg/listeners/listeners_test.go b/pkg/listeners/listeners_test.go new file mode 100644 index 000000000..30f167bdd --- /dev/null +++ b/pkg/listeners/listeners_test.go @@ -0,0 +1,298 @@ +package listeners + +import ( + "errors" + "fmt" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" + "github.com/randomizedcoder/xtcp2/pkg/listener" +) + +// testReader reads a token file without the mode check, so the table can use +// t.TempDir files; secretfile.Read's own rules are tested in its package. +func testReader(label, path string) (string, error) { + b, err := os.ReadFile(path) + if err != nil { + return "", fmt.Errorf("%s: %w", label, err) + } + return strings.TrimSpace(string(b)), nil +} + +func raw(token string) *xtcp_config.ListenerAuth { + return &xtcp_config.ListenerAuth{Mode: xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN, RawToken: token} +} + +func disabled() *xtcp_config.ListenerAuth { + return &xtcp_config.ListenerAuth{Mode: xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_DISABLED} +} + +func spec(t *testing.T, s string) *xtcp_config.Listener { + t.Helper() + l, err := ParseSpec(s) + if err != nil { + t.Fatalf("ParseSpec(%q): %v", s, err) + } + return l +} + +// TestListeners is Test FA's pure rows: the default, the cross-listener rules +// and the credential resolution. Bind-level rows (404 per class, per-endpoint +// credentials over the wire) are in cmd/xtcp2 and pkg/xtcp. +func TestListeners(t *testing.T) { + dir := t.TempDir() + tokA := filepath.Join(dir, "a") + tokB := filepath.Join(dir, "b") + for p, v := range map[string]string{tokA: "token-a\n", tokB: "token-b"} { + if err := os.WriteFile(p, []byte(v), 0o400); err != nil { + t.Fatal(err) + } + } + type want struct { + err string // substring; "" = no error + names []string + warnings int + } + cases := []struct { + name string + category string + description string + cfg func(t *testing.T) *xtcp_config.XtcpConfig + expected want + }{ + {"default_listeners", "positive", "no listener config, token present: one UDS serving the metrics classes", + func(*testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{ListenerAuth: raw("t")} + }, want{names: []string{DefaultName}}}, + {"default_no_token", "negative", "defaults with no token: an error naming the env var and disabled", + func(*testing.T) *xtcp_config.XtcpConfig { return &xtcp_config.XtcpConfig{} }, + want{err: "LISTENER_RAW_TOKEN_FILE"}}, + {"default_disabled_on_uds", "boundary", "typed disabled auth is allowed on the default UDS", + func(*testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{ListenerAuth: disabled()} + }, want{names: []string{DefaultName}}}, + {"grpc_uds", "positive", "a gRPC read listener on a UDS", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{ListenerAuth: raw("t"), Listeners: []*xtcp_config.Listener{ + spec(t, "name=grpc,serves=grpc-read,address=/run/xtcp2/grpc.sock")}} + }, want{names: []string{"grpc"}}}, + {"grpc_admin_no_admin_auth", "negative", "grpc-admin next to grpc-read with only auth set", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{ListenerAuth: raw("t"), Listeners: []*xtcp_config.Listener{ + spec(t, "name=grpc,serves=grpc-read+grpc-admin,address=/run/xtcp2/grpc.sock")}} + }, want{err: "needs an admin credential"}}, + {"grpc_admin_only_with_auth", "boundary", "a listener serving only admin classes may use its auth", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{Listeners: []*xtcp_config.Listener{ + spec(t, "name=admin,serves=grpc-admin,address=/run/xtcp2/admin.sock,tokenFile="+tokA)}} + }, want{names: []string{"admin"}}}, + {"tcp_needs_explicit_network", "negative", "a host:port address with no network", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{ListenerAuth: raw("t"), Listeners: []*xtcp_config.Listener{ + spec(t, "name=m,serves=metrics,address=:9088")}} + }, want{err: "not a socket path"}}, + {"tcp_disabled_auth_offloopback", "negative", "disabled auth on all-interfaces TCP", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{Listeners: []*xtcp_config.Listener{ + spec(t, "name=m,serves=metrics,network=tcp,address=:9088,auth=disabled")}} + }, want{err: "auth disabled on TCP"}}, + {"tcp_disabled_auth_loopback", "boundary", "disabled auth on loopback TCP is allowed with a warning", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{Listeners: []*xtcp_config.Listener{ + spec(t, "name=m,serves=metrics,network=tcp,address=127.0.0.1:9088,auth=disabled")}} + }, want{names: []string{"m"}, warnings: 1}}, + {"health_only_no_auth_tcp", "boundary", "a health-only TCP listener may run without auth", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{Listeners: []*xtcp_config.Listener{ + spec(t, "name=h,serves=health,network=tcp,address=:9090,auth=disabled")}} + }, want{names: []string{"h"}}}, + {"class_on_two_listeners", "negative", "metrics on two listeners names both", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{ListenerAuth: raw("t"), Listeners: []*xtcp_config.Listener{ + spec(t, "name=one,serves=metrics,address=/run/a.sock"), + spec(t, "name=two,serves=metrics,address=/run/b.sock")}} + }, want{err: `also served by listener "one"`}}, + {"grpc_and_http_mixed", "negative", "metrics and grpc-read on one listener", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{ListenerAuth: raw("t"), Listeners: []*xtcp_config.Listener{ + spec(t, "name=m,serves=metrics+grpc-read,address=/run/a.sock")}} + }, want{err: "mixes gRPC and HTTP"}}, + {"per_endpoint_credentials", "positive", "metrics and metrics-detail on two listeners with their own token files", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{Listeners: []*xtcp_config.Listener{ + spec(t, "name=metrics,serves=health+metrics,address=/run/a.sock,tokenFile="+tokA), + spec(t, "name=detail,serves=metrics-detail,address=/run/b.sock,tokenFile="+tokB)}} + }, want{names: []string{"metrics", "detail"}}}, + {"pprof_requires_admin", "negative", "debug next to metrics without admin_auth", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{ListenerAuth: raw("t"), Listeners: []*xtcp_config.Listener{ + spec(t, "name=m,serves=metrics+debug,address=/run/a.sock")}} + }, want{err: "serves debug, which needs an admin credential"}}, + {"pprof_with_admin", "positive", "debug with an admin token file", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{ListenerAuth: raw("t"), Listeners: []*xtcp_config.Listener{ + spec(t, "name=m,serves=metrics+debug,address=/run/a.sock,adminAuth=raw,adminTokenFile="+tokB)}} + }, want{names: []string{"m"}}}, + {"ip_needs_ip_paths", "negative", "ip class without -linkMonitorIPPaths", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{ListenerAuth: raw("t"), Listeners: []*xtcp_config.Listener{ + spec(t, "name=ip,serves=ip,address=/run/ip.sock")}} + }, want{err: "needs -linkMonitorIPPaths"}}, + {"inline_token_refused", "corner", "a listener credential given inline instead of as a file", + func(t *testing.T) *xtcp_config.XtcpConfig { + l := spec(t, "name=m,serves=metrics,address=/run/a.sock") + l.Auth = raw("inline") + return &xtcp_config.XtcpConfig{Listeners: []*xtcp_config.Listener{l}} + }, want{err: "inline"}}, + {"duplicate_names", "corner", "two listeners with one name", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{ListenerAuth: raw("t"), Listeners: []*xtcp_config.Listener{ + spec(t, "name=m,serves=metrics,address=/run/a.sock"), + spec(t, "name=m,serves=health,address=/run/b.sock")}} + }, want{err: "name used by more than one"}}, + {"token_file_missing", "negative", "a listener token file that does not exist", + func(t *testing.T) *xtcp_config.XtcpConfig { + return &xtcp_config.XtcpConfig{Listeners: []*xtcp_config.Listener{ + spec(t, "name=m,serves=metrics,address=/run/a.sock,tokenFile="+filepath.Join(dir, "none"))}} + }, want{err: "raw_token_file"}}, + } + for _, tc := range cases { + t.Run(tc.category+"/"+tc.name, func(t *testing.T) { + specs, warnings, err := Resolve(tc.cfg(t), testReader) + if tc.expected.err != "" { + if err == nil || !strings.Contains(err.Error(), tc.expected.err) { + t.Fatalf("%s: err = %v, want one containing %q", tc.description, err, tc.expected.err) + } + if !errors.Is(err, ErrConfig) { + t.Errorf("%s: error is not ErrConfig: %v", tc.description, err) + } + return + } + if err != nil { + t.Fatalf("%s: %v", tc.description, err) + } + var names []string + for _, s := range specs { + names = append(names, s.Name) + } + if strings.Join(names, ",") != strings.Join(tc.expected.names, ",") { + t.Errorf("%s: listeners %v, want %v", tc.description, names, tc.expected.names) + } + if len(warnings) != tc.expected.warnings { + t.Errorf("%s: warnings %q, want %d", tc.description, warnings, tc.expected.warnings) + } + }) + } +} + +// TestDefaultShape pins the default listener exactly. +func TestDefaultShape(t *testing.T) { + specs, _, err := Resolve(&xtcp_config.XtcpConfig{ListenerAuth: raw("t")}, testReader) + if err != nil { + t.Fatal(err) + } + s := specs[0] + if s.Endpoint.Network != listener.NetworkUnix || s.Endpoint.Address != DefaultSocketPath || + s.Endpoint.UnixSocketMode != 0o600 || !s.Endpoint.UnlinkStaleUnixSocket { + t.Errorf("default endpoint = %+v", s.Endpoint) + } + if s.Auth.GetMode() != xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN { + t.Errorf("default auth mode = %v, want raw", s.Auth.GetMode()) + } + for _, c := range []xtcp_config.EndpointClass{Health, Metrics, MetricsDetail} { + if !s.Serves(c) { + t.Errorf("default listener does not serve %s", ClassName(c)) + } + } + for _, c := range []xtcp_config.EndpointClass{IP, Debug, GRPCRead, GRPCAdmin} { + if s.Serves(c) { + t.Errorf("default listener serves %s", ClassName(c)) + } + } +} + +// TestResolveLoopbackAndTokens: loopback TCP gets TTL 1 and the loopback +// accept filter; per-listener token files are read into the spec. +func TestResolveLoopbackAndTokens(t *testing.T) { + tok := filepath.Join(t.TempDir(), "tok") + if err := os.WriteFile(tok, []byte("secret\n"), 0o400); err != nil { + t.Fatal(err) + } + c := &xtcp_config.XtcpConfig{Ipv4Ttl: 3, Ipv6HopLimit: 3, Listeners: []*xtcp_config.Listener{ + spec(t, "name=lo,serves=metrics,network=tcp,address=127.0.0.1:9099,tokenFile="+tok), + spec(t, "name=wide,serves=health,network=tcp,address=:9098,auth=disabled"), + }} + specs, _, err := Resolve(c, testReader) + if err != nil { + t.Fatal(err) + } + lo, wide := specs[0], specs[1] + if !lo.Loopback || lo.IPv4TTL != 1 || lo.IPv6HopLimit != 1 { + t.Errorf("loopback spec = %+v", lo) + } + if lo.ClientAuth().RawToken != "secret" { + t.Errorf("token file not read: %+v", lo.ClientAuth()) + } + if wide.Loopback || wide.IPv4TTL != 3 { + t.Errorf("wide spec = %+v", wide) + } + if wide.ClientAuth().RawToken != "" { + t.Errorf("disabled listener sends a credential: %+v", wide.ClientAuth()) + } +} + +// TestInferredAuthMode: an unset mode follows the credential file given, so +// adminTokenFile= alone is an admin credential and hmacKeyFile= alone is HMAC. +func TestInferredAuthMode(t *testing.T) { + dir := t.TempDir() + tok := filepath.Join(dir, "tok") + if err := os.WriteFile(tok, []byte("secret\n"), 0o400); err != nil { + t.Fatal(err) + } + tests := []struct { + name, category, description string + spec string + auth, admin xtcp_config.ListenerAuthMode + wantErr bool + }{ + {"admin_token_file", "positive", "adminTokenFile alone makes a raw admin credential", + "name=g,serves=grpc-read+grpc-admin,address=/run/g.sock,tokenFile=" + tok + ",adminTokenFile=" + tok, + xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN, xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN, false}, + {"hmac_key_file", "positive", "hmacKeyFile alone means hmac-utc-minute", + "name=m,serves=metrics,address=/run/m.sock,hmacKeyFile=" + tok, + xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_HMAC_UTC_MINUTE, xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_UNSPECIFIED, false}, + {"no_admin", "negative", "no admin file and no admin mode: grpc-admin beside grpc-read is refused", + "name=g,serves=grpc-read+grpc-admin,address=/run/g.sock,tokenFile=" + tok, + 0, 0, true}, + {"explicit_mode_wins", "boundary", "a typed mode is kept even with a token file", + "name=m,serves=metrics,address=/run/m.sock,auth=hmac-utc-minute,hmacKeyFile=" + tok + ",tokenFile=" + tok, + xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_HMAC_UTC_MINUTE, xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_UNSPECIFIED, false}, + {"both_files", "corner", "a token and a key with no mode is raw", + "name=m,serves=metrics,address=/run/m.sock,hmacKeyFile=" + tok + ",tokenFile=" + tok, + xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN, xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_UNSPECIFIED, false}, + } + for _, tc := range tests { + t.Run(tc.category+"/"+tc.name, func(t *testing.T) { + c := &xtcp_config.XtcpConfig{Listeners: []*xtcp_config.Listener{spec(t, tc.spec)}} + specs, _, err := Resolve(c, testReader) + if tc.wantErr { + if err == nil { + t.Fatalf("%s: no error", tc.description) + } + return + } + if err != nil { + t.Fatalf("%s: %v", tc.description, err) + } + if got := specs[0].Auth.GetMode(); got != tc.auth { + t.Errorf("%s: auth mode %v, want %v", tc.description, got, tc.auth) + } + if got := specs[0].AdminAuth.GetMode(); got != tc.admin { + t.Errorf("%s: admin mode %v, want %v", tc.description, got, tc.admin) + } + }) + } +} diff --git a/pkg/listeners/spec.go b/pkg/listeners/spec.go new file mode 100644 index 000000000..22780011d --- /dev/null +++ b/pkg/listeners/spec.go @@ -0,0 +1,190 @@ +package listeners + +import ( + "fmt" + "strconv" + "strings" + + "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" + "github.com/randomizedcoder/xtcp2/pkg/listener" + "github.com/randomizedcoder/xtcp2/pkg/listenerauth" +) + +// The ParseSpec keys that set an auth mode. +const ( + keyAuth = "auth" + keyAdminAuth = "adminAuth" +) + +// SpecSyntax documents ParseSpec's format, for flag usage strings. +const SpecSyntax = "name=,serves=[+...],address=" + + "[,network=unix|tcp][,mode=0600][,unlinkStale=true]" + + "[,auth=raw|hmac-utc-minute|disabled][,tokenFile=][,hmacKeyFile=]" + + "[,adminAuth=raw|hmac-utc-minute][,adminTokenFile=][,adminHmacKeyFile=]" + +// ParseSpec parses one listener in the -listener / LISTENERS form, e.g. +// +// name=metrics,serves=health+metrics,address=/run/xtcp2/metrics.sock,tokenFile=/run/secrets/metrics +// +// Credentials are files only: the config carries paths, never secrets. +// Unset auth inherits the daemon-wide credential. Field-level checks are +// left to protovalidate and Validate. +func ParseSpec(s string) (*xtcp_config.Listener, error) { + l := &xtcp_config.Listener{Endpoint: &xtcp_config.ListenerEndpoint{UnlinkStaleUnixSocket: true}} + seen := map[string]bool{} + for _, kv := range strings.Split(s, ",") { + kv = strings.TrimSpace(kv) + if kv == "" { + continue + } + k, v, ok := strings.Cut(kv, "=") + if !ok { + return nil, fmt.Errorf("%w: listener spec %q: %q is not key=value", ErrConfig, s, kv) + } + if seen[k] { + return nil, fmt.Errorf("%w: listener spec %q: %s given twice", ErrConfig, s, k) + } + seen[k] = true + if err := setField(l, k, strings.TrimSpace(v)); err != nil { + return nil, fmt.Errorf("%w: listener spec %q: %w", ErrConfig, s, err) + } + } + if l.GetName() == "" { + return nil, fmt.Errorf("%w: listener spec %q: name= is required", ErrConfig, s) + } + if l.GetEndpoint().GetAddress() == "" { + return nil, fmt.Errorf("%w: listener spec %q: address= is required", ErrConfig, s) + } + return l, nil +} + +func setField(l *xtcp_config.Listener, k, v string) error { + ep := l.Endpoint + switch k { + case "name": + l.Name = v + case "address": + ep.Address = v + case "network": + n, err := listener.ParseNetwork(v) + if err != nil { + return err + } + ep.Network = n + case "mode": + m, err := strconv.ParseUint(v, 0, 32) + if err != nil || m > 0o777 { + return fmt.Errorf("mode %q: want an octal permission like 0600", v) + } + ep.UnixSocketMode = uint32(m) + case "unlinkStale": + b, err := strconv.ParseBool(v) + if err != nil { + return fmt.Errorf("unlinkStale %q: %w", v, err) + } + ep.UnlinkStaleUnixSocket = b + case "serves": + for _, n := range strings.Split(v, "+") { + c, err := ParseClass(n) + if err != nil { + return err + } + l.Serves = append(l.Serves, c) + } + case keyAuth, keyAdminAuth: + m, err := listenerauth.ParseMode(v) + if err != nil { + return err + } + authFor(l, k == keyAdminAuth).Mode = m + case "tokenFile": + authFor(l, false).RawTokenFile = v + case "hmacKeyFile": + authFor(l, false).HmacSharedKeyFile = v + case "adminTokenFile": + authFor(l, true).RawTokenFile = v + case "adminHmacKeyFile": + authFor(l, true).HmacSharedKeyFile = v + default: + return fmt.Errorf("unknown key %q; syntax: %s", k, SpecSyntax) + } + return nil +} + +func authFor(l *xtcp_config.Listener, admin bool) *xtcp_config.ListenerAuth { + if admin { + if l.AdminAuth == nil { + l.AdminAuth = &xtcp_config.ListenerAuth{} + } + return l.AdminAuth + } + if l.Auth == nil { + l.Auth = &xtcp_config.ListenerAuth{} + } + return l.Auth +} + +// FormatSpec is l in ParseSpec's form, for logs and the deprecation hint. +// Unset fields are left out; credentials are files, so nothing secret is +// printed. +func FormatSpec(l *xtcp_config.Listener) string { + ep := l.GetEndpoint() + cls := make([]string, 0, len(l.GetServes())) + for _, c := range l.GetServes() { + cls = append(cls, ClassName(c)) + } + kv := []string{"name=" + l.GetName(), "serves=" + strings.Join(cls, "+"), "address=" + ep.GetAddress()} + switch ep.GetNetwork() { + case xtcp_config.ListenerNetwork_LISTENER_NETWORK_TCP: + kv = append(kv, "network=tcp") + case xtcp_config.ListenerNetwork_LISTENER_NETWORK_UNIX: + kv = append(kv, "network=unix") + case xtcp_config.ListenerNetwork_LISTENER_NETWORK_UNSPECIFIED: + // Inferred from the address when parsed back. + } + if m := ep.GetUnixSocketMode(); m != 0 { + kv = append(kv, fmt.Sprintf("mode=%#o", m)) + } + for _, a := range []struct { + prefix, modeKey string + auth *xtcp_config.ListenerAuth + }{{"", keyAuth, l.GetAuth()}, {"admin", keyAdminAuth, l.GetAdminAuth()}} { + if a.auth == nil { + continue + } + if m := a.auth.GetMode(); m != xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_UNSPECIFIED { + kv = append(kv, a.modeKey+"="+listenerauth.ModeString(m)) + } + if p := a.auth.GetRawTokenFile(); p != "" { + kv = append(kv, fileKey(a.prefix, "tokenFile")+"="+p) + } + if p := a.auth.GetHmacSharedKeyFile(); p != "" { + kv = append(kv, fileKey(a.prefix, "hmacKeyFile")+"="+p) + } + } + return strings.Join(kv, ",") +} + +// fileKey is "tokenFile" or, with prefix "admin", "adminTokenFile". +func fileKey(prefix, key string) string { + if prefix == "" { + return key + } + return prefix + strings.ToUpper(key[:1]) + key[1:] +} + +// ParseList parses the LISTENERS form: specs separated by ';'. +func ParseList(s string) ([]*xtcp_config.Listener, error) { + var out []*xtcp_config.Listener + for _, one := range strings.Split(s, ";") { + if strings.TrimSpace(one) == "" { + continue + } + l, err := ParseSpec(one) + if err != nil { + return nil, err + } + out = append(out, l) + } + return out, nil +} diff --git a/pkg/listeners/spec_test.go b/pkg/listeners/spec_test.go new file mode 100644 index 000000000..3e93a4f4b --- /dev/null +++ b/pkg/listeners/spec_test.go @@ -0,0 +1,89 @@ +package listeners + +import ( + "errors" + "strings" + "testing" + + "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" +) + +func TestParseSpec(t *testing.T) { + t.Parallel() + cases := []struct { + name string + category string + description string + in string + expected string // "" = ok; else an error substring + check func(*xtcp_config.Listener) bool + }{ + {"full", "positive", "every key", + "name=m,serves=health+metrics,address=/run/m.sock,network=unix,mode=0640,unlinkStale=false,auth=raw,tokenFile=/t,hmacKeyFile=/h,adminAuth=hmac,adminTokenFile=/at,adminHmacKeyFile=/ah", + "", func(l *xtcp_config.Listener) bool { + return l.GetName() == "m" && len(l.GetServes()) == 2 && l.GetEndpoint().GetUnixSocketMode() == 0o640 && + !l.GetEndpoint().GetUnlinkStaleUnixSocket() && l.GetAuth().GetRawTokenFile() == "/t" && + l.GetAuth().GetHmacSharedKeyFile() == "/h" && l.GetAdminAuth().GetRawTokenFile() == "/at" && + l.GetAdminAuth().GetHmacSharedKeyFile() == "/ah" + }}, + {"minimal", "positive", "name, serves, address; unlinkStale defaults true; auth inherits", + "name=m,serves=metrics,address=/run/m.sock", "", func(l *xtcp_config.Listener) bool { + return l.GetEndpoint().GetUnlinkStaleUnixSocket() && l.GetAuth() == nil + }}, + {"no_name", "negative", "name is required", "serves=metrics,address=/x", "name= is required", nil}, + {"no_address", "negative", "address is required", "name=m,serves=metrics", "address= is required", nil}, + {"unknown_key", "negative", "an unknown key is refused", "name=m,address=/x,token=s3cret", "unknown key", nil}, + {"unknown_class", "negative", "an unknown class is refused", "name=m,address=/x,serves=metrics+pprof", "unknown endpoint class", nil}, + {"not_kv", "negative", "a field without =", "name=m,address=/x,serves", "not key=value", nil}, + {"dup_key", "corner", "a key given twice", "name=m,name=n,address=/x", "given twice", nil}, + {"bad_mode", "boundary", "a mode past 0777", "name=m,address=/x,mode=01000", "octal permission", nil}, + {"spaces", "corner", "spaces around fields are trimmed", " name=m , serves= metrics ,address=/x ", "", func(l *xtcp_config.Listener) bool { + return l.GetName() == "m" && len(l.GetServes()) == 1 + }}, + } + for _, tc := range cases { + t.Run(tc.category+"/"+tc.name, func(t *testing.T) { + t.Parallel() + l, err := ParseSpec(tc.in) + if tc.expected != "" { + if err == nil || !strings.Contains(err.Error(), tc.expected) || !errors.Is(err, ErrConfig) { + t.Fatalf("%s: err = %v, want ErrConfig containing %q", tc.description, err, tc.expected) + } + return + } + if err != nil { + t.Fatalf("%s: %v", tc.description, err) + } + if tc.check != nil && !tc.check(l) { + t.Errorf("%s: parsed %v", tc.description, l) + } + }) + } +} + +func TestParseList(t *testing.T) { + t.Parallel() + ls, err := ParseList("name=a,serves=metrics,address=/a;; name=b,serves=health,address=/b;") + if err != nil || len(ls) != 2 || ls[1].GetName() != "b" { + t.Fatalf("ParseList = %v, %v", ls, err) + } + if _, err := ParseList("name=a,serves=metrics,address=/a;bogus"); err == nil { + t.Fatal("want an error for a bad entry") + } + if ls, err := ParseList(""); err != nil || len(ls) != 0 { + t.Fatalf("empty = %v, %v", ls, err) + } +} + +func TestParseClassRoundTrip(t *testing.T) { + t.Parallel() + for c, n := range classNames { + got, err := ParseClass(strings.ToUpper(n)) + if err != nil || got != c || ClassName(c) != n { + t.Errorf("class %v: ParseClass(%q) = %v, %v", c, n, got, err) + } + } + if len(classNames) != len(xtcp_config.EndpointClass_name)-1 { + t.Errorf("classNames covers %d classes, proto has %d", len(classNames), len(xtcp_config.EndpointClass_name)-1) + } +} diff --git a/pkg/secretfile/secretfile.go b/pkg/secretfile/secretfile.go new file mode 100644 index 000000000..80b025638 --- /dev/null +++ b/pkg/secretfile/secretfile.go @@ -0,0 +1,42 @@ +// Package secretfile reads credentials from files (the Docker/Kubernetes +// `_FILE` convention), refusing files that would not keep them secret. +package secretfile + +import ( + "errors" + "fmt" + "os" + "strings" +) + +// ErrSecretFile marks a credential file that cannot be used: missing, +// unreadable, not a regular file, or accessible by group or others. Callers +// treat it as a configuration error and stop, rather than run with the +// credential empty. +var ErrSecretFile = errors.New("secret file") + +// modeMask is the permission bits a secret file must not have: any access +// for group or others. +const modeMask = 0o077 + +// Read returns the trimmed contents of the credential file at path. label +// names where the path came from (an env var, a flag field) for the error. +// Symlinks are followed, as Kubernetes secret volumes need. +func Read(label, path string) (string, error) { + fi, err := os.Stat(path) + if err != nil { + return "", fmt.Errorf("%w: %s=%q: %w", ErrSecretFile, label, path, err) + } + if !fi.Mode().IsRegular() { + return "", fmt.Errorf("%w: %s=%q is not a regular file", ErrSecretFile, label, path) + } + if perm := fi.Mode().Perm(); perm&modeMask != 0 { + return "", fmt.Errorf("%w: %s=%q has mode %04o; a secret file must not be accessible by group or "+ + "others (chmod 0400; Kubernetes secret defaultMode: 0400)", ErrSecretFile, label, path, perm) + } + b, err := os.ReadFile(path) + if err != nil { + return "", fmt.Errorf("%w: %s=%q: %w", ErrSecretFile, label, path, err) + } + return strings.TrimSpace(string(b)), nil +} diff --git a/pkg/xtcp/grpc_configService.go b/pkg/xtcp/grpc_configService.go index f18d93143..8db3335fa 100644 --- a/pkg/xtcp/grpc_configService.go +++ b/pkg/xtcp/grpc_configService.go @@ -12,6 +12,8 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" "github.com/randomizedcoder/xtcp2/pkg/listenerauth" + "github.com/randomizedcoder/xtcp2/pkg/listeners" + "github.com/randomizedcoder/xtcp2/pkg/secretfile" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/encoding/protojson" @@ -187,7 +189,6 @@ func (c *xtcpConfigService) Set( c.pC.WithLabelValues("Set", "s3Transport", "error").Inc() return nil, status.Error(codes.InvalidArgument, err.Error()) } - // Secret preservation: an operator does Get → edit → Set, and Get redacts // the S3 credentials (see below). Empty credential fields therefore mean // "unchanged", not "clear" — inherit them from the running config so a @@ -203,6 +204,22 @@ func (c *xtcpConfigService) Set( if _, err := listenerauth.NewPolicy(in.Config.ListenerAuth, in.Config.AdminListenerAuth, nil); err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } + // Resolve the listeners as the restart will: the rules (one listener per + // class, no inline credentials, auth off only on a socket or loopback, + // ...), every credential file read, every auth policy built. Anything the + // restart would refuse at startup, after this daemon has stopped, is + // refused here instead. After the secret preservation above, so a + // Get → Set round-trip is judged with the credentials it will run with; + // on a clone, so the file contents never enter in.Config or the response. + probe, ok := proto.Clone(in.Config).(*xtcp_config.XtcpConfig) + if !ok { + c.pC.WithLabelValues("Set", "clone", "error").Inc() + return nil, status.Error(codes.Internal, "config clone failed") + } + if _, _, err := listeners.Resolve(probe, secretfile.Read); err != nil { + c.pC.WithLabelValues("Set", "listeners", "error").Inc() + return nil, status.Error(codes.InvalidArgument, err.Error()) + } // The soft-restart hook is only wired in the real daemon (cmd/xtcp2). // Embedded/test callers leave it nil — there is nothing to restart. @@ -271,7 +288,15 @@ func (c *xtcpConfigService) redactedConfig() (*xtcp_config.XtcpConfig, error) { func RedactSecrets(cfg *xtcp_config.XtcpConfig) { cfg.S3SecretKey = "" cfg.S3AccessKey = "" - for _, a := range []*xtcp_config.ListenerAuth{cfg.ListenerAuth, cfg.AdminListenerAuth} { + auths := make([]*xtcp_config.ListenerAuth, 0, 2+2*len(cfg.GetListeners())) + auths = append(auths, cfg.ListenerAuth, cfg.AdminListenerAuth) + // Per-listener credentials are file paths (listeners refuse them inline), + // so there is nothing to carry across a soft restart; blank any inline + // value anyway so a response can never echo one. + for _, l := range cfg.GetListeners() { + auths = append(auths, l.GetAuth(), l.GetAdminAuth()) + } + for _, a := range auths { if a != nil { a.RawToken = "" a.HmacSharedKey = "" diff --git a/pkg/xtcp/grpc_configService_test.go b/pkg/xtcp/grpc_configService_test.go index 070167466..5301becc7 100644 --- a/pkg/xtcp/grpc_configService_test.go +++ b/pkg/xtcp/grpc_configService_test.go @@ -3,6 +3,8 @@ package xtcp import ( "context" "fmt" + "os" + "path/filepath" "strings" "sync" "testing" @@ -14,9 +16,11 @@ import ( "google.golang.org/grpc/status" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/durationpb" "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" + "github.com/randomizedcoder/xtcp2/pkg/listeners" ) // newConfigServiceFixture builds an xtcpConfigService directly, @@ -82,6 +86,9 @@ func validSetConfig() *xtcp_config.XtcpConfig { IoUringRecvBatchSize: 64, IoUringCqeBatchSize: 128, S3UploadMaxAttempts: 10, + // The read token every daemon runs with: the default listener needs + // one, and Set refuses a config the restart could not start. + ListenerAuth: &xtcp_config.ListenerAuth{RawToken: "set-token"}, } } @@ -608,11 +615,17 @@ func TestConfigService_Set_happy(t *testing.T) { } // padConfigJSON grows cfg's enabled_deserializers map, which validation -// leaves unbounded, until cfg's protojson is exactly n bytes. +// leaves unbounded, until cfg's protojson is exactly n bytes with its +// secrets redacted, the form Set measures. func padConfigJSON(t *testing.T, cfg *xtcp_config.XtcpConfig, n int) { t.Helper() size := func() int { - js, err := protojson.Marshal(cfg) + r, ok := proto.Clone(cfg).(*xtcp_config.XtcpConfig) + if !ok { + t.Fatal("clone failed") + } + RedactSecrets(r) + js, err := protojson.Marshal(r) if err != nil { t.Fatalf("marshal: %v", err) } @@ -806,3 +819,106 @@ func TestConfigService_Get_redactsSecrets(t *testing.T) { t.Error("Get must not mutate the live config's credentials") } } + +// TestConfigService_Set_listeners: Set refuses a listener config the restart +// would refuse at startup, before the running daemon stops. +// TestConfigService_Set_listeners: Set refuses, before scheduling the +// restart, any listener set the restart would refuse at startup, and judges +// a Get → edit → Set round trip with the secrets it will run with. Each row +// starts from a running config holding a read and an admin token (admin +// mode unset, so inferred raw), takes Get's redacted copy, sets its +// listeners and calls Set. +func TestConfigService_Set_listeners(t *testing.T) { + dir := t.TempDir() + file := func(name string, mode os.FileMode) string { + p := filepath.Join(dir, name) + if err := os.WriteFile(p, []byte("file-token\n"), mode); err != nil { + t.Fatal(err) + } + return p + } + goodFile := file("token", 0o600) + openFile := file("open-token", 0o644) + missingFile := filepath.Join(dir, "missing") + + sock := func(name string, serves ...xtcp_config.EndpointClass) *xtcp_config.Listener { + return &xtcp_config.Listener{Name: name, Endpoint: &xtcp_config.ListenerEndpoint{Address: "/run/xtcp2/" + name + ".sock"}, Serves: serves} + } + withAuth := func(l *xtcp_config.Listener, auth, admin *xtcp_config.ListenerAuth) *xtcp_config.Listener { + l.Auth, l.AdminAuth = auth, admin + return l + } + tokenFile := func(p string) *xtcp_config.ListenerAuth { return &xtcp_config.ListenerAuth{RawTokenFile: p} } + ls := func(l ...*xtcp_config.Listener) []*xtcp_config.Listener { return l } + + tests := []struct { + name, category, description string + listeners []*xtcp_config.Listener + expected codes.Code + }{ + {"default_roundtrip", "positive", "no listeners: the default socket, with the running read token restored", + nil, codes.OK}, + {"valid", "positive", "a valid listener set on the running tokens", + ls(sock("m", listeners.Health, listeners.Metrics)), codes.OK}, + {"token_file", "positive", "a listener whose token file exists, mode 0600", + ls(withAuth(sock("m", listeners.Metrics), tokenFile(goodFile), nil)), codes.OK}, + {"admin_inferred_roundtrip", "positive", "grpc-read and grpc-admin inheriting the redacted, mode-unset admin token: accepted once restored", + ls(sock("g", listeners.GRPCRead, listeners.GRPCAdmin)), codes.OK}, + {"admin_inferred_roundtrip_http", "corner", "metrics and debug on one listener, the same inherited admin token", + ls(sock("m", listeners.Health, listeners.Metrics, listeners.Debug)), codes.OK}, + {"class_twice", "negative", "a class served by two listeners", + ls(sock("a", listeners.Metrics), sock("b", listeners.Metrics)), codes.InvalidArgument}, + {"inline_token", "negative", "a listener carrying its token inline", + ls(withAuth(sock("m", listeners.Metrics), &xtcp_config.ListenerAuth{RawToken: "x"}, nil)), codes.InvalidArgument}, + {"missing_token_file", "negative", "a listener token file that does not exist is refused before the restart", + ls(withAuth(sock("m", listeners.Metrics), tokenFile(missingFile), nil)), codes.InvalidArgument}, + {"open_token_file", "negative", "a world-readable listener token file is refused before the restart", + ls(withAuth(sock("m", listeners.Metrics), tokenFile(openFile), nil)), codes.InvalidArgument}, + {"missing_admin_token_file", "boundary", "only the admin credential file is missing", + ls(withAuth(sock("g", listeners.GRPCAdmin), nil, tokenFile(missingFile))), codes.InvalidArgument}, + {"untyped_tcp", "corner", "a TCP address without network=tcp", + ls(&xtcp_config.Listener{Name: "m", Endpoint: &xtcp_config.ListenerEndpoint{Address: ":9088"}, Serves: []xtcp_config.EndpointClass{listeners.Metrics}}), codes.InvalidArgument}, + } + for _, tc := range tests { + t.Run(tc.category+"/"+tc.name, func(t *testing.T) { + t.Logf("%s: %s; expected: %v", tc.category, tc.description, tc.expected) + c, _ := newConfigServiceFixture(t) + running := validSetConfig() + running.ListenerAuth = &xtcp_config.ListenerAuth{Mode: xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_RAW_TOKEN, RawToken: "read-token"} + running.AdminListenerAuth = &xtcp_config.ListenerAuth{RawToken: "admin-token"} + c.config = running + var restarted *xtcp_config.XtcpConfig + c.reconfigureFunc = func(cfg *xtcp_config.XtcpConfig) { restarted = cfg } + + got, err := c.Get(context.Background(), &xtcp_config.GetRequest{}) + if err != nil { + t.Fatalf("Get: %v", err) + } + cfg := got.GetConfig() + cfg.Listeners = tc.listeners + resp, err := c.Set(context.Background(), &xtcp_config.SetRequest{Config: cfg}) + if code := status.Code(err); code != tc.expected { + t.Fatalf("%s: code = %v (%v), want %v", tc.description, code, err, tc.expected) + } + if tc.expected != codes.OK { + if restarted != nil { + t.Errorf("%s: a refused Set scheduled the restart", tc.description) + } + return + } + if restarted == nil { + t.Fatalf("%s: Set returned OK without scheduling the restart", tc.description) + } + if a := restarted.GetAdminListenerAuth().GetRawToken(); a != "admin-token" { + t.Errorf("%s: restart admin token = %q, want the running one restored", tc.description, a) + } + // The probe resolved a clone: file contents never reach the + // restart config or the response. + for _, l := range append(restarted.GetListeners(), resp.GetConfig().GetListeners()...) { + if l.GetAuth().GetRawToken() != "" || l.GetAdminAuth().GetRawToken() != "" { + t.Errorf("%s: listener %q carries a token read from its file", tc.description, l.GetName()) + } + } + }) + } +} diff --git a/pkg/xtcp/grpc_flatRecordService.go b/pkg/xtcp/grpc_flatRecordService.go index a1f6682c9..62ac6f213 100644 --- a/pkg/xtcp/grpc_flatRecordService.go +++ b/pkg/xtcp/grpc_flatRecordService.go @@ -234,7 +234,11 @@ func (x *XTCP) flatRecordServiceSend(xtcpRecord *xtcp_flat_record.XtcpFlatRecord // Check if there are clients. This runs once per record, so with none // (the usual case) it returns before touching a metric: the start and // complete counts, the summary and its time.Now cost more than the - // decode. They count sends to clients, not records. + // decode. They count sends to clients, not records. With no listener + // serving gRPC there is no service and nothing to send to. + if x.flatRecordService == nil { + return + } frClientCount := x.flatRecordService.frMapCount() pfrClientCount := x.flatRecordService.pfrMapCount() diff --git a/pkg/xtcp/grpc_server.go b/pkg/xtcp/grpc_server.go index dd7c52c9c..976ae5ee9 100644 --- a/pkg/xtcp/grpc_server.go +++ b/pkg/xtcp/grpc_server.go @@ -3,16 +3,15 @@ package xtcp import ( "context" "errors" - "fmt" "log" + "net" "time" linkmonitorpb "github.com/randomizedcoder/xtcp2/gen/go/linkmonitor" "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" "github.com/randomizedcoder/xtcp2/gen/go/xtcp_flat_record" "github.com/randomizedcoder/xtcp2/pkg/health" - "github.com/randomizedcoder/xtcp2/pkg/listener" - "github.com/randomizedcoder/xtcp2/pkg/listenerauth" + "github.com/randomizedcoder/xtcp2/pkg/listeners" "google.golang.org/grpc" _ "google.golang.org/grpc/encoding/gzip" grpchealth "google.golang.org/grpc/health" @@ -42,18 +41,24 @@ const ( KeepaliveMinTime = 60 * time.Second ) -func (x *XTCP) startGRPCflatRecordService(ctx context.Context) { +// GRPCListener is a bound listener that serves gRPC endpoint classes. The +// caller (cmd/xtcp2) binds every listener before the daemon starts, so a bad +// address fails startup, and hands the gRPC ones to SetGRPCListeners. +type GRPCListener struct { + Spec listeners.Spec + Listener net.Listener +} - ep, err := listener.EndpointFromProto(x.config.GetGrpcListener(), listener.NetworkTCP, fmt.Sprintf(":%d", x.config.GrpcPort)) - if err != nil { - log.Fatalf("failed to resolve gRPC listener: %v", err) - } - lis, err := listener.Listen(ctx, ep, x.config.Ipv4Ttl, x.config.Ipv6HopLimit) - if err != nil { - log.Fatalf("failed to listen: %v", err) - } +// SetGRPCListeners gives the daemon the gRPC listeners to serve. Call it +// after NewXTCP and before Run. With none, no gRPC server runs: a class no +// listener names is not served. +func (x *XTCP) SetGRPCListeners(ls []GRPCListener) { + x.grpcListeners = ls +} - opts := []grpc.ServerOption{ +// grpcServerOptions is the transport tuning every gRPC listener shares. +func grpcServerOptions() []grpc.ServerOption { + return []grpc.ServerOption{ grpc.ReadBufferSize(ReadBufferSize), grpc.WriteBufferSize(WriteBufferSize), // https://pkg.go.dev/google.golang.org/grpc#MaxRecvMsgSize @@ -75,58 +80,115 @@ func (x *XTCP) startGRPCflatRecordService(ctx context.Context) { PermitWithoutStream: true, }), } - policy, err := listenerauth.NewPolicy(x.config.GetListenerAuth(), x.config.GetAdminListenerAuth(), grpcMethodAccess()) - if err != nil { - log.Fatalf("listener auth config invalid: %v", err) - } - if policy.Enabled() { - opts = append(opts, grpc.UnaryInterceptor(policy.UnaryServerInterceptor()), grpc.StreamInterceptor(policy.StreamServerInterceptor())) - } - grpcServer := grpc.NewServer(opts...) - // grpc.ForceServerCodec(gzip.Name), - - // https://github.com/grpc/grpc-go/blob/master/Documentation/server-reflection-tutorial.md#enable-server-reflection - // https://github.com/fullstorydev/grpcurl?tab=readme-ov-file#server-reflection - reflection.Register(grpcServer) +} +// startGRPCServers serves each gRPC listener on its own server, with that +// listener's credentials. The services are built once and shared. A listener +// serving grpc-admin gets every method; one serving only grpc-read gets +// read-only adapters, so the admin handlers are not registered there at all +// and answer Unimplemented whatever the auth policy says. +func (x *XTCP) startGRPCServers(ctx context.Context) { + if len(x.grpcListeners) == 0 { + return + } + // Built here, synchronously in Run before the poller starts, so the + // poll path's flatRecordServiceSend sees it set or (no gRPC) nil. x.flatRecordService = NewXtcpFlatRecordService(ctx, x.registry, &x.pollRequestCh, x.debugLevel) - xtcp_flat_record.RegisterXTCPFlatRecordServiceServer(grpcServer, x.flatRecordService) - x.configService = NewXtcpConfigService(ctx, x.registry, x.config, &x.changePollFrequencyCh, &x.pollRequestCh, &x.pollBurstCh, &x.setS3FlushCh, &x.envelopeMu, x.reconfigureFunc, x.debugLevel) - xtcp_config.RegisterConfigServiceServer(grpcServer, x.configService) - linkMonitorService, err := x.newLinkMonitorService() if err != nil { - log.Fatalf("link monitor service: %v", err) + x.fatalf("link monitor service: %v", err) + return } - linkmonitorpb.RegisterLinkMonitorServiceServer(grpcServer, linkMonitorService) - // Standard gRPC health service (grpc.health.v1) so k8s gRPC probes work. // Starts NOT_SERVING; setReady flips it to SERVING once the daemon polls. x.grpcHealth = grpchealth.NewServer() x.grpcHealth.SetServingStatus("", healthpb.HealthCheckResponse_NOT_SERVING) - healthpb.RegisterHealthServer(grpcServer, x.grpcHealth) - - // Stop the gRPC server when ctx fires. grpcServer.Serve blocks - // indefinitely on lis.Accept and is NOT ctx-aware on its own — - // without this goroutine the gRPC server outlives Run() and would - // leak in any embedded / test caller that runs the daemon more - // than once in a process. GracefulStop drains in-flight RPCs - // before closing the listener. + methods := grpcMethodAccess() + + for i := range x.grpcListeners { + l := &x.grpcListeners[i] + policy, err := l.Spec.Policy(methods) + if err != nil { + x.fatalf("gRPC listener %q auth: %v", l.Spec.Name, err) + return + } + opts := grpcServerOptions() + if policy.Enabled() { + opts = append(opts, grpc.UnaryInterceptor(policy.UnaryServerInterceptor()), grpc.StreamInterceptor(policy.StreamServerInterceptor())) + } + srv := grpc.NewServer(opts...) + // https://github.com/grpc/grpc-go/blob/master/Documentation/server-reflection-tutorial.md#enable-server-reflection + reflection.Register(srv) + healthpb.RegisterHealthServer(srv, x.grpcHealth) + if l.Spec.Serves(listeners.GRPCAdmin) { + xtcp_flat_record.RegisterXTCPFlatRecordServiceServer(srv, x.flatRecordService) + xtcp_config.RegisterConfigServiceServer(srv, x.configService) + linkmonitorpb.RegisterLinkMonitorServiceServer(srv, linkMonitorService) + } else { + xtcp_flat_record.RegisterXTCPFlatRecordServiceServer(srv, readOnlyFlatRecords{s: x.flatRecordService}) + xtcp_config.RegisterConfigServiceServer(srv, readOnlyConfig{s: x.configService}) + linkmonitorpb.RegisterLinkMonitorServiceServer(srv, readOnlyLinkMonitor{s: linkMonitorService}) + } + go serveGRPC(ctx, *l, srv) + } +} + +// serveGRPC serves one listener until ctx ends. grpc.Server.Serve is not +// ctx-aware, so GracefulStop runs on ctx.Done, draining in-flight RPCs; +// without it the server would outlive Run in an embedded or test caller. +func serveGRPC(ctx context.Context, l GRPCListener, srv *grpc.Server) { go func() { <-ctx.Done() - grpcServer.GracefulStop() + srv.GracefulStop() }() - - // grpcServer.Serve returns grpc.ErrServerStopped when - // GracefulStop / Stop completes — that's the normal shutdown path - // here, not an error worth logging. Filter it so a clean SIGTERM - // doesn't produce a misleading "Serve err:..." log line every run. - if serveErr := grpcServer.Serve(lis); serveErr != nil && !errors.Is(serveErr, grpc.ErrServerStopped) { - log.Printf("startGRPCflatRecordService grpcServer.Serve err:%v", serveErr) + // Serve returns grpc.ErrServerStopped after GracefulStop: the normal + // shutdown, not an error worth logging. + if err := srv.Serve(l.Listener); err != nil && !errors.Is(err, grpc.ErrServerStopped) { + log.Printf("gRPC listener %q: serve: %v", l.Spec.Name, err) } } +// readOnlyFlatRecords serves FlatRecords (observing polls) and leaves +// PollFlatRecords (driving them) Unimplemented. +type readOnlyFlatRecords struct { + xtcp_flat_record.UnimplementedXTCPFlatRecordServiceServer + s *xtcpFlatRecordService +} + +func (r readOnlyFlatRecords) FlatRecords(req *xtcp_flat_record.FlatRecordsRequest, stream grpc.ServerStreamingServer[xtcp_flat_record.FlatRecordsResponse]) error { + return r.s.FlatRecords(req, stream) +} + +// readOnlyConfig serves Get and leaves every mutating method Unimplemented. +type readOnlyConfig struct { + xtcp_config.UnimplementedConfigServiceServer + s *xtcpConfigService +} + +func (r readOnlyConfig) Get(ctx context.Context, in *xtcp_config.GetRequest) (*xtcp_config.GetResponse, error) { + return r.s.Get(ctx, in) +} + +// readOnlyLinkMonitor serves the status and list methods and leaves +// Rebaseline and Resync Unimplemented. +type readOnlyLinkMonitor struct { + linkmonitorpb.UnimplementedLinkMonitorServiceServer + s linkmonitorpb.LinkMonitorServiceServer +} + +func (r readOnlyLinkMonitor) GetStatus(ctx context.Context, in *linkmonitorpb.GetStatusRequest) (*linkmonitorpb.GetStatusResponse, error) { + return r.s.GetStatus(ctx, in) +} + +func (r readOnlyLinkMonitor) ListInterfaces(ctx context.Context, in *linkmonitorpb.ListInterfacesRequest) (*linkmonitorpb.ListInterfacesResponse, error) { + return r.s.ListInterfaces(ctx, in) +} + +func (r readOnlyLinkMonitor) ListCollectors(ctx context.Context, in *linkmonitorpb.ListCollectorsRequest) (*linkmonitorpb.ListCollectorsResponse, error) { + return r.s.ListCollectors(ctx, in) +} + // setReady flips the process readiness in one place: the HTTP /readyz flag and // the gRPC health status move together. The daemon calls setReady(true) once it // starts polling and setReady(false) on shutdown. diff --git a/pkg/xtcp/grpc_server_test.go b/pkg/xtcp/grpc_server_test.go index abe18163e..6ab036c8f 100644 --- a/pkg/xtcp/grpc_server_test.go +++ b/pkg/xtcp/grpc_server_test.go @@ -12,32 +12,35 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "google.golang.org/grpc" + "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials/insecure" healthpb "google.golang.org/grpc/health/grpc_health_v1" + "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/durationpb" + linkmonitorpb "github.com/randomizedcoder/xtcp2/gen/go/linkmonitor" "github.com/randomizedcoder/xtcp2/gen/go/xtcp_config" + "github.com/randomizedcoder/xtcp2/gen/go/xtcp_flat_record" + "github.com/randomizedcoder/xtcp2/pkg/listener" + "github.com/randomizedcoder/xtcp2/pkg/listeners" ) -// startGRPCflatRecordService binds a real TCP port (config.GrpcPort) and -// runs an actual grpc.Server. With x.registry pre-filled with a fresh -// prometheus.NewRegistry(), the inner NewXtcpFlatRecordService + -// NewXtcpConfigService calls don't panic from duplicate-metric -// registration on the default registry. -func TestStartGRPCflatRecordService_cancels(t *testing.T) { +// newGRPCServerFixture is an XTCP with what startGRPCServers needs, on a +// fresh registry so the service constructors' metrics never collide. +func newGRPCServerFixture(t *testing.T) *XTCP { + t.Helper() reg := prometheus.NewRegistry() x := &XTCP{ registry: reg, config: &xtcp_config.XtcpConfig{ - GrpcPort: 0, // OS-picked free port PollFrequency: durationpb.New(time.Second), PollTimeout: durationpb.New(time.Second), NetlinkersDoneChanSize: 1, }, + fatalf: func(format string, args ...any) { t.Fatalf(format, args...) }, } x.pC = promauto.With(reg).NewCounterVec( - prometheus.CounterOpts{Subsystem: "xtcp_grpc_server_test", - Name: promNameCounts, Help: "test counts"}, + prometheus.CounterOpts{Subsystem: "xtcp_grpc_server_test", Name: promNameCounts, Help: "test counts"}, promLabels, ) x.pollRequestCh = make(chan struct{}, 1) @@ -45,94 +48,155 @@ func TestStartGRPCflatRecordService_cancels(t *testing.T) { x.storeCount = atomic.Uint64{} x.generation = atomic.Uint64{} x.deleteCount = atomic.Uint64{} - - ctx, cancel := context.WithCancel(context.Background()) - done := make(chan struct{}) - go func() { - x.startGRPCflatRecordService(ctx) - close(done) - }() - time.Sleep(100 * time.Millisecond) - cancel() - // grpc.Server.Serve doesn't return on ctx cancel alone — the test - // goroutine will outlive this function. Go's test framework handles - // the leak; the function under test got exercised through its setup - // path which is what we wanted to cover. - _ = done + return x } -func TestStartGRPCflatRecordService_unixSocket(t *testing.T) { - socketPath := filepath.Join(t.TempDir(), "xtcp2-grpc.sock") - reg := prometheus.NewRegistry() - x := &XTCP{ - registry: reg, - config: &xtcp_config.XtcpConfig{ - GrpcPort: 8889, - GrpcListener: &xtcp_config.ListenerEndpoint{Network: xtcp_config.ListenerNetwork_LISTENER_NETWORK_UNIX, Address: socketPath, UnixSocketMode: 0o660, UnlinkStaleUnixSocket: true}, - PollFrequency: durationpb.New(time.Second), - PollTimeout: durationpb.New(time.Second), - NetlinkersDoneChanSize: 1, - }, +// bindGRPC binds one gRPC listener on a socket in a temp dir with auth +// disabled. It builds the Spec directly rather than through +// listeners.Resolve, which (rightly) refuses grpc-admin without an admin +// credential: this table exercises registration, not credentials. +func bindGRPC(t *testing.T, serves string) (GRPCListener, string) { + t.Helper() + sock := filepath.Join(t.TempDir(), "grpc.sock") + cls, err := listeners.ParseClass(serves) + if err != nil { + t.Fatal(err) } - x.pC = promauto.With(reg).NewCounterVec( - prometheus.CounterOpts{Subsystem: "xtcp_grpc_server_uds_test", - Name: promNameCounts, Help: "test counts"}, - promLabels, - ) - x.pollRequestCh = make(chan struct{}, 1) - x.changePollFrequencyCh = make(chan time.Duration, 1) - x.storeCount = atomic.Uint64{} - x.generation = atomic.Uint64{} - x.deleteCount = atomic.Uint64{} - - ctx, cancel := context.WithCancel(context.Background()) - done := make(chan struct{}) - go func() { - x.startGRPCflatRecordService(ctx) - close(done) - }() - - deadline := time.Now().Add(2 * time.Second) - for { - st, err := os.Lstat(socketPath) - if err == nil && st.Mode()&os.ModeSocket != 0 { - if st.Mode().Perm() != 0o660 { - t.Fatalf("socket mode=%#o, want 0660", st.Mode().Perm()) - } - break - } - if time.Now().After(deadline) { - t.Fatalf("unix socket was not created at %s", socketPath) - } - time.Sleep(10 * time.Millisecond) + s := listeners.Spec{ + Name: "grpc", + Endpoint: listener.Endpoint{Network: listener.NetworkUnix, Address: sock, UnixSocketMode: 0o660, UnlinkStaleUnixSocket: true}, + Auth: &xtcp_config.ListenerAuth{Mode: xtcp_config.ListenerAuthMode_LISTENER_AUTH_MODE_DISABLED}, + AdminAuth: &xtcp_config.ListenerAuth{}, + Classes: []xtcp_config.EndpointClass{cls}, + } + ln, err := s.Listen(context.Background(), nil) + if err != nil { + t.Fatal(err) } + return GRPCListener{Spec: s, Listener: ln}, sock +} - conn, err := grpc.NewClient( - "passthrough:///xtcp2-grpc-uds-test", +func dialUnix(t *testing.T, sock string) *grpc.ClientConn { + t.Helper() + conn, err := grpc.NewClient("passthrough:///xtcp2-grpc-test", grpc.WithContextDialer(func(ctx context.Context, _ string) (net.Conn, error) { var d net.Dialer - return d.DialContext(ctx, "unix", socketPath) + return d.DialContext(ctx, "unix", sock) }), grpc.WithTransportCredentials(insecure.NewCredentials()), ) if err != nil { - t.Fatalf("grpc.NewClient unix: %v", err) + t.Fatal(err) } - _, err = healthpb.NewHealthClient(conn).Check(context.Background(), &healthpb.HealthCheckRequest{}) - if err != nil { - t.Fatalf("health check over unix socket: %v", err) + t.Cleanup(func() { _ = conn.Close() }) + return conn +} + +// TestStartGRPCServers covers what a gRPC listener serves by class. A +// grpc-read listener registers read-only adapters, so every admin RPC is +// Unimplemented there whatever the auth policy; grpc-admin registers all. +func TestStartGRPCServers(t *testing.T) { + type rpc func(ctx context.Context, conn *grpc.ClientConn) error + health := func(ctx context.Context, c *grpc.ClientConn) error { + _, err := healthpb.NewHealthClient(c).Check(ctx, &healthpb.HealthCheckRequest{}) + return err + } + get := func(ctx context.Context, c *grpc.ClientConn) error { + _, err := xtcp_config.NewConfigServiceClient(c).Get(ctx, &xtcp_config.GetRequest{}) + return err } - if err := conn.Close(); err != nil { - t.Fatalf("close client: %v", err) + setFreq := func(ctx context.Context, c *grpc.ClientConn) error { + _, err := xtcp_config.NewConfigServiceClient(c).SetPollFrequency(ctx, + &xtcp_config.SetPollFrequencyRequest{PollFrequency: durationpb.New(2 * time.Second), PollTimeout: durationpb.New(time.Second)}) + return err } + rebaseline := func(ctx context.Context, c *grpc.ClientConn) error { + _, err := linkmonitorpb.NewLinkMonitorServiceClient(c).Rebaseline(ctx, &linkmonitorpb.RebaselineRequest{}) + return err + } + pollRecords := func(ctx context.Context, c *grpc.ClientConn) error { + s, err := xtcp_flat_record.NewXTCPFlatRecordServiceClient(c).PollFlatRecords(ctx) + if err != nil { + return err + } + _, err = s.Recv() + return err + } + cases := []struct { + name string + category string + description string + serves string + call rpc + expected codes.Code // codes.OK = anything but Unimplemented + }{ + {"read_health", "positive", "grpc-read serves health", "grpc-read", health, codes.OK}, + {"read_get", "positive", "grpc-read serves ConfigService.Get", "grpc-read", get, codes.OK}, + {"read_set_unimplemented", "negative", "grpc-read has no SetPollFrequency handler", "grpc-read", setFreq, codes.Unimplemented}, + {"read_rebaseline_unimplemented", "negative", "grpc-read has no Rebaseline handler", "grpc-read", rebaseline, codes.Unimplemented}, + {"read_poll_unimplemented", "corner", "PollFlatRecords drives polls, so it is admin", "grpc-read", pollRecords, codes.Unimplemented}, + {"admin_set", "positive", "grpc-admin serves SetPollFrequency", "grpc-admin", setFreq, codes.OK}, + {"admin_get", "boundary", "grpc-admin also serves the read methods", "grpc-admin", get, codes.OK}, + } + for _, tc := range cases { + t.Run(tc.category+"/"+tc.name, func(t *testing.T) { + x := newGRPCServerFixture(t) + l, sock := bindGRPC(t, tc.serves) + x.SetGRPCListeners([]GRPCListener{l}) + ctx, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + x.startGRPCServers(ctx) - cancel() - select { - case <-done: - case <-time.After(2 * time.Second): - t.Fatal("gRPC UDS server did not stop after context cancel") + callCtx, callCancel := context.WithTimeout(ctx, 2*time.Second) + defer callCancel() + err := tc.call(callCtx, dialUnix(t, sock)) + got := status.Code(err) + if tc.expected == codes.Unimplemented { + if got != codes.Unimplemented { + t.Fatalf("%s: code = %v (%v), want Unimplemented", tc.description, got, err) + } + return + } + if got == codes.Unimplemented { + t.Fatalf("%s: Unimplemented, want the method served (%v)", tc.description, err) + } + }) } - if _, err := os.Lstat(socketPath); !os.IsNotExist(err) { - t.Fatalf("socket should be removed on shutdown, stat err=%v", err) +} + +// TestStartGRPCServers_none: with no gRPC listener there is no server and no +// flat-record service, and the poll path's send is a no-op, not a panic. +func TestStartGRPCServers_none(t *testing.T) { + x := newGRPCServerFixture(t) + x.startGRPCServers(context.Background()) + if x.flatRecordService != nil || x.grpcHealth != nil { + t.Fatalf("services built with no gRPC listener: %v %v", x.flatRecordService, x.grpcHealth) + } + x.flatRecordServiceSend(&xtcp_flat_record.XtcpFlatRecord{}) + x.setReady(true) // nil grpcHealth is fine +} + +// TestStartGRPCServers_shutdown: canceling the run stops the server and the +// Unix socket is removed. +func TestStartGRPCServers_shutdown(t *testing.T) { + x := newGRPCServerFixture(t) + l, sock := bindGRPC(t, "grpc-read") + x.SetGRPCListeners([]GRPCListener{l}) + ctx, cancel := context.WithCancel(context.Background()) + x.startGRPCServers(ctx) + st, err := os.Lstat(sock) + if err != nil || st.Mode().Perm() != 0o660 { + t.Fatalf("socket %s: %v mode %v, want 0660", sock, err, st) + } + cancel() + deadline := time.Now().Add(2 * time.Second) + for { + if _, err := os.Lstat(sock); os.IsNotExist(err) { + return + } + if time.Now().After(deadline) { + t.Fatal("socket still present after shutdown") + } + time.Sleep(10 * time.Millisecond) } } diff --git a/pkg/xtcp/linkmonitor.go b/pkg/xtcp/linkmonitor.go index c9e049268..0dbf07da7 100644 --- a/pkg/xtcp/linkmonitor.go +++ b/pkg/xtcp/linkmonitor.go @@ -47,9 +47,6 @@ type linkMonitorPaths struct { allPath string ipPaths bool ipMaxBytes int - // ipListen, when set, moves /ip and /i off the Prometheus listener onto - // a loopback listener of their own (LinkMonitorIPHandler). - ipListen string } // newLinkMonitorPaths applies the defaults: every category, interface paths @@ -57,7 +54,7 @@ type linkMonitorPaths struct { func newLinkMonitorPaths(c *xtcp_config.LinkMonitorConfig) linkMonitorPaths { p := linkMonitorPaths{ categories: monitorprom.Categories(), interfacePaths: true, allPath: DefaultLinkMonitorAllPath, - ipPaths: c.GetIpPaths(), ipMaxBytes: int(c.GetIpMaxBytes()), ipListen: c.GetIpListen(), + ipPaths: c.GetIpPaths(), ipMaxBytes: int(c.GetIpMaxBytes()), } if c == nil { return p @@ -291,23 +288,23 @@ func (x *XTCP) setLinkMonitorUp(up bool) { x.pGV.WithLabelValues("linkMonitor", "up", "gauge").Set(v) } -// LinkMonitorHandler builds the embedded link monitor's detail paths for the -// listener that serves promPath: promPath/ with -// promPath//, the all-metrics path with its interface -// views and, when enabled without their own listener, the /ip and /i paths. -// It is nil without a monitor. Unknown paths are 404, and every path is 503 -// once the monitor has failed. Call it once per daemon; the listener's own -// auth policy applies. +// LinkMonitorHandler builds the embedded link monitor's detail paths (the +// metrics-detail endpoint class): promPath/ with +// promPath//, and the all-metrics path with its +// interface views. It is nil without a monitor. Unknown paths are 404, and +// every path is 503 once the monitor has failed. The /ip paths are a class of +// their own (LinkMonitorIPHandler), but with ip_paths on they still reserve +// /ip and /i, so a promPath there is refused whichever listener serves them. +// Call it once per daemon; the serving listener's auth policy applies. func (x *XTCP) LinkMonitorHandler(promPath string) (http.Handler, error) { if x.linkMonitor == nil { return nil, nil } p := x.linkMonitorPaths - ipHere := p.ipPaths && p.ipListen == "" prefix := strings.TrimSuffix(promPath, "/") + "/" layout := linkmonitorhttp.Paths{ CategoryPrefix: prefix, Categories: p.categories, AllPath: p.allPath, - InterfacePaths: p.interfacePaths, IPPaths: ipHere, + InterfacePaths: p.interfacePaths, IPPaths: p.ipPaths, Reserved: []string{promPath, "/healthz", "/readyz", "/debug/pprof/"}, } if err := layout.Validate(); err != nil { @@ -323,23 +320,15 @@ func (x *XTCP) LinkMonitorHandler(promPath string) (http.Handler, error) { return nil, fmt.Errorf("link monitor paths: %w", err) } } - if ipHere { - ip, err := linkmonitorhttp.IPRoute(goiphttp.Options{MaxBytes: p.ipMaxBytes}) - if err != nil { - return nil, fmt.Errorf("link monitor ip paths: %w", err) - } - routes = append(routes, ip) - } return x.linkMonitorMux(routes), nil } -// LinkMonitorIPHandler builds the /ip and /i paths for their own listener, -// set by ip_listen. It is nil without a monitor, with the /ip paths off, or -// with no ip_listen, when LinkMonitorHandler serves them instead. Every path -// is 503 once the monitor has failed, as on the Prometheus listener. +// LinkMonitorIPHandler builds the /ip and /i paths (the ip endpoint class). +// It is nil without a monitor or with ip_paths off. Every path is 503 once +// the monitor has failed. func (x *XTCP) LinkMonitorIPHandler() (http.Handler, error) { p := x.linkMonitorPaths - if x.linkMonitor == nil || !p.ipPaths || p.ipListen == "" { + if x.linkMonitor == nil || !p.ipPaths { return nil, nil } ip, err := linkmonitorhttp.IPRoute(goiphttp.Options{MaxBytes: p.ipMaxBytes}) diff --git a/pkg/xtcp/linkmonitor_http_test.go b/pkg/xtcp/linkmonitor_http_test.go index c8e1bd71d..6394a53fe 100644 --- a/pkg/xtcp/linkmonitor_http_test.go +++ b/pkg/xtcp/linkmonitor_http_test.go @@ -279,63 +279,55 @@ func TestLinkMonitorHandler(t *testing.T) { } } -// TestLinkMonitorIPHandler covers where the /ip and /i paths are served: on -// the Prometheus listener by default, on their own listener with ip_listen, -// and nowhere with ip_paths off. +// TestLinkMonitorIPHandler covers the split between the detail handler +// (metrics-detail) and the /ip handler (ip): each class is its own handler, +// so cmd/xtcp2 can put them on different listeners. func TestLinkMonitorIPHandler(t *testing.T) { type request struct { path string code int } - const loopback = "127.0.0.1:9089" tests := []struct { category, description, expected string config *xtcp_config.LinkMonitorConfig disabled, down bool promPath string + wantErr bool prom, ip []request // nil ip: no /ip handler }{ { - category: "positive", description: "ip_listen moves /ip and /i off the Prometheus listener", - expected: "404 on the Prometheus listener, 200 on the /ip listener", - config: &xtcp_config.LinkMonitorConfig{CollectionMode: "poll", IpPaths: true, IpListen: loopback}, + category: "positive", description: "ip_paths gives /ip and /i a handler of their own", + expected: "404 in the detail handler, 200 in the /ip handler", + config: &xtcp_config.LinkMonitorConfig{CollectionMode: "poll", IpPaths: true}, prom: []request{{"/ip/link", http.StatusNotFound}, {"/i/l", http.StatusNotFound}, {"/metrics/link", http.StatusOK}}, ip: []request{{"/ip/link", http.StatusOK}, {"/i/l", http.StatusOK}}, }, { - category: "positive", description: "without ip_listen the Prometheus listener keeps them", - expected: "200 on the Prometheus listener, no /ip handler", - config: &xtcp_config.LinkMonitorConfig{CollectionMode: "poll", IpPaths: true}, - prom: []request{{"/ip/link", http.StatusOK}, {"/i/l", http.StatusOK}}, - }, - { - category: "negative", description: "ip_listen without ip_paths serves /ip nowhere", - expected: "404 on the Prometheus listener, no /ip handler", - config: &xtcp_config.LinkMonitorConfig{CollectionMode: "poll", IpListen: loopback}, - prom: []request{{"/ip/link", http.StatusNotFound}}, + category: "negative", description: "without ip_paths there is no /ip handler", + expected: "404 in the detail handler, no /ip handler", + config: &xtcp_config.LinkMonitorConfig{CollectionMode: "poll"}, + prom: []request{{"/ip/link", http.StatusNotFound}, {"/metrics/link", http.StatusOK}}, }, { - category: "negative", description: "a disabled monitor has no /ip handler", + category: "negative", description: "a disabled monitor has no handlers", expected: "nil handlers", - config: &xtcp_config.LinkMonitorConfig{IpPaths: true, IpListen: loopback}, disabled: true, + config: &xtcp_config.LinkMonitorConfig{IpPaths: true}, disabled: true, }, { - category: "boundary", description: "the /ip listener serves only /ip and /i", + category: "boundary", description: "the /ip handler serves only /ip and /i", expected: "404 for the detail and health paths there", - config: &xtcp_config.LinkMonitorConfig{CollectionMode: "poll", IpPaths: true, IpListen: loopback}, + config: &xtcp_config.LinkMonitorConfig{CollectionMode: "poll", IpPaths: true}, ip: []request{{"/metrics/link", http.StatusNotFound}, {"/metrics-all", http.StatusNotFound}, {"/readyz", http.StatusNotFound}, {"/", http.StatusNotFound}}, }, { - category: "corner", description: "with ip_listen, promPath /ip no longer collides", - expected: "no error; the categories serve under /ip/ on the Prometheus listener", - config: &xtcp_config.LinkMonitorConfig{CollectionMode: "poll", IpPaths: true, IpListen: loopback}, promPath: "/ip", - prom: []request{{"/ip/link", http.StatusOK}}, - ip: []request{{"/ip/link", http.StatusOK}}, + category: "corner", description: "promPath /ip collides with the /ip paths whichever listener serves them", + expected: "an error from LinkMonitorHandler", + config: &xtcp_config.LinkMonitorConfig{CollectionMode: "poll", IpPaths: true}, promPath: "/ip", wantErr: true, }, { - category: "corner", description: "a failed monitor answers 503 on the /ip listener too", + category: "corner", description: "a failed monitor answers 503 on the /ip handler too", expected: "503", - config: &xtcp_config.LinkMonitorConfig{CollectionMode: "poll", IpPaths: true, IpListen: loopback}, down: true, + config: &xtcp_config.LinkMonitorConfig{CollectionMode: "poll", IpPaths: true}, down: true, ip: []request{{"/ip/link", http.StatusServiceUnavailable}}, }, } @@ -363,8 +355,11 @@ func TestLinkMonitorIPHandler(t *testing.T) { promPath = "/metrics" } prom, err := x.LinkMonitorHandler(promPath) - if err != nil { - t.Fatal(err) + if (err != nil) != tc.wantErr { + t.Fatalf("LinkMonitorHandler err = %v, want error %t", err, tc.wantErr) + } + if tc.wantErr { + return } ip, err := x.LinkMonitorIPHandler() if err != nil { @@ -376,12 +371,12 @@ func TestLinkMonitorIPHandler(t *testing.T) { } return } - serve(t, "prometheus listener", prom, tc.prom) + serve(t, "detail handler", prom, tc.prom) if (ip != nil) != (tc.ip != nil) { t.Fatalf("/ip handler present = %t, want %t", ip != nil, tc.ip != nil) } if ip != nil { - serve(t, "/ip listener", ip, tc.ip) + serve(t, "/ip handler", ip, tc.ip) } }) } diff --git a/pkg/xtcp/redact_secrets_test.go b/pkg/xtcp/redact_secrets_test.go index e8abd7263..d33752332 100644 --- a/pkg/xtcp/redact_secrets_test.go +++ b/pkg/xtcp/redact_secrets_test.go @@ -15,11 +15,16 @@ var secretFieldName = regexp.MustCompile(`(^|_)(key|token|secret|password|passwd // notSecretFields are matches that are not credentials. Adding a name here is // a reviewed decision; a new credential field must go in RedactSecrets. -var notSecretFields = map[protoreflect.FullName]bool{} +var notSecretFields = map[protoreflect.FullName]bool{ + // Paths to credential files, not credentials: the config carries the + // path and the listener reads the file when it starts. + "xtcp_config.v1.ListenerAuth.raw_token_file": true, + "xtcp_config.v1.ListenerAuth.hmac_shared_key_file": true, +} // fillSecretLike sets every string field of m (recursing into singular -// message fields) whose name matches secretFieldName, and returns their -// full names. +// message fields, and into one appended element of each repeated message +// field) whose name matches secretFieldName, and returns their full names. func fillSecretLike(m protoreflect.Message, depth int) []protoreflect.FullName { if depth > 8 { return nil @@ -29,8 +34,15 @@ func fillSecretLike(m protoreflect.Message, depth int) []protoreflect.FullName { for i := 0; i < fields.Len(); i++ { fd := fields.Get(i) switch { - case fd.IsList() || fd.IsMap(): + case fd.IsMap(): continue + case fd.IsList(): + if fd.Kind() == protoreflect.MessageKind { + list := m.Mutable(fd).List() + elem := list.NewElement() + names = append(names, fillSecretLike(elem.Message(), depth+1)...) + list.Append(elem) + } case fd.Kind() == protoreflect.MessageKind: names = append(names, fillSecretLike(m.Mutable(fd).Message(), depth+1)...) case fd.Kind() == protoreflect.StringKind && secretFieldName.MatchString(string(fd.Name())): @@ -76,7 +88,13 @@ func TestRedactSecretsCoversSecretLikeFields(t *testing.T) { } m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { switch { - case fd.IsList() || fd.IsMap(): + case fd.IsMap(): + case fd.IsList(): + if fd.Kind() == protoreflect.MessageKind { + for i := 0; i < v.List().Len(); i++ { + check(v.List().Get(i).Message(), depth+1) + } + } case fd.Kind() == protoreflect.MessageKind: check(v.Message(), depth+1) case fd.Kind() == protoreflect.StringKind && v.String() == "secret-value" && !notSecretFields[fd.FullName()]: diff --git a/pkg/xtcp/xtcp.go b/pkg/xtcp/xtcp.go index 28806bc6f..f6b61e774 100644 --- a/pkg/xtcp/xtcp.go +++ b/pkg/xtcp/xtcp.go @@ -204,8 +204,10 @@ type XTCP struct { linkMonitorDown atomic.Bool flatRecordService *xtcpFlatRecordService - configService *xtcpConfigService - grpcHealth *grpchealth.Server + // grpcListeners are the gRPC listeners to serve (SetGRPCListeners). + grpcListeners []GRPCListener + configService *xtcpConfigService + grpcHealth *grpchealth.Server // reconfigureFunc is the process-level "soft restart" hook. The gRPC // ConfigService.Set handler calls it with a validated new config; the cmd @@ -331,7 +333,7 @@ func NewXTCP(ctx context.Context, cancel context.CancelFunc, config *xtcp_config // OnReconfigure registers the process-level soft-restart hook, invoked by the // gRPC ConfigService.Set handler with a validated new config. Must be called // after NewXTCP and before RunWithPoller, so it is set before the gRPC config -// service is constructed in startGRPCflatRecordService. See cmd/xtcp2. +// service is constructed in startGRPCServers. See cmd/xtcp2. func (x *XTCP) OnReconfigure(f func(*xtcp_config.XtcpConfig)) { x.reconfigureFunc = f } @@ -392,7 +394,7 @@ func (x *XTCP) Run(ctx context.Context, wg *sync.WaitGroup, runPoller bool) { x.pC.WithLabelValues("Run", "start", "counter").Inc() - go x.startGRPCflatRecordService(ctx) + x.startGRPCServers(ctx) if x.linkMonitor != nil { workers.Add(1) diff --git a/proto/xtcp_config/v1/xtcp_config.proto b/proto/xtcp_config/v1/xtcp_config.proto index d76b2f2f8..215497d27 100644 --- a/proto/xtcp_config/v1/xtcp_config.proto +++ b/proto/xtcp_config/v1/xtcp_config.proto @@ -346,6 +346,21 @@ message ListenerAuth { gte: { seconds: 0 } }]; + // Path to a file holding raw_token, read when the listener starts. For a + // per-listener credential (Listener.auth / admin_auth), so the config + // carries a path rather than the secret. The file must be a regular file + // with no group or other permission bits. + string raw_token_file = 7 [ + (buf.validate.field).string = { + max_len: 4096, + }]; + + // Path to a file holding hmac_shared_key; as raw_token_file. + string hmac_shared_key_file = 8 [ + (buf.validate.field).string = { + max_len: 4096, + }]; + option (buf.validate.message).cel = { id: "ListenerAuth.failureJitter", message: "failure_jitter_max must be greater than or equal to failure_jitter_min", @@ -353,6 +368,68 @@ message ListenerAuth { }; } +// EndpointClass groups the paths and RPCs a listener can serve. Every served +// path or RPC belongs to exactly one class, and a class is served by at most +// one listener; a class no listener names is not served at all. +enum EndpointClass { + ENDPOINT_CLASS_UNSPECIFIED = 0; + // /healthz, /readyz. + ENDPOINT_CLASS_HEALTH = 1; + // The core Prometheus path (-promPath, /metrics). + ENDPOINT_CLASS_METRICS = 2; + // The link monitor detail paths: /metrics/[/] and + // /metrics-all[/]. + ENDPOINT_CLASS_METRICS_DETAIL = 3; + // /ip and /i (goip show, GET-only). Needs link_monitor.ip_paths. + ENDPOINT_CLASS_IP = 4; + // /debug/pprof/* except cmdline, which is never served. + ENDPOINT_CLASS_DEBUG = 5; + // gRPC read methods: FlatRecords, ConfigService.Get, the link monitor's + // GetStatus/List*, health and reflection. Admin methods answer + // Unimplemented on a listener that serves only this class. + ENDPOINT_CLASS_GRPC_READ = 6; + // Every gRPC method, admin ones included (Set*, TriggerPoll*, + // PollFlatRecords, Rebaseline, Resync). + ENDPOINT_CLASS_GRPC_ADMIN = 7; +} + +// A listener: one socket, one credential pair, and the endpoint classes it +// serves. See docs/security.md#listeners for the rules checked at startup. +message Listener { + string name = 1 [ + (buf.validate.field).string = { + min_len: 1, + max_len: 32, + pattern: "^[a-z][a-z0-9-]*$" + }]; + + // network unix, or tcp typed explicitly. An unset network with an + // address that is an absolute path means unix. + ListenerEndpoint endpoint = 2 [ + (buf.validate.field).required = true + ]; + + // Unset: the daemon-wide listener_auth (-listenerAuthMode and the + // LISTENER_* variables). An unspecified mode means raw. + ListenerAuth auth = 3; + + // Unset: the daemon-wide admin_listener_auth. + ListenerAuth admin_auth = 4; + + repeated EndpointClass serves = 5 [ + (buf.validate.field).repeated = { + min_items: 1, + max_items: 7, + unique: true, + items: { + enum: { + defined_only: true, + not_in: [0] + } + } + }]; +} + // Embedded physical link monitor (pkg/linkmonitor), the same one the // standalone go-link-monitor runs. Unset durations and empty strings take the // library defaults (see linkmonitor.DefaultConfig); xtcp2 supplies its own @@ -1124,10 +1201,10 @@ message XtcpConfig { // ---- gRPC (160-169) ------------------------------------------------------ // GRPC listening port + // Legacy: the gRPC port when -grpcPort (or GRPC_PORT) expands into a + // listener. 0 when the listener model configures gRPC. uint32 grpc_port = 160 [ - (buf.validate.field).required = true, (buf.validate.field).uint32 = { - gte: 1, lte: 65535 }]; @@ -1137,6 +1214,15 @@ message XtcpConfig { (buf.validate.field).required = false ]; + // Every listener the daemon opens (-listener, LISTENERS). Empty means the + // default: one UDS, /run/xtcp2/metrics.sock mode 0600, raw bearer auth, + // serving health, metrics and metrics-detail. The legacy -promListen*, + // -grpc* and -linkMonitorIPListen flags expand into entries here. + repeated Listener listeners = 162 [ + (buf.validate.field).repeated = { + max_items: 16 + }]; + // ---- profiling (170-179) ------------------------------------------------- // Pyroscope continuous-profiling server URL (e.g.