aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python/vpp_papi/vpp_stats.py
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-04-30 10:04:36 +0200
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2019-06-07 10:38:35 +0000
commit85465588b18fef9c4712f864f512e00741e2d4f2 (patch)
treed5914b37782edfa7d85a2366e080ca97bc7ece1f /src/vpp-api/python/vpp_papi/vpp_stats.py
parent8dbfb433619011b649b1b511ad88969a7f909861 (diff)
API: Add support for "defaults"
Add support in the API language for specifying a field default. Add default support in Python binding. define foo { u16 mtu [default = 1500]; }; This is client side only. I.e. if the mtu argument is not passed to the foo function, the client language binding will set it default to 1500. Change-Id: I5df43f3cd87cb300b40ca38e15dcab25b40e424a Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vpp-api/python/vpp_papi/vpp_stats.py')
-rw-r--r--src/vpp-api/python/vpp_papi/vpp_stats.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_stats.py b/src/vpp-api/python/vpp_papi/vpp_stats.py
index 76ccf1042f6..de72249ac6b 100644
--- a/src/vpp-api/python/vpp_papi/vpp_stats.py
+++ b/src/vpp-api/python/vpp_papi/vpp_stats.py
@@ -73,7 +73,8 @@ void stat_segment_disconnect (void);
uint32_t *stat_segment_ls_r (uint8_t ** patterns, stat_client_main_t * sm);
uint32_t *stat_segment_ls (uint8_t ** pattern);
-stat_segment_data_t *stat_segment_dump_r (uint32_t * stats, stat_client_main_t * sm);
+stat_segment_data_t *stat_segment_dump_r (uint32_t * stats,
+ stat_client_main_t * sm);
stat_segment_data_t *stat_segment_dump (uint32_t * counter_vec);
void stat_segment_data_free (stat_segment_data_t * res);
@@ -133,7 +134,9 @@ def error_vec_list(api, e):
return vec
def name_vec_list(api, e):
- return [ffi.string(e[i]).decode('utf-8') for i in range(api.stat_segment_vec_len(e)) if e[i] != ffi.NULL]
+ return [ffi.string(e[i]).decode('utf-8') for i in
+ range(api.stat_segment_vec_len(e)) if e[i] != ffi.NULL]
+
def stat_entry_to_python(api, e):
# Scalar index
@@ -222,7 +225,8 @@ class VPPStats(object):
if rv == ffi.NULL:
raise VPPStatsIOError()
- return [ffi.string(self.api.stat_segment_index_to_name_r(rv[i], self.client)).decode('utf-8')
+ return [ffi.string(self.api.stat_segment_index_to_name_r(
+ rv[i], self.client)).decode('utf-8')
for i in range(self.api.stat_segment_vec_len(rv))]
def dump(self, counters):