aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python/vpp_papi/vpp_serializer.py
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2018-11-27 10:05:23 +0100
committerOle Trøan <otroan@employees.org>2018-12-06 14:05:04 +0000
commit8c8acc027871f97370ee549306876690030c3bbb (patch)
tree36e3c8b05d8112105739a5e809ed7fa7d80ab785 /src/vpp-api/python/vpp_papi/vpp_serializer.py
parent1f0dd7a0664bc217b7d69773574ac7eae3813bd7 (diff)
API: Change ip4_address and ip6_address to use type alias.
Change-Id: Id8669bbadd1d6b2054865a310a654e9b38d1667d Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vpp-api/python/vpp_papi/vpp_serializer.py')
-rw-r--r--src/vpp-api/python/vpp_papi/vpp_serializer.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_serializer.py b/src/vpp-api/python/vpp_papi/vpp_serializer.py
index f78972979cd..13721ff88d4 100644
--- a/src/vpp-api/python/vpp_papi/vpp_serializer.py
+++ b/src/vpp-api/python/vpp_papi/vpp_serializer.py
@@ -79,7 +79,7 @@ class FixedList_u8(object):
self.packer = BaseTypes(field_type, num)
self.size = self.packer.size
- def pack(self, list, kwargs = None):
+ def pack(self, list, kwargs=None):
"""Packs a fixed length bytestring. Left-pads with zeros
if input data is too short."""
if not list:
@@ -290,7 +290,11 @@ def VPPTypeAlias(name, msgdef):
if 'length' in msgdef:
if msgdef['length'] == 0:
raise ValueError()
- types[name] = FixedList(name, msgdef['type'], msgdef['length'])
+ if msgdef['type'] == 'u8':
+ types[name] = FixedList_u8(name, msgdef['type'],
+ msgdef['length'])
+ else:
+ types[name] = FixedList(name, msgdef['type'], msgdef['length'])
else:
types[name] = t