aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpp-api')
-rw-r--r--src/vpp-api/client/stat_client.c23
-rw-r--r--src/vpp-api/client/stat_client.h2
2 files changed, 24 insertions, 1 deletions
diff --git a/src/vpp-api/client/stat_client.c b/src/vpp-api/client/stat_client.c
index 2cf53d5d0af..25a37f76da8 100644
--- a/src/vpp-api/client/stat_client.c
+++ b/src/vpp-api/client/stat_client.c
@@ -252,8 +252,29 @@ copy_data (stat_segment_directory_entry_t * ep, stat_client_main_t * sm)
result.error_value = error_base[ep->index];
break;
+ case STAT_DIR_TYPE_NAME_VECTOR:
+ if (ep->offset == 0)
+ return result;
+ uint8_t **name_vector =
+ stat_segment_pointer (sm->shared_header, ep->offset);
+ result.name_vector = vec_dup (name_vector);
+ offset_vector =
+ stat_segment_pointer (sm->shared_header, ep->offset_vector);
+ for (i = 0; i < vec_len (name_vector); i++)
+ {
+ if (offset_vector[i])
+ {
+ u8 *name =
+ stat_segment_pointer (sm->shared_header, offset_vector[i]);
+ result.name_vector[i] = vec_dup (name);
+ }
+ else
+ result.name_vector[i] = 0;
+ }
+ break;
+
default:
- fprintf (stderr, "Unknown type: %d", ep->type);
+ fprintf (stderr, "Unknown type: %d\n", ep->type);
}
return result;
}
diff --git a/src/vpp-api/client/stat_client.h b/src/vpp-api/client/stat_client.h
index 89f6fe53ea4..23087abe749 100644
--- a/src/vpp-api/client/stat_client.h
+++ b/src/vpp-api/client/stat_client.h
@@ -28,6 +28,7 @@ typedef enum
STAT_DIR_TYPE_COUNTER_VECTOR_SIMPLE,
STAT_DIR_TYPE_COUNTER_VECTOR_COMBINED,
STAT_DIR_TYPE_ERROR_INDEX,
+ STAT_DIR_TYPE_NAME_VECTOR,
} stat_directory_type_t;
/* Default socket to exchange segment fd */
@@ -45,6 +46,7 @@ typedef struct
uint64_t error_value;
counter_t **simple_counter_vec;
vlib_counter_t **combined_counter_vec;
+ uint8_t **name_vector;
};
} stat_segment_data_t;