aboutsummaryrefslogtreecommitdiffstats
path: root/binapigen
AgeCommit message (Collapse)AuthorFilesLines
2020-10-02Check retval value and convert to error in generated RPC client codeOndrej Fabry4-18/+39
Change-Id: I816b4802cb5fc46239f6db0480fa4cf3645fe2f0 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-09-18binapigen: fix union sizeVladimir Lavor2-26/+144
This change fixes calculated byte size of the union composed from another union(s). Change-Id: I596a3c2a585cc42570b1d00dab3a5ad4993dabfa Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-09-03Improve doc & fix import orderingNathan Skrzypczak2-10/+33
This also updates /binapi and adds a new make command to generate api files out of a local vpp repo clone Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com> Change-Id: Iff7965388a74ecd21af80f10b5a59d4ed8da6340
2020-08-28fix(binapigen): Fix name conflict for union field constructorsOndrej Fabry2-8/+19
PROBLEM Issue discovered in flow_types.api on master (20.09-rc0), where generator encountered inconsistent naming for union type Flow, causing name conflicts with their constructors. SOLUTION Previous cases of union types (address, punt) both contain suffix "Union", thus generator now adds "Union" suffix it is not defined. This way we won't break previously generated code for users. Change-Id: Iffadc167774d66d8416fe36485782bb68ca2a70d Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-08-25Binapi generator: improved file inputVladimir Lavor4-29/+43
In addition to the standard file name input (for example "vpe"), binary API generator now again accepts full file path like "/usr/share/vpp/api/core/vpe.api.json" as an input direcotry or argument. Change-Id: I591b5d26e7f101cdcc4af64d3bdabaab48b5b2ef Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-08-21Expose version info control flagsNathan Skrzypczak2-4/+7
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com> Change-Id: Ida098149bdf23dccafb7b1f2ac2bb83f21f918c9
2020-07-22Fix binapigen decoding and minor improvementsOndrej Fabry11-287/+342
- fixed allocating byte slices before copying decoded data - simplified encoding functions - several minor improvements Change-Id: I6669424b89eb86333805cb1b57e4551169980cc2 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-07-17Improve binapi generatorOndrej Fabry23-2500/+3014
- simplified Size/Marshal/Unmarshal methods - replace struc in unions with custom marshal/unmarshal - fix imports in generated files - fix mock adapter - generate rpc service using low-level stream API (dumps generate control ping or stream msg..) - move examples/binapi to binapi and generate all API for latest release - add binapigen.Plugin for developing custom generator plugins - optionally generate HTTP handlers (REST API) for RPC services - add govpp program for browsing VPP API Change-Id: I092e9ed2b0c17972b3476463c3d4b14dd76ed42b Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-07-02Binary API generator improvementsVladimir Lavor3-5/+279
* Many aliases removed, aliased types reference original types via import instead * Added various helper methods for simpler conversion between go and vpp types Change-Id: I7999ac8d524cece4da03e6447b13421659765095 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-06-24Fix codec fallback and generate type importsOndrej Fabry9-252/+343
Change-Id: Idd76c7f19d952939caf153928ac60175845078ff Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-06-22Refactored binapi generator with message encodingOndrej Fabry24-0/+11409
Change-Id: I5a6abb68b9d058866f94818169300e5c2fc43895 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>