aboutsummaryrefslogtreecommitdiffstats
path: root/binapigen
AgeCommit message (Collapse)AuthorFilesLines
2022-08-02Change module name to go.fd.io/govppHEADv0.6.0-alphamasterNathan Skrzypczak10-16/+16
We are changing the module name from git.fd.io/govpp.git to go.fd.io/govpp to make repository migration easier. Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com> Change-Id: Idd6e0d583a92f6b82fe9adeffd026cd6b856038b
2022-05-30binapi: remove internal/testbinapiNathan Skrzypczak1-1/+1
This patch is a proposal to remove the necessity to version two versions of the generated api. We would rely on `./binapi/` for 'internal' logic, making the dependancy on VPP a bit stronger, but removing a folder and a .json file we don't upgrade regularly. Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com> Change-Id: I99063ed571eb193271b3cda805d692155ac90f61
2022-05-19Generate APIName/APIVersion/CrcVersion for 'types'Ed Warnicke1-8/+6
Signed-off-by: Ed Warnicke <hagbard@gmail.com> Change-Id: I661eb993c10f73909e21dcde73466d92ff54b52d
2021-11-29Add "FromIP" helper for addressesAloys Augustin1-1/+33
Change-Id: Ib34b84b8267c95ce3bacef4806cc52a6c7c24f05 Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2021-09-08binapigen: enhanced vpp version resolutionVladimir Lavor1-2/+2
While assuming whether the VPP is installed (in order to retrieve a version), the generator looks directly for the VPP executable instead of the API path. This allows to get version if generated from any directory. Signed-off-by: Vladimir Lavor <vlavor@cisco.com> Change-Id: I147e4fba49c102bf5f1cbcf2784c212479dc15b6
2021-09-07Refactoring and fixesmhalaj11-0/+4
* refactor creation of new channel * add missing closing of created streams * correct documentation regarding thread safety of stream Signed-off-by: mhalaj1 <matus.halaj@pantheon.tech> Change-Id: Ic601efff298fcbdecaafab83fa236253af69de21
2021-06-15Fix encode/decode for []boolVladimir Lavor1-8/+4
Signed-off-by: Vladimir Lavor <vlavor@cisco.com> Change-Id: I6649d6825a208b9cd936bf8f3b80e69ff84f8b74
2021-04-22added api message optionsVladimir Lavor3-9/+62
In case the API message contains option of type deprecated or in-progress, the information is displayed in the generated code in a form of additional comment: // InProgress: <info> // Deprecated: <info> In case the <info> is not provided, a generic message is shown. Possible future use to automatically search whether such messages are in use. Change-Id: Icf87cc9a2fe6bf31f7555320255c9f0736add6e1 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2021-02-02binapigen: added enumflags typeVladimir Lavor7-890/+2285
Change-Id: I2f46504bd05862e415dab518fad349d08aedf919 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2021-02-01Rework test for binary API union sizesVladimir Lavor3-51/+268
The test now generates various unions from union.api.json and tests correct sizes of generated types. Change-Id: Ifaf18a8ce650e71a8ca8b2d5cfb9d7eed2d757c6 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-10-30Fix encoding for float64 and generate conversion for TimestampOndrej Fabry3-7/+69
- fixes encoding/decoding of float64 - uses little endian (contrary to all other types) - generates helper methods for vpe_types.Timestamp type - adds usage code to simple-client and binapi-types examples Change-Id: I2e83eee0629eb67964049406c50c7ee0a692ccaf Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
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>