diff options
author | Ole Troan <ot@cisco.com> | 2018-10-22 09:41:29 +0200 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2018-10-22 16:34:34 +0000 |
commit | 9734c0a494a0cb62bfb4bd9fff19086bd95ba5fa (patch) | |
tree | 26676a3cecb9bf7c3214d4458706e734475df175 | |
parent | 6a7103de937ccf3c8efae0357b12db3b6f8f08b4 (diff) |
stats: Add wrapper for vec_free
The result vector from stat_segment_ls must be freed
by the caller. Add wrapper for non-C language bindings.
Change-Id: I7eee7f80ec98b41696d354add47b26978e12ef0f
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit 8254018c21bbdbbc11225ebc444b1d072606caf7)
-rw-r--r-- | src/vpp-api/client/libvppapiclient.map | 1 | ||||
-rw-r--r-- | src/vpp-api/client/stat_client.c | 6 | ||||
-rw-r--r-- | src/vpp-api/client/stat_client.h | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/vpp-api/client/libvppapiclient.map b/src/vpp-api/client/libvppapiclient.map index 00a26fbc90e..cb3d18b4de0 100644 --- a/src/vpp-api/client/libvppapiclient.map +++ b/src/vpp-api/client/libvppapiclient.map @@ -21,5 +21,6 @@ VPPAPICLIENT_18.10 { stat_segment_heartbeat; stat_segment_string_vector; stat_segment_vec_len; + stat_segment_vec_free; local: *; }; diff --git a/src/vpp-api/client/stat_client.c b/src/vpp-api/client/stat_client.c index 1c099edc789..0042a2be4e4 100644 --- a/src/vpp-api/client/stat_client.c +++ b/src/vpp-api/client/stat_client.c @@ -364,6 +364,12 @@ stat_segment_vec_len (void *vec) return vec_len (vec); } +void +stat_segment_vec_free (void *vec) +{ + vec_free (vec); +} + /* Create a vector from a string (or add to existing) */ u8 ** stat_segment_string_vector (u8 ** string_vector, char *string) diff --git a/src/vpp-api/client/stat_client.h b/src/vpp-api/client/stat_client.h index c1a0ecf4753..ef16e4246dc 100644 --- a/src/vpp-api/client/stat_client.h +++ b/src/vpp-api/client/stat_client.h @@ -38,6 +38,7 @@ int stat_segment_connect (char *socket_name); void stat_segment_disconnect (void); uint8_t **stat_segment_string_vector (uint8_t ** string_vector, char *string); int stat_segment_vec_len (void *vec); +void stat_segment_vec_free (void *vec); uint32_t *stat_segment_ls (uint8_t ** pattern); stat_segment_data_t *stat_segment_dump (uint32_t * counter_vec); stat_segment_data_t *stat_segment_dump_entry (uint32_t index); |