From d1f24d37bd447b64e402298bb8eb2479681facf9 Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Fri, 17 Jul 2020 10:36:28 +0200 Subject: Improve binapi generator - 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 --- binapi/tapv2/tapv2.ba.go | 494 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 494 insertions(+) create mode 100644 binapi/tapv2/tapv2.ba.go (limited to 'binapi/tapv2/tapv2.ba.go') diff --git a/binapi/tapv2/tapv2.ba.go b/binapi/tapv2/tapv2.ba.go new file mode 100644 index 0000000..e19b556 --- /dev/null +++ b/binapi/tapv2/tapv2.ba.go @@ -0,0 +1,494 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. +// versions: +// binapi-generator: v0.4.0-dev +// VPP: 20.05-release +// source: /usr/share/vpp/api/core/tapv2.api.json + +// Package tapv2 contains generated bindings for API file tapv2.api. +// +// Contents: +// 1 enum +// 6 messages +// +package tapv2 + +import ( + api "git.fd.io/govpp.git/api" + ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types" + interface_types "git.fd.io/govpp.git/binapi/interface_types" + ip_types "git.fd.io/govpp.git/binapi/ip_types" + codec "git.fd.io/govpp.git/codec" + "strconv" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the GoVPP api package it is being compiled against. +// A compilation error at this line likely means your copy of the +// GoVPP api package needs to be updated. +const _ = api.GoVppAPIPackageIsVersion2 + +const ( + APIFile = "tapv2" + APIVersion = "4.0.0" + VersionCrc = 0x3ed7c42d +) + +// TapFlags defines enum 'tap_flags'. +type TapFlags uint32 + +const ( + TAP_API_FLAG_GSO TapFlags = 1 + TAP_API_FLAG_CSUM_OFFLOAD TapFlags = 2 + TAP_API_FLAG_PERSIST TapFlags = 4 + TAP_API_FLAG_ATTACH TapFlags = 8 + TAP_API_FLAG_TUN TapFlags = 16 + TAP_API_FLAG_GRO_COALESCE TapFlags = 32 +) + +var ( + TapFlags_name = map[uint32]string{ + 1: "TAP_API_FLAG_GSO", + 2: "TAP_API_FLAG_CSUM_OFFLOAD", + 4: "TAP_API_FLAG_PERSIST", + 8: "TAP_API_FLAG_ATTACH", + 16: "TAP_API_FLAG_TUN", + 32: "TAP_API_FLAG_GRO_COALESCE", + } + TapFlags_value = map[string]uint32{ + "TAP_API_FLAG_GSO": 1, + "TAP_API_FLAG_CSUM_OFFLOAD": 2, + "TAP_API_FLAG_PERSIST": 4, + "TAP_API_FLAG_ATTACH": 8, + "TAP_API_FLAG_TUN": 16, + "TAP_API_FLAG_GRO_COALESCE": 32, + } +) + +func (x TapFlags) String() string { + s, ok := TapFlags_name[uint32(x)] + if ok { + return s + } + str := func(n uint32) string { + s, ok := TapFlags_name[uint32(n)] + if ok { + return s + } + return "TapFlags(" + strconv.Itoa(int(n)) + ")" + } + for i := uint32(0); i <= 32; i++ { + val := uint32(x) + if val&(1<