#include <rte_string_fns.h>
#include "rte_telemetry_parser.h"
+#include "rte_telemetry_internal.h"
enum choices {
INV_ACTION_VAL,
#define TEST_CLIENT "/var/run/dpdk/test_client"
-int32_t
+static int32_t
rte_telemetry_create_test_socket(struct telemetry_impl *telemetry,
const char *test_client_path)
{
return 0;
}
-int32_t
+static int32_t
rte_telemetry_format_port_stat_ids(int *port_ids, int num_port_ids,
const char * const *stat_names, int num_stat_names, json_t **data)
{
return -1;
}
-int32_t
-rte_telemetry_create_json_request(int action, char *command,
+static int32_t
+rte_telemetry_create_json_request(int action, const char *command,
const char *client_path, int *port_ids, int num_port_ids,
const char * const *stat_names, int num_stat_names, char **request,
int inv_choice)
return -1;
}
-int32_t
+static int32_t
rte_telemetry_send_get_ports_and_stats_request(struct telemetry_impl *telemetry,
- int action_choice, char *command_choice, int inv_choice)
+ int action_choice, const char *command_choice, int inv_choice)
{
int ret;
char *request;
- char *client_path_data = NULL;
+ const char *client_path_data = NULL;
if (telemetry == NULL) {
TELEMETRY_LOG_ERR("Telemetry argument has not been initialised");
return 0;
}
-int32_t
+static int32_t
rte_telemetry_send_get_ports_details_request(struct telemetry_impl *telemetry,
int action_choice, int *port_ids, int num_port_ids, int inv_choice)
{
return -EINVAL;
}
- char *command = "ports_details";
+ const char *command = "ports_details";
if (inv_choice == INV_ACTION_VAL)
action_choice = -1;
return 0;
}
-int32_t
+static int32_t
rte_telemetry_send_stats_values_by_name_request(struct telemetry_impl
*telemetry, int action_choice, int *port_ids, int num_port_ids,
const char * const *stat_names, int num_stat_names,
{
int ret;
char *request;
- char *command = "ports_stats_values_by_name";
+ const char *command = "ports_stats_values_by_name";
if (telemetry == NULL) {
TELEMETRY_LOG_ERR("Telemetry argument has not been initialised");
return 0;
}
-int32_t
+static int32_t
rte_telemetry_send_unreg_request(struct telemetry_impl *telemetry,
int action_choice, const char *client_path, int inv_choice)
{
return -EINVAL;
}
- char *command = "clients";
+ const char *command = "clients";
if (inv_choice == INV_ACTION_VAL)
action_choice = -1;
};
-#define NUM_TEST_TYPES (sizeof(test_types)/sizeof(const char * const))
-
uint32_t i;
- for (i = 0; i < NUM_TEST_TYPES; i++) {
+ for (i = 0; i < RTE_DIM(test_types); i++) {
TELEMETRY_LOG_INFO("%s", test_types[i]);
ret = rte_telemetry_send_get_ports_and_stats_request(telemetry,