aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python/vpp_papi/vpp_serializer.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpp-api/python/vpp_papi/vpp_serializer.py')
-rw-r--r--src/vpp-api/python/vpp_papi/vpp_serializer.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_serializer.py b/src/vpp-api/python/vpp_papi/vpp_serializer.py
index cac6dd61791..240912d96ba 100644
--- a/src/vpp-api/python/vpp_papi/vpp_serializer.py
+++ b/src/vpp-api/python/vpp_papi/vpp_serializer.py
@@ -62,6 +62,13 @@ types['f64'] = BaseTypes('f64')
types['bool'] = BaseTypes('bool')
+def vpp_get_type(name):
+ try:
+ return types[name]
+ except KeyError:
+ return None
+
+
class FixedList_u8():
def __init__(self, name, field_type, num):
self.name = name
@@ -202,6 +209,9 @@ class VPPEnumType():
def __getattr__(self, name):
return self.enum[name]
+ def __nonzero__(self):
+ return True
+
def pack(self, data, kwargs=None):
return types['u32'].pack(data, kwargs)