X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Ftools%2Fvppapigen%2Fvppapigen.py;h=57e5e3a411ee95321a9cf4749d67fc14fe1c4f24;hb=b533f3fadeab73aef04b6fd65ab997ed7fce50df;hp=620b2ef7b7181a55092c01bd34a22cbd0fd79f48;hpb=f7b7fa53b7eaec81d8c00c1023fb7d01f1f9761f;p=vpp.git diff --git a/src/tools/vppapigen/vppapigen.py b/src/tools/vppapigen/vppapigen.py index 620b2ef7b71..57e5e3a411e 100755 --- a/src/tools/vppapigen/vppapigen.py +++ b/src/tools/vppapigen/vppapigen.py @@ -345,6 +345,10 @@ class VPPAPIParser(object): | RPC ID RETURNS ID ';' | RPC ID RETURNS STREAM ID ';' | RPC ID RETURNS ID EVENTS event_list ';' ''' + if p[2] == p[4]: + # Verify that caller and reply differ + self._parse_error('Reply ID ({}) should not be equal to Caller ID'.format(p[2]), + self._token_coord(p, 1)) if len(p) == 8: p[0] = Service(p[2], p[4], p[6]) elif len(p) == 7: @@ -570,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: @@ -580,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 '