1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Intel Corporation
5 #ifndef _RTE_TELEMETRY_LEGACY_H_
6 #define _RTE_TELEMETRY_LEGACY_H_
8 #include <rte_compat.h>
9 #include "rte_telemetry.h"
14 * @b EXPERIMENTAL: this API may change without prior notice
17 * RTE Telemetry Legacy
23 * Value representing if data is required for the command
25 enum rte_telemetry_legacy_data_req {
31 * This telemetry callback is used when registering a legacy telemetry command.
32 * It handles getting and formatting stats to be returned to telemetry when
33 * requested. Stats up to buf_len in length are put in the buffer.
36 * The cmd that was requested by the client.
38 * Contains data required by the callback function.
40 * A buffer to hold the formatted response.
42 * Length of the buffer.
45 * Length of buffer used on success.
47 * Negative integer on error.
49 typedef int (*telemetry_legacy_cb)(const char *cmd, const char *params,
50 char *buffer, int buf_len);
54 * Counter for the number of registered legacy callbacks
56 extern int num_legacy_callbacks;
60 * Used for handling data received over the legacy telemetry socket.
66 legacy_client_handler(void *sock_id);
71 * Used when registering a command and callback function with
72 * telemetry legacy support.
77 * -EINVAL for invalid parameters failure.
79 * -ENOENT if max callbacks limit has been reached.
83 rte_telemetry_legacy_register(const char *cmd,
84 enum rte_telemetry_legacy_data_req data_req,
85 telemetry_legacy_cb fn);