Improve doc & fix import ordering 62/28562/7
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>
Fri, 21 Aug 2020 15:25:53 +0000 (17:25 +0200)
committerOndrej Fabry <ofabry@cisco.com>
Thu, 3 Sep 2020 15:11:13 +0000 (15:11 +0000)
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

206 files changed:
Makefile
binapi/abf/abf.ba.go
binapi/abf/abf_rpc.ba.go
binapi/acl/acl.ba.go
binapi/acl/acl_rpc.ba.go
binapi/acl_types/acl_types.ba.go
binapi/af_packet/af_packet.ba.go
binapi/af_packet/af_packet_rpc.ba.go
binapi/arp/arp.ba.go
binapi/arp/arp_rpc.ba.go
binapi/avf/avf.ba.go
binapi/avf/avf_rpc.ba.go
binapi/bfd/bfd.ba.go
binapi/bfd/bfd_rpc.ba.go
binapi/bier/bier.ba.go
binapi/bier/bier_rpc.ba.go
binapi/bond/bond.ba.go
binapi/bond/bond_rpc.ba.go
binapi/builtinurl/builtinurl.ba.go
binapi/builtinurl/builtinurl_rpc.ba.go
binapi/cdp/cdp.ba.go
binapi/cdp/cdp_rpc.ba.go
binapi/classify/classify.ba.go
binapi/classify/classify_rpc.ba.go
binapi/cop/cop.ba.go
binapi/cop/cop_rpc.ba.go
binapi/ct6/ct6.ba.go
binapi/ct6/ct6_rpc.ba.go
binapi/dhcp/dhcp.ba.go
binapi/dhcp/dhcp_rpc.ba.go
binapi/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp.ba.go
binapi/dhcp6_ia_na_client_cp/dhcp6_ia_na_client_cp_rpc.ba.go
binapi/dhcp6_pd_client_cp/dhcp6_pd_client_cp.ba.go
binapi/dhcp6_pd_client_cp/dhcp6_pd_client_cp_rpc.ba.go
binapi/dns/dns.ba.go
binapi/dns/dns_rpc.ba.go
binapi/dslite/dslite.ba.go
binapi/dslite/dslite_rpc.ba.go
binapi/ethernet_types/ethernet_types.ba.go
binapi/feature/feature.ba.go
binapi/feature/feature_rpc.ba.go
binapi/fib_types/fib_types.ba.go
binapi/flowprobe/flowprobe.ba.go
binapi/flowprobe/flowprobe_rpc.ba.go
binapi/gbp/gbp.ba.go
binapi/gbp/gbp_rpc.ba.go
binapi/geneve/geneve.ba.go
binapi/geneve/geneve_rpc.ba.go
binapi/gre/gre.ba.go
binapi/gre/gre_rpc.ba.go
binapi/gso/gso.ba.go
binapi/gso/gso_rpc.ba.go
binapi/gtpu/gtpu.ba.go
binapi/gtpu/gtpu_rpc.ba.go
binapi/http_static/http_static.ba.go
binapi/http_static/http_static_rpc.ba.go
binapi/igmp/igmp.ba.go
binapi/igmp/igmp_rpc.ba.go
binapi/ikev2/ikev2.ba.go
binapi/ikev2/ikev2_rpc.ba.go
binapi/interface/interface.ba.go
binapi/interface/interface_rpc.ba.go
binapi/interface_types/interface_types.ba.go
binapi/ioam_cache/ioam_cache.ba.go
binapi/ioam_cache/ioam_cache_rpc.ba.go
binapi/ioam_export/ioam_export.ba.go
binapi/ioam_export/ioam_export_rpc.ba.go
binapi/ioam_vxlan_gpe/ioam_vxlan_gpe.ba.go
binapi/ioam_vxlan_gpe/ioam_vxlan_gpe_rpc.ba.go
binapi/ip/ip.ba.go
binapi/ip/ip_rpc.ba.go
binapi/ip6_nd/ip6_nd.ba.go
binapi/ip6_nd/ip6_nd_rpc.ba.go
binapi/ip_neighbor/ip_neighbor.ba.go
binapi/ip_neighbor/ip_neighbor_rpc.ba.go
binapi/ip_types/ip_types.ba.go
binapi/ipfix_export/ipfix_export.ba.go
binapi/ipfix_export/ipfix_export_rpc.ba.go
binapi/ipip/ipip.ba.go
binapi/ipip/ipip_rpc.ba.go
binapi/ipsec/ipsec.ba.go
binapi/ipsec/ipsec_rpc.ba.go
binapi/ipsec_types/ipsec_types.ba.go
binapi/l2/l2.ba.go
binapi/l2/l2_rpc.ba.go
binapi/l2e/l2e.ba.go
binapi/l2e/l2e_rpc.ba.go
binapi/l2tp/l2tp.ba.go
binapi/l2tp/l2tp_rpc.ba.go
binapi/l3xc/l3xc.ba.go
binapi/l3xc/l3xc_rpc.ba.go
binapi/lacp/lacp.ba.go
binapi/lacp/lacp_rpc.ba.go
binapi/lb/lb.ba.go
binapi/lb/lb_rpc.ba.go
binapi/lb_types/lb_types.ba.go
binapi/lisp/lisp.ba.go
binapi/lisp/lisp_rpc.ba.go
binapi/lisp_gpe/lisp_gpe.ba.go
binapi/lisp_gpe/lisp_gpe_rpc.ba.go
binapi/lisp_types/lisp_types.ba.go
binapi/lldp/lldp.ba.go
binapi/lldp/lldp_rpc.ba.go
binapi/mactime/mactime.ba.go
binapi/mactime/mactime_rpc.ba.go
binapi/map/map.ba.go
binapi/map/map_rpc.ba.go
binapi/mdata/mdata.ba.go
binapi/mdata/mdata_rpc.ba.go
binapi/memclnt/memclnt.ba.go
binapi/memclnt/memclnt_rpc.ba.go
binapi/memif/memif.ba.go
binapi/memif/memif_rpc.ba.go
binapi/mfib_types/mfib_types.ba.go
binapi/mpls/mpls.ba.go
binapi/mpls/mpls_rpc.ba.go
binapi/nat/nat.ba.go
binapi/nat/nat_rpc.ba.go
binapi/nsh/nsh.ba.go
binapi/nsh/nsh_rpc.ba.go
binapi/nsim/nsim.ba.go
binapi/nsim/nsim_rpc.ba.go
binapi/oddbuf/oddbuf.ba.go
binapi/oddbuf/oddbuf_rpc.ba.go
binapi/one/one.ba.go
binapi/one/one_rpc.ba.go
binapi/p2p_ethernet/p2p_ethernet.ba.go
binapi/p2p_ethernet/p2p_ethernet_rpc.ba.go
binapi/pci_types/pci_types.ba.go
binapi/pg/pg.ba.go
binapi/pg/pg_rpc.ba.go
binapi/pipe/pipe.ba.go
binapi/pipe/pipe_rpc.ba.go
binapi/policer/policer.ba.go
binapi/policer/policer_rpc.ba.go
binapi/policer_types/policer_types.ba.go
binapi/pot/pot.ba.go
binapi/pot/pot_rpc.ba.go
binapi/pp2/pp2.ba.go [new file with mode: 0644]
binapi/pp2/pp2_rest.ba.go [new file with mode: 0644]
binapi/pp2/pp2_rpc.ba.go [new file with mode: 0644]
binapi/pppoe/pppoe.ba.go
binapi/pppoe/pppoe_rpc.ba.go
binapi/punt/punt.ba.go
binapi/punt/punt_rpc.ba.go
binapi/qos/qos.ba.go
binapi/qos/qos_rpc.ba.go
binapi/rd_cp/rd_cp.ba.go
binapi/rd_cp/rd_cp_rpc.ba.go
binapi/rdma/rdma.ba.go
binapi/rdma/rdma_rpc.ba.go
binapi/session/session.ba.go
binapi/session/session_rpc.ba.go
binapi/span/span.ba.go
binapi/span/span_rpc.ba.go
binapi/sr/sr.ba.go
binapi/sr/sr_rpc.ba.go
binapi/sr_mpls/sr_mpls.ba.go
binapi/sr_mpls/sr_mpls_rpc.ba.go
binapi/sr_types/sr_types.ba.go
binapi/stn/stn.ba.go
binapi/stn/stn_rpc.ba.go
binapi/svs/svs.ba.go
binapi/svs/svs_rpc.ba.go
binapi/syslog/syslog.ba.go
binapi/syslog/syslog_rpc.ba.go
binapi/tapv2/tapv2.ba.go
binapi/tapv2/tapv2_rpc.ba.go
binapi/tcp/tcp.ba.go
binapi/tcp/tcp_rpc.ba.go
binapi/teib/teib.ba.go
binapi/teib/teib_rpc.ba.go
binapi/tls_openssl/tls_openssl.ba.go
binapi/tls_openssl/tls_openssl_rpc.ba.go
binapi/trace/trace.ba.go
binapi/trace/trace_rpc.ba.go
binapi/tunnel_types/tunnel_types.ba.go
binapi/udp/udp.ba.go
binapi/udp/udp_rpc.ba.go
binapi/udp_ping/udp_ping.ba.go
binapi/udp_ping/udp_ping_rpc.ba.go
binapi/urpf/urpf.ba.go
binapi/urpf/urpf_rpc.ba.go
binapi/vhost_user/vhost_user.ba.go
binapi/vhost_user/vhost_user_rpc.ba.go
binapi/virtio/virtio.ba.go
binapi/virtio/virtio_rpc.ba.go
binapi/virtio_types/virtio_types.ba.go
binapi/vmxnet3/vmxnet3.ba.go
binapi/vmxnet3/vmxnet3_rpc.ba.go
binapi/vpe/vpe.ba.go
binapi/vpe/vpe_rpc.ba.go
binapi/vpe_types/vpe_types.ba.go
binapi/vrrp/vrrp.ba.go
binapi/vrrp/vrrp_rpc.ba.go
binapi/vxlan/vxlan.ba.go
binapi/vxlan/vxlan_rpc.ba.go
binapi/vxlan_gbp/vxlan_gbp.ba.go
binapi/vxlan_gbp/vxlan_gbp_rpc.ba.go
binapi/vxlan_gpe/vxlan_gpe.ba.go
binapi/vxlan_gpe/vxlan_gpe_rpc.ba.go
binapi/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export.ba.go
binapi/vxlan_gpe_ioam_export/vxlan_gpe_ioam_export_rpc.ba.go
binapigen/generator.go
binapigen/vppapi/util.go
cmd/binapi-generator/main.go

