summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-03-06 11:10:56 +0100
committerOle Trøan <otroan@employees.org>2018-03-06 11:24:26 +0000
commitb533f3fadeab73aef04b6fd65ab997ed7fce50df (patch)
tree5679d83f47552ab934963d34ebc3a07408ee2fdf /src
parentfc70e3a89f7a5a8913eac3d89ace578f9d1a7c11 (diff)
vppapigen: do not allow to define message as both request and reply
Change-Id: I0738fac32dd0c5d927c52d2eb2c1100d14c147cf Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/tools/vppapigen/vppapigen.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tools/vppapigen/vppapigen.py b/src/tools/vppapigen/vppapigen.py
index a1bb0e184df..57e5e3a411e 100755
--- a/src/tools/vppapigen/vppapigen.py
+++ b/src/tools/vppapigen/vppapigen.py
@@ -574,6 +574,7 @@ class VPPAPI(object):
msgs = {d.name: d for d in s['defines']}
svcs = {s.caller: s for s in s['services']}
+ replies = {s.reply: s for s in s['services']}
seen_services = {}
for service in svcs:
@@ -584,6 +585,9 @@ class VPPAPI(object):
raise ValueError('Service definition refers to unknown message'
' definition in reply: {}'
.format(svcs[service].reply))
+ if service in replies:
+ raise ValueError('Service definition refers to message'
+ ' marked as reply: {}'.format(service))
for event in svcs[service].events:
if event not in msgs:
raise ValueError('Service definition refers to unknown '