Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
API: Change ip4_address and ip6_address to use type alias.
[vpp.git]
/
src
/
vpp-api
/
python
/
vpp_papi
/
vpp_serializer.py
diff --git
a/src/vpp-api/python/vpp_papi/vpp_serializer.py
b/src/vpp-api/python/vpp_papi/vpp_serializer.py
index
f789729
..
13721ff
100644
(file)
--- 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
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:
"""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()
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
else:
types[name] = t