index 5257617..0ae100b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -35,10 +35,16 @@ ifeq ($(V),1)
 GO_BUILD_ARGS += -v
 endif
 
-VPP_VERSION    = $(shell dpkg-query -f '\${Version}' -W vpp)
+VPP_VERSION    ?= $(shell dpkg-query -f '\${Version}' -W vpp)
 
-VPP_IMG        ?= ligato/vpp-base:latest
-BINAPI_DIR     ?= ./binapi
+# VPP Docker image to use for api generation (gen-binapi-docker)
+VPP_IMG              ?= ligato/vpp-base:latest
+# Local VPP directory used for binary api generation (gen-binapi-from-code)
+VPP_DIR           ?=
+# Target directory for generated go api bindings
+BINAPI_DIR           ?= ./binapi
+# Binapi generator path
+BINAPI_GENERATOR  = ./bin/binapi-generator
 
 bin:
        mkdir -p bin
@@ -47,6 +53,9 @@ build: ## Build all
        @echo "# building ${VERSION}"
        $(GO) build ${GO_BUILD_ARGS} ./...
 
+cmd-binapi-generator: bin ## Build commands
+       $(GO) build ${GO_BUILD_ARGS} -o bin ./cmd/binapi-generator
+
 cmd: bin ## Build commands
        $(GO) build ${GO_BUILD_ARGS} -o bin ./cmd/...
 
@@ -88,6 +97,19 @@ generate-binapi: install-generator ## Generate binapi code
        @echo "# generating binapi VPP $(VPP_VERSION)"
        $(GO) generate -x "$(BINAPI_DIR)"
 
+gen-binapi-from-code: cmd-binapi-generator
+       $(eval VPP_API_DIR := ${VPP_DIR}/build-root/install-vpp-native/vpp/share/vpp/api/)
+       @echo "Generating vpp API.json and go bindings"
+       @echo "Vpp Directory ${VPP_DIR}"
+       @echo "Vpp API files ${VPP_API_DIR}"
+       @echo "Go bindings   ${BINAPI_DIR}"
+       @cd ${VPP_DIR} && make json-api-files
+       @${BINAPI_GENERATOR} \
+               --input-dir=${VPP_API_DIR} \
+           --output-dir=${BINAPI_DIR} \
+           --gen rpc,rest \
+           --no-source-path-info
+
 gen-binapi-docker: install-generator ## Generate binapi code (using Docker)
        @echo "# generating binapi in docker image ${VPP_IMG}"
        $(eval cmds := $(shell go generate -n $(BINAPI_DIR) 2>&1 | tr "\n" ";"))
index 2b28afe..296b4c5 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/abf.api.json
 
 // Package abf contains generated bindings for API file abf.api.
 //
index 76a88c6..9498ff6 100644 (file)
@@ -5,9 +5,10 @@ package abf
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  abf.
index 1f47a01..6c507e6 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/acl.api.json
 
 // Package acl contains generated bindings for API file acl.api.
 //
index a69df27..d1d2220 100644 (file)
@@ -5,9 +5,10 @@ package acl
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  acl.
index 5371e22..753701a 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/acl_types.api.json
 
 // Package acl_types contains generated bindings for API file acl_types.api.
 //
 package acl_types
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
        ip_types "git.fd.io/govpp.git/binapi/ip_types"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 750e2ce..9367352 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/af_packet.api.json
 
 // Package af_packet contains generated bindings for API file af_packet.api.
 //
index 72fea67..0603e3b 100644 (file)
@@ -5,9 +5,10 @@ package af_packet
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  af_packet.
index 90ff55b..c9806df 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/arp.api.json
 
 // Package arp contains generated bindings for API file arp.api.
 //
index 8ccfa75..8bb64ce 100644 (file)
@@ -5,9 +5,10 @@ package arp
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  arp.
index edfa26e..6f93d23 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/avf.api.json
 
 // Package avf contains generated bindings for API file avf.api.
 //
index 90f854e..46aa77c 100644 (file)
@@ -4,6 +4,7 @@ package avf
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index b8b2820..e5ba5ce 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/bfd.api.json
 
 // Package bfd contains generated bindings for API file bfd.api.
 //
 package bfd
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        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
index 78cbd3a..68a9893 100644 (file)
@@ -5,9 +5,10 @@ package bfd
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  bfd.
index f024d80..089a970 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/bier.api.json
 
 // Package bier contains generated bindings for API file bier.api.
 //
