diff options
author | Ole Troan <ot@cisco.com> | 2018-11-27 10:05:23 +0100 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2018-12-06 14:05:04 +0000 |
commit | 8c8acc027871f97370ee549306876690030c3bbb (patch) | |
tree | 36e3c8b05d8112105739a5e809ed7fa7d80ab785 /src/vpp-api/vapi | |
parent | 1f0dd7a0664bc217b7d69773574ac7eae3813bd7 (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/vapi')
-rwxr-xr-x | src/vpp-api/vapi/vapi_c_gen.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/vpp-api/vapi/vapi_c_gen.py b/src/vpp-api/vapi/vapi_c_gen.py index 9939bc0556c..490b83028da 100755 --- a/src/vpp-api/vapi/vapi_c_gen.py +++ b/src/vpp-api/vapi/vapi_c_gen.py @@ -10,7 +10,7 @@ from vapi_json_parser import Field, Struct, Enum, Union, Message, JsonParser,\ class CField(Field): def get_c_name(self): - return self.name + return "vapi_type_%s" % self.name def get_c_def(self): if self.len is not None: @@ -100,14 +100,14 @@ class CField(Field): class CAlias(CField): def get_c_name(self): - return self.name + return "vapi_type_%s" % self.name def get_c_def(self): - return "typedef %s" % super(CAlias, self).get_c_def() - # if self.len is not None: - # return "typedef %s %s[%d];" % (self.type.get_c_name(), self.name, self.len) - # else: - # return "typedef %s %s;" % (self.type.get_c_name(), self.name) + if self.len is not None: + return "typedef %s vapi_type_%s[%d];" % (self.type.get_c_name(), self.name, self.len) + else: + return "typedef %s vapi_type_%s;" % (self.type.get_c_name(), self.name) + #return "typedef %s" % super(CAlias, self).get_c_def() # def needs_byte_swap |