diff options
author | Ole Troan <ot@cisco.com> | 2018-10-22 09:41:29 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-10-22 08:27:17 +0000 |
commit | 8254018c21bbdbbc11225ebc444b1d072606caf7 (patch) | |
tree | 7f6a9989040e3480cce09910b9f3a6b6a76db899 /src/vpp-api | |
parent | be5a5dd904d4d25857c53a4b5dee7951f724e3e2 (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>
Diffstat (limited to 'src/vpp-api')
-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); |