index c744153..f2e44c6 100644 (file)
@@ -5,9 +5,10 @@ package bier
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  bier.
index a734200..1896119 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/bond.api.json
 
 // Package bond contains generated bindings for API file bond.api.
 //
 package bond
 
 import (
+       "strconv"
+
        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"
        codec "git.fd.io/govpp.git/codec"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 5e60f84..8e3b254 100644 (file)
@@ -5,9 +5,10 @@ package bond
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  bond.
index 6b0350d..0ea651b 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/builtinurl.api.json
 
 // Package builtinurl contains generated bindings for API file builtinurl.api.
 //
index 6857de2..2edf7d5 100644 (file)
@@ -4,6 +4,7 @@ package builtinurl
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 5430d74..9dd71c9 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/cdp.api.json
 
 // Package cdp contains generated bindings for API file cdp.api.
 //
index a910833..1933d2f 100644 (file)
@@ -4,6 +4,7 @@ package cdp
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 942c59c..373e256 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/classify.api.json
 
 // Package classify contains generated bindings for API file classify.api.
 //
 package classify
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        interface_types "git.fd.io/govpp.git/binapi/interface_types"
        codec "git.fd.io/govpp.git/codec"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 8893db8..de29fa5 100644 (file)
@@ -5,9 +5,10 @@ package classify
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  classify.
index 14f0b11..675b32c 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/cop.api.json
 
 // Package cop contains generated bindings for API file cop.api.
 //
index 9f6f84e..2768c23 100644 (file)
@@ -4,6 +4,7 @@ package cop
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 5dc6097..cf34219 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/ct6.api.json
 
 // Package ct6 contains generated bindings for API file ct6.api.
 //
index 888fd32..d165339 100644 (file)
@@ -4,6 +4,7 @@ package ct6
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 7e0fd0b..b0ed4cb 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/dhcp.api.json
 
 // Package dhcp contains generated bindings for API file dhcp.api.
 //
 package dhcp
 
 import (
+       "strconv"
+
        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
index 379bb9b..384fc9a 100644 (file)
@@ -5,9 +5,10 @@ package dhcp
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  dhcp.
index 4fcb012..cd258b1 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/dhcp6_ia_na_client_cp.api.json
 
 // Package dhcp6_ia_na_client_cp contains generated bindings for API file dhcp6_ia_na_client_cp.api.
 //
index b975236..1083167 100644 (file)
@@ -4,6 +4,7 @@ package dhcp6_ia_na_client_cp
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 7e4e2bb..ab06190 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/dhcp6_pd_client_cp.api.json
 
 // Package dhcp6_pd_client_cp contains generated bindings for API file dhcp6_pd_client_cp.api.
 //
index 7199e5a..670e012 100644 (file)
@@ -4,6 +4,7 @@ package dhcp6_pd_client_cp
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index fc2324c..a30c0b4 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/dns.api.json
 
 // Package dns contains generated bindings for API file dns.api.
 //
index 57760ab..6bf3622 100644 (file)
@@ -4,6 +4,7 @@ package dns
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index efcf240..d94de18 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/dslite.api.json
 
 // Package dslite contains generated bindings for API file dslite.api.
 //
index 7f6e90e..6314fd2 100644 (file)
@@ -5,9 +5,10 @@ package dslite
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  dslite.
index b54b1ef..98bbead 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/ethernet_types.api.json
 
 // Package ethernet_types contains generated bindings for API file ethernet_types.api.
 //
@@ -12,8 +11,9 @@
 package ethernet_types
 
 import (
-       api "git.fd.io/govpp.git/api"
        "net"
+
+       api "git.fd.io/govpp.git/api"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index cc54364..ec87906 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/feature.api.json
 
 // Package feature contains generated bindings for API file feature.api.
 //
index cd91188..6c42e4f 100644 (file)
@@ -4,6 +4,7 @@ package feature
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index eb67597..75e87e9 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/fib_types.api.json
 
 // Package fib_types contains generated bindings for API file fib_types.api.
 //
 package fib_types
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        ip_types "git.fd.io/govpp.git/binapi/ip_types"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index a08f7d0..92e155b 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/flowprobe.api.json
 
 // Package flowprobe contains generated bindings for API file flowprobe.api.
 //
 package flowprobe
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        interface_types "git.fd.io/govpp.git/binapi/interface_types"
        codec "git.fd.io/govpp.git/codec"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 42c6887..97520fd 100644 (file)
@@ -4,6 +4,7 @@ package flowprobe
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index a203527..1ede1ac 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/gbp.api.json
 
 // Package gbp contains generated bindings for API file gbp.api.
 //
 package gbp
 
 import (
+       "strconv"
+
        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
index d10e224..635394e 100644 (file)
@@ -5,9 +5,10 @@ package gbp
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  gbp.
index fcd512d..e314f0a 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/geneve.api.json
 
 // Package geneve contains generated bindings for API file geneve.api.
 //
index df9a6be..88f7aac 100644 (file)
@@ -5,9 +5,10 @@ package geneve
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  geneve.
index d14c51e..1a123bd 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/gre.api.json
 
 // Package gre contains generated bindings for API file gre.api.
 //
 package gre
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        interface_types "git.fd.io/govpp.git/binapi/interface_types"
        ip_types "git.fd.io/govpp.git/binapi/ip_types"
        tunnel_types "git.fd.io/govpp.git/binapi/tunnel_types"
        codec "git.fd.io/govpp.git/codec"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index f664fb3..670aeec 100644 (file)
@@ -5,9 +5,10 @@ package gre
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  gre.
index 78e7536..e492e5d 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/gso.api.json
 
 // Package gso contains generated bindings for API file gso.api.
 //
index d955acc..42bb837 100644 (file)
@@ -4,6 +4,7 @@ package gso
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 96ae51f..de7d29f 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/gtpu.api.json
 
 // Package gtpu contains generated bindings for API file gtpu.api.
 //
index fb0bb47..d5f3263 100644 (file)
@@ -5,9 +5,10 @@ package gtpu
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  gtpu.
index 2116a8b..5f6397b 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/http_static.api.json
 
 // Package http_static contains generated bindings for API file http_static.api.
 //
index 415313d..67329dd 100644 (file)
@@ -4,6 +4,7 @@ package http_static
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 5026657..558d533 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/igmp.api.json
 
 // Package igmp contains generated bindings for API file igmp.api.
 //
 package igmp
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        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
index b873bda..c1ef9e5 100644 (file)
@@ -5,9 +5,10 @@ package igmp
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  igmp.
index 5fc68c3..f76c6c3 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/ikev2.api.json
 
 // Package ikev2 contains generated bindings for API file ikev2.api.
 //
index 59616cb..3491c54 100644 (file)
@@ -4,6 +4,7 @@ package ikev2
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 822c325..cadb109 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/interface.api.json
 
 // Package interfaces contains generated bindings for API file interface.api.
 //
index 6dc6a43..94d89ec 100644 (file)
@@ -5,9 +5,10 @@ package interfaces
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  interface.
index 607dc9b..191647a 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/interface_types.api.json
 
 // Package interface_types contains generated bindings for API file interface_types.api.
 //
@@ -13,8 +12,9 @@
 package interface_types
 
 import (
-       api "git.fd.io/govpp.git/api"
        "strconv"
+
+       api "git.fd.io/govpp.git/api"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 2f9f0ef..19e8104 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/ioam_cache.api.json
 
 // Package ioam_cache contains generated bindings for API file ioam_cache.api.
 //
index 33a721f..0705965 100644 (file)
@@ -4,6 +4,7 @@ package ioam_cache
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 47dd4e2..b5176c7 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/ioam_export.api.json
 
 // Package ioam_export contains generated bindings for API file ioam_export.api.
 //
index 584a563..9cf5396 100644 (file)
@@ -4,6 +4,7 @@ package ioam_export
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 7d1bb35..2d582cd 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/ioam_vxlan_gpe.api.json
 
 // Package ioam_vxlan_gpe contains generated bindings for API file ioam_vxlan_gpe.api.
 //
index e06b33a..eca5d4c 100644 (file)
@@ -4,6 +4,7 @@ package ioam_vxlan_gpe
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index df5b593..628f1e0 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/ip.api.json
 
 // Package ip contains generated bindings for API file ip.api.
 //
@@ -14,6 +13,8 @@
 package ip
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        _ "git.fd.io/govpp.git/binapi/ethernet_types"
        fib_types "git.fd.io/govpp.git/binapi/fib_types"
@@ -21,7 +22,6 @@ import (
        ip_types "git.fd.io/govpp.git/binapi/ip_types"
        mfib_types "git.fd.io/govpp.git/binapi/mfib_types"
        codec "git.fd.io/govpp.git/codec"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index f50c660..a27c082 100644 (file)
@@ -5,9 +5,10 @@ package ip
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  ip.
index a5f308e..48bb86f 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/ip6_nd.api.json
 
 // Package ip6_nd contains generated bindings for API file ip6_nd.api.
 //
index 3bfbac0..49e75cc 100644 (file)
@@ -5,9 +5,10 @@ package ip6_nd
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  ip6_nd.
index b4da5b1..2ece5ee 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/ip_neighbor.api.json
 
 // Package ip_neighbor contains generated bindings for API file ip_neighbor.api.
 //
 package ip_neighbor
 
 import (
+       "strconv"
+
        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
index 86589dd..1d34965 100644 (file)
@@ -5,9 +5,10 @@ package ip_neighbor
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  ip_neighbor.
index 9cb2e13..a9fc733 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/ip_types.api.json
 
 // Package ip_types contains generated bindings for API file ip_types.api.
 //
@@ -16,11 +15,12 @@ package ip_types
 
 import (
        "fmt"
-       api "git.fd.io/govpp.git/api"
-       codec "git.fd.io/govpp.git/codec"
        "net"
        "strconv"
        "strings"
+
+       api "git.fd.io/govpp.git/api"
+       codec "git.fd.io/govpp.git/codec"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index e173058..3a9b754 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/ipfix_export.api.json
 
 // Package ipfix_export contains generated bindings for API file ipfix_export.api.
 //
index 4c0dd27..e65fa47 100644 (file)
@@ -5,9 +5,10 @@ package ipfix_export
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  ipfix_export.
index 05821cb..aa44f00 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/ipip.api.json
 
 // Package ipip contains generated bindings for API file ipip.api.
 //
index bab3b22..a3e4cc7 100644 (file)
@@ -5,9 +5,10 @@ package ipip
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  ipip.
index 6a6abde..bfb757b 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/ipsec.api.json
 
 // Package ipsec contains generated bindings for API file ipsec.api.
 //
 package ipsec
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        interface_types "git.fd.io/govpp.git/binapi/interface_types"
        ip_types "git.fd.io/govpp.git/binapi/ip_types"
        ipsec_types "git.fd.io/govpp.git/binapi/ipsec_types"
        codec "git.fd.io/govpp.git/codec"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index c2d2af8..953c1a0 100644 (file)
@@ -5,9 +5,10 @@ package ipsec
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  ipsec.
index 149c35f..407caeb 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/ipsec_types.api.json
 
 // Package ipsec_types contains generated bindings for API file ipsec_types.api.
 //
 package ipsec_types
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        ip_types "git.fd.io/govpp.git/binapi/ip_types"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 7413635..cc39b49 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/l2.api.json
 
 // Package l2 contains generated bindings for API file l2.api.
 //
 package l2
 
 import (
+       "strconv"
+
        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
index b319c4e..9e4489a 100644 (file)
@@ -5,9 +5,10 @@ package l2
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  l2.
index c1b2a76..edca663 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/l2e.api.json
 
 // Package l2e contains generated bindings for API file l2e.api.
 //
index e589d28..8f85177 100644 (file)
@@ -4,6 +4,7 @@ package l2e
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 6737baa..57ec0c0 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/l2tp.api.json
 
 // Package l2tp contains generated bindings for API file l2tp.api.
 //
 package l2tp
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        _ "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
index 9fb250a..24e62bc 100644 (file)
@@ -5,9 +5,10 @@ package l2tp
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  l2tp.
index 3dbcfba..0a05915 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/l3xc.api.json
 
 // Package l3xc contains generated bindings for API file l3xc.api.
 //
index 74940a2..ffd0ff8 100644 (file)
@@ -5,9 +5,10 @@ package l3xc
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  l3xc.
index f1a9457..5ea6044 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/lacp.api.json
 
 // Package lacp contains generated bindings for API file lacp.api.
 //
index 00a00b5..e342a2c 100644 (file)
@@ -5,9 +5,10 @@ package lacp
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  lacp.
index 9fdfc7f..636c27a 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/lb.api.json
 
 // Package lb contains generated bindings for API file lb.api.
 //
index c28bb47..72b027a 100644 (file)
@@ -5,9 +5,10 @@ package lb
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  lb.
index 209b07e..9752c36 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/lb_types.api.json
 
 // Package lb_types contains generated bindings for API file lb_types.api.
 //
 package lb_types
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        ip_types "git.fd.io/govpp.git/binapi/ip_types"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 3358e61..ca8622a 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/lisp.api.json
 
 // Package lisp contains generated bindings for API file lisp.api.
 //
 package lisp
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        _ "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"
        lisp_types "git.fd.io/govpp.git/binapi/lisp_types"
        codec "git.fd.io/govpp.git/codec"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 1c82bdf..58962d4 100644 (file)
@@ -5,9 +5,10 @@ package lisp
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  lisp.
index 4bc7783..3ae307b 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/lisp_gpe.api.json
 
 // Package lisp_gpe contains generated bindings for API file lisp_gpe.api.
 //
index 42dcb31..5f33358 100644 (file)
@@ -5,9 +5,10 @@ package lisp_gpe
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  lisp_gpe.
index 49b2c3d..1fddd55 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/lisp_types.api.json
 
 // Package lisp_types contains generated bindings for API file lisp_types.api.
 //
 package lisp_types
 
 import (
+       "strconv"
+
        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
index a8769b5..1775ecc 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/lldp.api.json
 
 // Package lldp contains generated bindings for API file lldp.api.
 //
index 9d5eb85..359039f 100644 (file)
@@ -4,6 +4,7 @@ package lldp
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index deb7472..bfc8da4 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/mactime.api.json
 
 // Package mactime contains generated bindings for API file mactime.api.
 //
index a92a14c..0273feb 100644 (file)
@@ -5,9 +5,10 @@ package mactime
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  mactime.
index b906284..6eb6cdc 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/map.api.json
 
 // Package maps contains generated bindings for API file map.api.
 //
index 6f7c3c7..f45dbe5 100644 (file)
@@ -5,9 +5,10 @@ package maps
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  map.
index d4715f7..4a7f74c 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/mdata.api.json
 
 // Package mdata contains generated bindings for API file mdata.api.
 //
index 08e05d5..28b2589 100644 (file)
@@ -4,6 +4,7 @@ package mdata
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 3bbf88d..e262ca8 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/memclnt.api.json
 
 // Package memclnt contains generated bindings for API file memclnt.api.
 //
index ec60156..ae75a36 100644 (file)
@@ -4,6 +4,7 @@ package memclnt
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index adc41b6..f77555c 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/memif.api.json
 
 // Package memif contains generated bindings for API file memif.api.
 //
 package memif
 
 import (
+       "strconv"
+
        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"
        codec "git.fd.io/govpp.git/codec"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 4cd1fa1..b11f07f 100644 (file)
@@ -5,9 +5,10 @@ package memif
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  memif.
index 645d64c..4e90440 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/mfib_types.api.json
 
 // Package mfib_types contains generated bindings for API file mfib_types.api.
 //
 package mfib_types
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        fib_types "git.fd.io/govpp.git/binapi/fib_types"
        _ "git.fd.io/govpp.git/binapi/ip_types"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 9443728..6c9751c 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/mpls.api.json
 
 // Package mpls contains generated bindings for API file mpls.api.
 //
index 4a1d06e..258af4a 100644 (file)
@@ -5,9 +5,10 @@ package mpls
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  mpls.
index 811ed63..16b3d51 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/nat.api.json
 
 // Package nat contains generated bindings for API file nat.api.
 //
 package nat
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        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
index ad76f5d..bd07910 100644 (file)
@@ -5,9 +5,10 @@ package nat
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  nat.
index 5897a90..160f7bd 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/nsh.api.json
 
 // Package nsh contains generated bindings for API file nsh.api.
 //
index c91c85f..320aa9f 100644 (file)
@@ -5,9 +5,10 @@ package nsh
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  nsh.
index fb540ac..5a22c32 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/nsim.api.json
 
 // Package nsim contains generated bindings for API file nsim.api.
 //
index f35e6b3..863f945 100644 (file)
@@ -4,6 +4,7 @@ package nsim
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index c6f3e21..e28998e 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/oddbuf.api.json
 
 // Package oddbuf contains generated bindings for API file oddbuf.api.
 //
index a8c245e..93ccf3b 100644 (file)
@@ -4,6 +4,7 @@ package oddbuf
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index fa3b5af..e59be59 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/one.api.json
 
 // Package one contains generated bindings for API file one.api.
 //
 package one
 
 import (
+       "strconv"
+
        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"
        lisp_types "git.fd.io/govpp.git/binapi/lisp_types"
        codec "git.fd.io/govpp.git/codec"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 46bf36c..b870ba1 100644 (file)
@@ -5,9 +5,10 @@ package one
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  one.
index 2f76041..4d40c6f 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/p2p_ethernet.api.json
 
 // Package p2p_ethernet contains generated bindings for API file p2p_ethernet.api.
 //
index ed1e012..98cc2e3 100644 (file)
@@ -4,6 +4,7 @@ package p2p_ethernet
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 7b0d00c..c74ecc2 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/pci_types.api.json
 
 // Package pci_types contains generated bindings for API file pci_types.api.
 //
index 9a522c2..d2b26a0 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/pg.api.json
 
 // Package pg contains generated bindings for API file pg.api.
 //
index 1d905d0..28790a8 100644 (file)
@@ -4,6 +4,7 @@ package pg
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 6123059..8cc2d62 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/pipe.api.json
 
 // Package pipe contains generated bindings for API file pipe.api.
 //
index 3350ace..a084d9f 100644 (file)
@@ -5,9 +5,10 @@ package pipe
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  pipe.
index 1314dce..e86ec0e 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/policer.api.json
 
 // Package policer contains generated bindings for API file policer.api.
 //
index 9a7d8bf..870ba87 100644 (file)
@@ -5,9 +5,10 @@ package policer
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  policer.
index 5056fe5..a103888 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/policer_types.api.json
 
 // Package policer_types contains generated bindings for API file policer_types.api.
 //
@@ -13,8 +12,9 @@
 package policer_types
 
 import (
-       api "git.fd.io/govpp.git/api"
        "strconv"
+
+       api "git.fd.io/govpp.git/api"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 2c2d1f4..d060394 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/pot.api.json
 
 // Package pot contains generated bindings for API file pot.api.
 //
index 7426e49..3b43d50 100644 (file)
@@ -5,9 +5,10 @@ package pot
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  pot.
diff --git a/binapi/pp2/pp2.ba.go b/binapi/pp2/pp2.ba.go
new file mode 100644 (file)
index 0000000..ad91739
--- /dev/null
@@ -0,0 +1,191 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+// versions:
+//  binapi-generator: v0.4.0-dev
+//  VPP:              20.05-release
+
+// Package pp2 contains generated bindings for API file pp2.api.
+//
+// Contents:
+//   4 messages
+//
+package pp2
+
+import (
+       api "git.fd.io/govpp.git/api"
+       interface_types "git.fd.io/govpp.git/binapi/interface_types"
+       codec "git.fd.io/govpp.git/codec"
+)
+
+// 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    = "pp2"
+       APIVersion = "1.0.0"
+       VersionCrc = 0x85d7546b
+)
+
+// MrvlPp2Create defines message 'mrvl_pp2_create'.
+type MrvlPp2Create struct {
+       IfName string `binapi:"string[64],name=if_name" json:"if_name,omitempty"`
+       RxQSz  uint16 `binapi:"u16,name=rx_q_sz" json:"rx_q_sz,omitempty"`
+       TxQSz  uint16 `binapi:"u16,name=tx_q_sz" json:"tx_q_sz,omitempty"`
+}
+
+func (m *MrvlPp2Create) Reset()               { *m = MrvlPp2Create{} }
+func (*MrvlPp2Create) GetMessageName() string { return "mrvl_pp2_create" }
+func (*MrvlPp2Create) GetCrcString() string   { return "3a108396" }
+func (*MrvlPp2Create) GetMessageType() api.MessageType {
+       return api.RequestMessage
+}
+
+func (m *MrvlPp2Create) Size() (size int) {
+       if m == nil {
+               return 0
+       }
+       size += 64 // m.IfName
+       size += 2  // m.RxQSz
+       size += 2  // m.TxQSz
+       return size
+}
+func (m *MrvlPp2Create) Marshal(b []byte) ([]byte, error) {
+       if b == nil {
+               b = make([]byte, m.Size())
+       }
+       buf := codec.NewBuffer(b)
+       buf.EncodeString(m.IfName, 64)
+       buf.EncodeUint16(m.RxQSz)
+       buf.EncodeUint16(m.TxQSz)
+       return buf.Bytes(), nil
+}
+func (m *MrvlPp2Create) Unmarshal(b []byte) error {
+       buf := codec.NewBuffer(b)
+       m.IfName = buf.DecodeString(64)
+       m.RxQSz = buf.DecodeUint16()
+       m.TxQSz = buf.DecodeUint16()
+       return nil
+}
+
+// MrvlPp2CreateReply defines message 'mrvl_pp2_create_reply'.
+type MrvlPp2CreateReply struct {
+       Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
+       SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *MrvlPp2CreateReply) Reset()               { *m = MrvlPp2CreateReply{} }
+func (*MrvlPp2CreateReply) GetMessageName() string { return "mrvl_pp2_create_reply" }
+func (*MrvlPp2CreateReply) GetCrcString() string   { return "5383d31f" }
+func (*MrvlPp2CreateReply) GetMessageType() api.MessageType {
+       return api.ReplyMessage
+}
+
+func (m *MrvlPp2CreateReply) Size() (size int) {
+       if m == nil {
+               return 0
+       }
+       size += 4 // m.Retval
+       size += 4 // m.SwIfIndex
+       return size
+}
+func (m *MrvlPp2CreateReply) Marshal(b []byte) ([]byte, error) {
+       if b == nil {
+               b = make([]byte, m.Size())
+       }
+       buf := codec.NewBuffer(b)
+       buf.EncodeInt32(m.Retval)
+       buf.EncodeUint32(uint32(m.SwIfIndex))
+       return buf.Bytes(), nil
+}
+func (m *MrvlPp2CreateReply) Unmarshal(b []byte) error {
+       buf := codec.NewBuffer(b)
+       m.Retval = buf.DecodeInt32()
+       m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+       return nil
+}
+
+// MrvlPp2Delete defines message 'mrvl_pp2_delete'.
+type MrvlPp2Delete struct {
+       SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+}
+
+func (m *MrvlPp2Delete) Reset()               { *m = MrvlPp2Delete{} }
+func (*MrvlPp2Delete) GetMessageName() string { return "mrvl_pp2_delete" }
+func (*MrvlPp2Delete) GetCrcString() string   { return "f9e6675e" }
+func (*MrvlPp2Delete) GetMessageType() api.MessageType {
+       return api.RequestMessage
+}
+
+func (m *MrvlPp2Delete) Size() (size int) {
+       if m == nil {
+               return 0
+       }
+       size += 4 // m.SwIfIndex
+       return size
+}
+func (m *MrvlPp2Delete) Marshal(b []byte) ([]byte, error) {
+       if b == nil {
+               b = make([]byte, m.Size())
+       }
+       buf := codec.NewBuffer(b)
+       buf.EncodeUint32(uint32(m.SwIfIndex))
+       return buf.Bytes(), nil
+}
+func (m *MrvlPp2Delete) Unmarshal(b []byte) error {
+       buf := codec.NewBuffer(b)
+       m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+       return nil
+}
+
+// MrvlPp2DeleteReply defines message 'mrvl_pp2_delete_reply'.
+type MrvlPp2DeleteReply struct {
+       Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *MrvlPp2DeleteReply) Reset()               { *m = MrvlPp2DeleteReply{} }
+func (*MrvlPp2DeleteReply) GetMessageName() string { return "mrvl_pp2_delete_reply" }
+func (*MrvlPp2DeleteReply) GetCrcString() string   { return "e8d4e804" }
+func (*MrvlPp2DeleteReply) GetMessageType() api.MessageType {
+       return api.ReplyMessage
+}
+
+func (m *MrvlPp2DeleteReply) Size() (size int) {
+       if m == nil {
+               return 0
+       }
+       size += 4 // m.Retval
+       return size
+}
+func (m *MrvlPp2DeleteReply) Marshal(b []byte) ([]byte, error) {
+       if b == nil {
+               b = make([]byte, m.Size())
+       }
+       buf := codec.NewBuffer(b)
+       buf.EncodeInt32(m.Retval)
+       return buf.Bytes(), nil
+}
+func (m *MrvlPp2DeleteReply) Unmarshal(b []byte) error {
+       buf := codec.NewBuffer(b)
+       m.Retval = buf.DecodeInt32()
+       return nil
+}
+
+func init() { file_pp2_binapi_init() }
+func file_pp2_binapi_init() {
+       api.RegisterMessage((*MrvlPp2Create)(nil), "mrvl_pp2_create_3a108396")
+       api.RegisterMessage((*MrvlPp2CreateReply)(nil), "mrvl_pp2_create_reply_5383d31f")
+       api.RegisterMessage((*MrvlPp2Delete)(nil), "mrvl_pp2_delete_f9e6675e")
+       api.RegisterMessage((*MrvlPp2DeleteReply)(nil), "mrvl_pp2_delete_reply_e8d4e804")
+}
+
+// Messages returns list of all messages in this module.
+func AllMessages() []api.Message {
+       return []api.Message{
+               (*MrvlPp2Create)(nil),
+               (*MrvlPp2CreateReply)(nil),
+               (*MrvlPp2Delete)(nil),
+               (*MrvlPp2DeleteReply)(nil),
+       }
+}
diff --git a/binapi/pp2/pp2_rest.ba.go b/binapi/pp2/pp2_rest.ba.go
new file mode 100644 (file)
index 0000000..d3e69c0
--- /dev/null
@@ -0,0 +1,60 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package pp2
+
+import (
+       "encoding/json"
+       "io/ioutil"
+       "net/http"
+)
+
+func RESTHandler(rpc RPCService) http.Handler {
+       mux := http.NewServeMux()
+       mux.HandleFunc("/mrvl_pp2_create", func(w http.ResponseWriter, req *http.Request) {
+               var request = new(MrvlPp2Create)
+               b, err := ioutil.ReadAll(req.Body)
+               if err != nil {
+                       http.Error(w, "read body failed", http.StatusBadRequest)
+                       return
+               }
+               if err := json.Unmarshal(b, request); err != nil {
+                       http.Error(w, "unmarshal data failed", http.StatusBadRequest)
+                       return
+               }
+               reply, err := rpc.MrvlPp2Create(req.Context(), request)
+               if err != nil {
+                       http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+                       return
+               }
+               rep, err := json.MarshalIndent(reply, "", "  ")
+               if err != nil {
+                       http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+                       return
+               }
+               w.Write(rep)
+       })
+       mux.HandleFunc("/mrvl_pp2_delete", func(w http.ResponseWriter, req *http.Request) {
+               var request = new(MrvlPp2Delete)
+               b, err := ioutil.ReadAll(req.Body)
+               if err != nil {
+                       http.Error(w, "read body failed", http.StatusBadRequest)
+                       return
+               }
+               if err := json.Unmarshal(b, request); err != nil {
+                       http.Error(w, "unmarshal data failed", http.StatusBadRequest)
+                       return
+               }
+               reply, err := rpc.MrvlPp2Delete(req.Context(), request)
+               if err != nil {
+                       http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError)
+                       return
+               }
+               rep, err := json.MarshalIndent(reply, "", "  ")
+               if err != nil {
+                       http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError)
+                       return
+               }
+               w.Write(rep)
+       })
+       return http.HandlerFunc(mux.ServeHTTP)
+}
diff --git a/binapi/pp2/pp2_rpc.ba.go b/binapi/pp2/pp2_rpc.ba.go
new file mode 100644 (file)
index 0000000..d1f0bf5
--- /dev/null
@@ -0,0 +1,41 @@
+// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
+
+package pp2
+
+import (
+       "context"
+
+       api "git.fd.io/govpp.git/api"
+)
+
+// RPCService defines RPC service  pp2.
+type RPCService interface {
+       MrvlPp2Create(ctx context.Context, in *MrvlPp2Create) (*MrvlPp2CreateReply, error)
+       MrvlPp2Delete(ctx context.Context, in *MrvlPp2Delete) (*MrvlPp2DeleteReply, error)
+}
+
+type serviceClient struct {
+       conn api.Connection
+}
+
+func NewServiceClient(conn api.Connection) RPCService {
+       return &serviceClient{conn}
+}
+
+func (c *serviceClient) MrvlPp2Create(ctx context.Context, in *MrvlPp2Create) (*MrvlPp2CreateReply, error) {
+       out := new(MrvlPp2CreateReply)
+       err := c.conn.Invoke(ctx, in, out)
+       if err != nil {
+               return nil, err
+       }
+       return out, nil
+}
+
+func (c *serviceClient) MrvlPp2Delete(ctx context.Context, in *MrvlPp2Delete) (*MrvlPp2DeleteReply, error) {
+       out := new(MrvlPp2DeleteReply)
+       err := c.conn.Invoke(ctx, in, out)
+       if err != nil {
+               return nil, err
+       }
+       return out, nil
+}
index e01d3b5..cb310fb 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/pppoe.api.json
 
 // Package pppoe contains generated bindings for API file pppoe.api.
 //
index 384d5a8..6a21a10 100644 (file)
@@ -5,9 +5,10 @@ package pppoe
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  pppoe.
index 18ff678..f8483fc 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/punt.api.json
 
 // Package punt contains generated bindings for API file punt.api.
 //
 package punt
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        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
index e2150ed..9a058cb 100644 (file)
@@ -5,9 +5,10 @@ package punt
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  punt.
index 2f889fd..21201f0 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/qos.api.json
 
 // Package qos contains generated bindings for API file qos.api.
 //
 package qos
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        interface_types "git.fd.io/govpp.git/binapi/interface_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
index a31f611..50f6427 100644 (file)
@@ -5,9 +5,10 @@ package qos
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  qos.
index 8cafa0f..ca35324 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/rd_cp.api.json
 
 // Package rd_cp contains generated bindings for API file rd_cp.api.
 //
index af7ba12..5e7e7fe 100644 (file)
@@ -4,6 +4,7 @@ package rd_cp
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 001fefe..3dc2f9f 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/rdma.api.json
 
 // Package rdma contains generated bindings for API file rdma.api.
 //
 package rdma
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        interface_types "git.fd.io/govpp.git/binapi/interface_types"
        codec "git.fd.io/govpp.git/codec"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 850f04a..7e9f60d 100644 (file)
@@ -4,6 +4,7 @@ package rdma
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 6e20c49..3d66275 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/session.api.json
 
 // Package session contains generated bindings for API file session.api.
 //
 package session
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        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
index 1737ef5..3868572 100644 (file)
@@ -5,9 +5,10 @@ package session
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  session.
index 2dcbc37..6cced54 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/span.api.json
 
 // Package span contains generated bindings for API file span.api.
 //
 package span
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        interface_types "git.fd.io/govpp.git/binapi/interface_types"
        codec "git.fd.io/govpp.git/codec"
-       "strconv"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 3f34859..f9f9538 100644 (file)
@@ -5,9 +5,10 @@ package span
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  span.
index 2b98b8a..ee83937 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/sr.api.json
 
 // Package sr contains generated bindings for API file sr.api.
 //
index 59a2909..450ced9 100644 (file)
@@ -5,9 +5,10 @@ package sr
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  sr.
index e6bd9f0..9785405 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/sr_mpls.api.json
 
 // Package sr_mpls contains generated bindings for API file sr_mpls.api.
 //
index 8669e70..ec0f46d 100644 (file)
@@ -4,6 +4,7 @@ package sr_mpls
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index df9f0f6..8a21c76 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/sr_types.api.json
 
 // Package sr_types contains generated bindings for API file sr_types.api.
 //
@@ -12,8 +11,9 @@
 package sr_types
 
 import (
-       api "git.fd.io/govpp.git/api"
        "strconv"
+
+       api "git.fd.io/govpp.git/api"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index b44adf5..035a819 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/stn.api.json
 
 // Package stn contains generated bindings for API file stn.api.
 //
index 932074c..4cc7087 100644 (file)
@@ -5,9 +5,10 @@ package stn
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  stn.
index 911e936..788864c 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/svs.api.json
 
 // Package svs contains generated bindings for API file svs.api.
 //
index d934f9e..3de2a03 100644 (file)
@@ -5,9 +5,10 @@ package svs
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  svs.
index c9bdab7..bb49eae 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/syslog.api.json
 
 // Package syslog contains generated bindings for API file syslog.api.
 //
 package syslog
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        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
index a1f4a27..385960f 100644 (file)
@@ -4,6 +4,7 @@ package syslog
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 3745c83..b9443a6 100644 (file)
@@ -2,7 +2,6 @@
 // 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.
 //
 package tapv2
 
 import (
+       "strconv"
+
        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
index ab530eb..7742fd3 100644 (file)
@@ -5,9 +5,10 @@ package tapv2
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  tapv2.
index 7ae3ecc..06ffcdf 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/tcp.api.json
 
 // Package tcp contains generated bindings for API file tcp.api.
 //
index 8be3619..a87c7e5 100644 (file)
@@ -4,6 +4,7 @@ package tcp
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index d37f391..d4473c7 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/teib.api.json
 
 // Package teib contains generated bindings for API file teib.api.
 //
index 4803c2d..579f9e5 100644 (file)
@@ -5,9 +5,10 @@ package teib
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  teib.
index 938a9df..8b8f318 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/tls_openssl.api.json
 
 // Package tls_openssl contains generated bindings for API file tls_openssl.api.
 //
index 2575bf2..69a5de5 100644 (file)
@@ -4,6 +4,7 @@ package tls_openssl
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 9bc330b..c360cbd 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/trace.api.json
 
 // Package trace contains generated bindings for API file trace.api.
 //
index f0f2ca7..09bf889 100644 (file)
@@ -4,6 +4,7 @@ package trace
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 30cdba8..ae9f53f 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/tunnel_types.api.json
 
 // Package tunnel_types contains generated bindings for API file tunnel_types.api.
 //
@@ -12,8 +11,9 @@
 package tunnel_types
 
 import (
-       api "git.fd.io/govpp.git/api"
        "strconv"
+
+       api "git.fd.io/govpp.git/api"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 7795100..52109ca 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/udp.api.json
 
 // Package udp contains generated bindings for API file udp.api.
 //
index adb495c..8d99214 100644 (file)
@@ -5,9 +5,10 @@ package udp
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  udp.
index 7247b38..a457715 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/udp_ping.api.json
 
 // Package udp_ping contains generated bindings for API file udp_ping.api.
 //
index eae0ab4..4aa51f6 100644 (file)
@@ -4,6 +4,7 @@ package udp_ping
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index c504cfb..af7f5b4 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/urpf.api.json
 
 // Package urpf contains generated bindings for API file urpf.api.
 //
 package urpf
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        _ "git.fd.io/govpp.git/binapi/fib_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
index 92441b1..04d4b56 100644 (file)
@@ -4,6 +4,7 @@ package urpf
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index 0ca7119..f384bac 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/vhost_user.api.json
 
 // Package vhost_user contains generated bindings for API file vhost_user.api.
 //
index 091ed53..6e18a51 100644 (file)
@@ -5,9 +5,10 @@ package vhost_user
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  vhost_user.
index b29b52f..133f0ac 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/virtio.api.json
 
 // Package virtio contains generated bindings for API file virtio.api.
 //
index 785a460..4fa4bb1 100644 (file)
@@ -5,9 +5,10 @@ package virtio
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  virtio.
index 2b8fa5d..e8a262d 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/virtio_types.api.json
 
 // Package virtio_types contains generated bindings for API file virtio_types.api.
 //
@@ -12,8 +11,9 @@
 package virtio_types
 
 import (
-       api "git.fd.io/govpp.git/api"
        "strconv"
+
+       api "git.fd.io/govpp.git/api"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index 77937fa..2abc2a0 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/vmxnet3.api.json
 
 // Package vmxnet3 contains generated bindings for API file vmxnet3.api.
 //
index cb4020d..facc468 100644 (file)
@@ -5,9 +5,10 @@ package vmxnet3
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  vmxnet3.
index 046bd68..594f0c4 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/vpe.api.json
 
 // Package vpe contains generated bindings for API file vpe.api.
 //
index dfa669f..e41f5f8 100644 (file)
@@ -5,8 +5,9 @@ package vpe
 import (
        "context"
        "fmt"
-       api "git.fd.io/govpp.git/api"
        "io"
+
+       api "git.fd.io/govpp.git/api"
 )
 
 // RPCService defines RPC service  vpe.
index 538b497..6a93afd 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/vpe_types.api.json
 
 // Package vpe_types contains generated bindings for API file vpe_types.api.
 //
@@ -14,8 +13,9 @@
 package vpe_types
 
 import (
-       api "git.fd.io/govpp.git/api"
        "strconv"
+
+       api "git.fd.io/govpp.git/api"
 )
 
 // This is a compile-time assertion to ensure that this generated file
index ef34cdd..b854828 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/vrrp.api.json
 
 // Package vrrp contains generated bindings for API file vrrp.api.
 //
 package vrrp
 
 import (
+       "strconv"
+
        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
index c001082..12be3c8 100644 (file)
@@ -5,9 +5,10 @@ package vrrp
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  vrrp.
index 048b2fa..d4c617f 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/vxlan.api.json
 
 // Package vxlan contains generated bindings for API file vxlan.api.
 //
index 5284fab..34692bb 100644 (file)
@@ -5,9 +5,10 @@ package vxlan
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  vxlan.
index 886d30a..53554c9 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/vxlan_gbp.api.json
 
 // Package vxlan_gbp contains generated bindings for API file vxlan_gbp.api.
 //
 package vxlan_gbp
 
 import (
+       "strconv"
+
        api "git.fd.io/govpp.git/api"
        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
index 7d23984..403230a 100644 (file)
@@ -5,9 +5,10 @@ package vxlan_gbp
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  vxlan_gbp.
index 0858ada..d36b98e 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/core/vxlan_gpe.api.json
 
 // Package vxlan_gpe contains generated bindings for API file vxlan_gpe.api.
 //
index f36262e..13c2a1c 100644 (file)
@@ -5,9 +5,10 @@ package vxlan_gpe
 import (
        "context"
        "fmt"
+       "io"
+
        api "git.fd.io/govpp.git/api"
        vpe "git.fd.io/govpp.git/binapi/vpe"
-       "io"
 )
 
 // RPCService defines RPC service  vxlan_gpe.
index 8820fab..099443f 100644 (file)
@@ -2,7 +2,6 @@
 // versions:
 //  binapi-generator: v0.4.0-dev
 //  VPP:              20.05-release
-// source: /usr/share/vpp/api/plugins/vxlan_gpe_ioam_export.api.json
 
 // Package vxlan_gpe_ioam_export contains generated bindings for API file vxlan_gpe_ioam_export.api.
 //
index ce35b62..d09e3f6 100644 (file)
@@ -4,6 +4,7 @@ package vxlan_gpe_ioam_export
 
 import (
        "context"
+
        api "git.fd.io/govpp.git/api"
 )
 
index a6f1615..e5eed5a 100644 (file)
@@ -223,6 +223,13 @@ func (g *GenFile) Content() ([]byte, error) {
        return g.injectImports(g.buf.Bytes())
 }
 
+func getImportClass(importPath string) int {
+       if !strings.Contains(importPath, ".") {
+               return 0 /* std */
+       }
+       return 1 /* External */
+}
+
 // injectImports parses source, injects import block declaration with all imports and return formatted
 func (g *GenFile) injectImports(original []byte) ([]byte, error) {
        // Parse source code
@@ -259,7 +266,12 @@ func (g *GenFile) injectImports(original []byte) ([]byte, error) {
        }
        // Sort imports by import path
        sort.Slice(importPaths, func(i, j int) bool {
-               return importPaths[i].Path < importPaths[j].Path
+               ci := getImportClass(importPaths[i].Path)
+               cj := getImportClass(importPaths[j].Path)
+               if ci == cj {
+                       return importPaths[i].Path < importPaths[j].Path
+               }
+               return ci < cj
        })
        // Inject new import block into parsed AST
        if len(importPaths) > 0 {
@@ -275,14 +287,20 @@ func (g *GenFile) injectImports(original []byte) ([]byte, error) {
                }
                // Prepare the import block
                impDecl := &ast.GenDecl{Tok: token.IMPORT, TokPos: pos, Lparen: pos, Rparen: pos}
-               for _, importPath := range importPaths {
+               for i, importPath := range importPaths {
                        var name *ast.Ident
                        if importPath.Name == "_" || strings.Contains(importPath.Path, ".") {
                                name = &ast.Ident{Name: importPath.Name, NamePos: pos}
                        }
+                       value := strconv.Quote(importPath.Path)
+                       if i < len(importPaths)-1 {
+                               if getImportClass(importPath.Path) != getImportClass(importPaths[i+1].Path) {
+                                       value += "\n"
+                               }
+                       }
                        impDecl.Specs = append(impDecl.Specs, &ast.ImportSpec{
                                Name:   name,
-                               Path:   &ast.BasicLit{Kind: token.STRING, Value: strconv.Quote(importPath.Path), ValuePos: pos},
+                               Path:   &ast.BasicLit{Kind: token.STRING, Value: value, ValuePos: pos},
                                EndPos: pos,
                        })
                }
index 87f2e55..3db8ef5 100644 (file)
@@ -26,7 +26,9 @@ import (
 )
 
 const (
-       VPPVersionEnvVar = "VPP_VERSION"
+       VPPVersionEnvVar  = "VPP_VERSION"
+       VPPDirEnvVar      = "VPP_DIR"
+       versionScriptPath = "./src/scripts/version"
 )
 
 // ResolveVPPVersion resolves version of the VPP for target directory.
@@ -35,7 +37,7 @@ const (
 func ResolveVPPVersion(apidir string) string {
        // check env variable override
        if ver := os.Getenv(VPPVersionEnvVar); ver != "" {
-               logrus.Debugf("VPP version was manually set to %q via %s env var", ver, VPPVersionEnvVar)
+               logrus.Infof("VPP version was manually set to %q via %s env var", ver, VPPVersionEnvVar)
                return ver
        }
 
@@ -60,7 +62,7 @@ func ResolveVPPVersion(apidir string) string {
                if err != nil {
                        logrus.Warnf("resolving VPP version from version script failed: %v", err)
                } else {
-                       logrus.Debugf("resolved VPP version from version script: %v", version)
+                       logrus.Infof("resolved VPP version from version script: %v", version)
                        return version
                }
        }
@@ -85,14 +87,13 @@ func GetVPPVersionInstalled() (string, error) {
        return strings.TrimSpace(string(out)), nil
 }
 
-const versionScriptPath = "./src/scripts/version"
-
 // GetVPPVersionRepo retrieves VPP version using script in repo directory.
 func GetVPPVersionRepo(repoDir string) (string, error) {
-       if _, err := os.Stat(versionScriptPath); err != nil {
+       scriptPath := path.Join(repoDir, versionScriptPath)
+       if _, err := os.Stat(scriptPath); err != nil {
                return "", err
        }
-       cmd := exec.Command(versionScriptPath)
+       cmd := exec.Command(scriptPath)
        cmd.Dir = repoDir
        out, err := cmd.CombinedOutput()
        if err != nil {
@@ -102,6 +103,10 @@ func GetVPPVersionRepo(repoDir string) (string, error) {
 }
 
 func findGitRepoRootDir(dir string) (string, error) {
+       if conf := os.Getenv(VPPDirEnvVar); conf != "" {
+               logrus.Infof("VPP directory was manually set to %q via %s env var", conf, VPPDirEnvVar)
+               return conf, nil
+       }
        cmd := exec.Command("git", "rev-parse", "--show-toplevel")
        cmd.Dir = dir
        out, err := cmd.CombinedOutput()
index af60628..a730df4 100644 (file)
@@ -31,20 +31,34 @@ import (
 
 func init() {
        flag.Usage = func() {
-               fmt.Fprintf(os.Stderr, "Usage: %s [OPTION] API_FILES\n", os.Args[0])
-               fmt.Fprintln(os.Stderr, "Provide API_FILES by file name, or with full path including extension.")
-               fmt.Fprintln(os.Stderr, "Parse API_FILES and generate Go bindings based on the options given:")
+               fmt.Fprintf(os.Stderr, "USAGE\n")
+               fmt.Fprintf(os.Stderr, "  Parse API_FILES and generate Go bindings\n")
+               fmt.Fprintf(os.Stderr, "  Provide API_FILES by file name, or with full path including extension.\n")
+               fmt.Fprintf(os.Stderr, "  %s [OPTION] API_FILES\n\n", os.Args[0])
+               fmt.Fprintf(os.Stderr, "OPTIONS\n")
                flag.PrintDefaults()
+               fmt.Fprintf(os.Stderr, "\nEXAMPLES:\n")
+               fmt.Fprintf(os.Stderr, "  %s \\\n", os.Args[0])
+               fmt.Fprintf(os.Stderr, "    --input-dir=$VPP/build-root/install-vpp-native/vpp/share/vpp/api/ \\\n")
+               fmt.Fprintf(os.Stderr, "    --output-dir=~/output \\\n")
+               fmt.Fprintf(os.Stderr, "    interface ip\n")
+               fmt.Fprintf(os.Stderr, "  Assuming --input-dir contains interface.api.json & ip.api.json\n")
        }
 }
 
+func printErrorAndExit(msg string) {
+       fmt.Fprintf(os.Stderr, "Error: %s\n\n", msg)
+       flag.Usage()
+       os.Exit(1)
+}
+
 func main() {
        var (
-               theApiDir        = flag.String("input-dir", vppapi.DefaultDir, "Input directory containing API files.")
-               theInputFile     = flag.String("input-file", "", "DEPRECATED: Use program arguments to define files to generate.")
+               theApiDir        = flag.String("input-dir", vppapi.DefaultDir, "Input directory containing API files. (e.g. )")
                theOutputDir     = flag.String("output-dir", "binapi", "Output directory where code will be generated.")
-               importPrefix     = flag.String("import-prefix", "", "Define import path prefix to be used to import types.")
+               importPrefix     = flag.String("import-prefix", "", "Prefix imports in the generated go code. \nE.g. other API Files (e.g. api_file.ba.go) will be imported with :\nimport (\n  api_file \"<import-prefix>/api_file\"\n)")
                generatorPlugins = flag.String("gen", "rpc", "List of generator plugins to run for files.")
+               theInputFile     = flag.String("input-file", "", "DEPRECATED: Use program arguments to define files to generate.")
 
                printVersion     = flag.Bool("version", false, "Prints version and exits.")
                debugLog         = flag.Bool("debug", false, "Enable verbose logging.")
@@ -65,8 +79,7 @@ func main() {
        var filesToGenerate []string
        if *theInputFile != "" {
                if flag.NArg() > 0 {
-                       fmt.Fprintln(os.Stderr, "input-file cannot be combined with files to generate in arguments")
-                       os.Exit(1)
+                       printErrorAndExit("input-file cannot be combined with files to generate in arguments")
                }
                filesToGenerate = append(filesToGenerate, *theInputFile)
        } else {