aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rwxr-xr-xsrc/tools/vppapigen/vppapigen.py5
-rw-r--r--src/tools/vppapigen/vppapigen_c.py10
2 files changed, 11 insertions, 4 deletions
diff --git a/src/tools/vppapigen/vppapigen.py b/src/tools/vppapigen/vppapigen.py
index eabf8f0644d..7c596967cfb 100755
--- a/src/tools/vppapigen/vppapigen.py
+++ b/src/tools/vppapigen/vppapigen.py
@@ -64,6 +64,7 @@ class VPPAPILexer(object):
'manual_endian': 'MANUAL_ENDIAN',
'dont_trace': 'DONT_TRACE',
'autoreply': 'AUTOREPLY',
+ 'autoendian': 'AUTOENDIAN',
'option': 'OPTION',
'u8': 'U8',
'u16': 'U16',
@@ -308,6 +309,7 @@ class Define(Processable):
self.manual_print = False
self.manual_endian = False
self.autoreply = False
+ self.autoendian = 0
self.options = {}
for f in flags:
if f == 'dont_trace':
@@ -318,6 +320,8 @@ class Define(Processable):
self.manual_endian = True
elif f == 'autoreply':
self.autoreply = True
+ elif f == 'autoendian':
+ self.autoendian = 1
remove = []
for b in block:
@@ -768,6 +772,7 @@ class VPPAPIParser(object):
| MANUAL_ENDIAN
| DONT_TRACE
| TYPEONLY
+ | AUTOENDIAN
| AUTOREPLY'''
if len(p) == 1:
return
diff --git a/src/tools/vppapigen/vppapigen_c.py b/src/tools/vppapigen/vppapigen_c.py
index 0727619a803..0ded2af7a52 100644
--- a/src/tools/vppapigen/vppapigen_c.py
+++ b/src/tools/vppapigen/vppapigen_c.py
@@ -1329,8 +1329,9 @@ def generate_c_boilerplate(services, defines, counters, file_crc,
' .cleanup = vl_noop_handler,\n'
' .endian = vl_api_{n}_t_endian,\n'
' .print = vl_api_{n}_t_print,\n'
- ' .is_autoendian = 0}};\n'
- .format(n=s.caller, ID=s.caller.upper()))
+ ' .is_autoendian = {auto}}};\n'
+ .format(n=s.caller, ID=s.caller.upper(),
+ auto=d.autoendian))
write(' vl_msg_api_config (&c);\n')
try:
d = define_hash[s.reply]
@@ -1341,8 +1342,9 @@ def generate_c_boilerplate(services, defines, counters, file_crc,
' .cleanup = vl_noop_handler,\n'
' .endian = vl_api_{n}_t_endian,\n'
' .print = vl_api_{n}_t_print,\n'
- ' .is_autoendian = 0}};\n'
- .format(n=s.reply, ID=s.reply.upper()))
+ ' .is_autoendian = {auto}}};\n'
+ .format(n=s.reply, ID=s.reply.upper(),
+ auto=d.autoendian))
write(' vl_msg_api_config (&c);\n')
except KeyError:
pass