aboutsummaryrefslogtreecommitdiffstats
path: root/binapigen/generate.go
AgeCommit message (Collapse)AuthorFilesLines
2022-08-02Change module name to go.fd.io/govppHEADv0.6.0-alphamasterNathan Skrzypczak1-3/+3
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-04-22added api message optionsVladimir Lavor1-0/+31
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 Lavor1-1/+1
Change-Id: I2f46504bd05862e415dab518fad349d08aedf919 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-10-30Fix encoding for float64 and generate conversion for TimestampOndrej Fabry1-0/+2
- 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-08-28fix(binapigen): Fix name conflict for union field constructorsOndrej Fabry1-7/+18
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-21Expose version info control flagsNathan Skrzypczak1-1/+3
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com> Change-Id: Ida098149bdf23dccafb7b1f2ac2bb83f21f918c9
2020-07-22Fix binapigen decoding and minor improvementsOndrej Fabry1-33/+43
- 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 Fabry1-1194/+324
- 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 Lavor1-4/+134
* 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 Fabry1-162/+144
Change-Id: Idd76c7f19d952939caf153928ac60175845078ff Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-06-22Refactored binapi generator with message encodingOndrej Fabry1-0/+1241
Change-Id: I5a6abb68b9d058866f94818169300e5c2fc43895 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>