summaryrefslogtreecommitdiffstats
path: root/src/tools/vppapigen/JSON.py
AgeCommit message (Collapse)AuthorFilesLines
2018-09-13Fix: vppapigen make build fails on fresh installPaul Vinciguerra1-69/+0
Steps to reproduce: vagrant@localhost:/vagrant$ build-root/vagrant/build.sh ... @@@@ Building vpp in /vagrant/build-root/build-vpp-native/vpp @@@@ [51/1169] Generating API header /vagrant/build-root/build-vpp-native/vpp/vlibmemory/memclnt.api.json FAILED: cd /vagrant/build-root/build-vpp-native/vpp/vlibmemory && mkdir -p /vagrant/build-root/build-vpp-native/vpp/vlibmemory && /vagrant/src/tools/vppapigen/vppapigen --includedir /vagrant/src --input /vagrant/src/vlibmemory/memclnt.api JSON --output /vagrant/build-root/build-vpp-native/vpp/vlibmemory/memclnt.api.json AttributeError: 'module' object has no attribute 'dumps' This seems to be due to JSON.py namespace colliding with the standard lib json.py Change-Id: If389e4e05ef0c166b0c2b3bef7ec0185298679a8 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-05-23VPPAPIGEN: Add union and enum support and IP4/IP6 address type.Ole Troan1-4/+7
Note: The Python, Java and C/C++ bindings must be updated before ip/ip_types.api can be used. ip_types.api: typedef ip4_address { u8 address[4]; }; typedef ip6_address { u8 address[16]; }; enum address_family { ADDRESS_IP4 = 0, ADDRESS_IP6, }; union address_union { vl_api_ip4_address_t ip4; vl_api_ip6_address_t ip6; }; typedef address { vl_api_address_family_t af; vl_api_address_union_t un; }; Change-Id: I22f67092f24db5bd650a03c6f446a84cd9fd1074 Signed-off-by: Ole Troan <ot@cisco.com>
2018-02-09vppapigen: simplify JSON format for servicesMarek Gradzki1-2/+2
Use "services": { "foo_request": { "reply": "foo_request_reply" }, "foo_dump": { "reply": "foo_details", "stream": true } }, instead of: "services": [ { "foo_request": { "reply": "foo_request_reply" } }, { "foo_dump": { "reply": "foo_details", "stream": true } } ], Change-Id: I1d8e6bb4d41541b7f7f63242935f2ed4467fc52b Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
2018-01-23VPPAPIGEN: vppapigen replacement in Python PLY.Ole Troan1-0/+66
This is a version of the VPP API generator in Python PLY. It supports the existing language, and has a plugin architecture for generators. Currently C and JSON are supported. Changes: - vl_api_version to option version = "major.minor.patch" - enum support - Added error checking and reporting - import support (removed the C pre-processor) - services (tying request/reply together) Version: option version = "1.0.0"; Enum: enum colours { RED, BLUE = 50, }; define foo { vl_api_colours_t colours; }; Services: service { rpc foo returns foo_reply; rpc foo_dump returns stream foo_details; rpc want_stats returns want_stats_reply events ip4_counters, ip6_counters; }; Future planned features: - unions - bool, text - array support (including length) - proto3 output plugin - Refactor C/C++ generator as a plugin - Refactor Java generator as a plugin Change-Id: Ifa289966c790e1b1a8e2938a91e69331e3a58bdf Signed-off-by: Ole Troan <ot@cisco.com>