diff options
Diffstat (limited to 'binapi/oddbuf')
-rw-r--r-- | binapi/oddbuf/oddbuf.ba.go | 14 | ||||
-rw-r--r-- | binapi/oddbuf/oddbuf_rest.ba.go | 37 | ||||
-rw-r--r-- | binapi/oddbuf/oddbuf_rpc.ba.go | 7 |
3 files changed, 12 insertions, 46 deletions
diff --git a/binapi/oddbuf/oddbuf.ba.go b/binapi/oddbuf/oddbuf.ba.go index c6f3e21..73656b9 100644 --- a/binapi/oddbuf/oddbuf.ba.go +++ b/binapi/oddbuf/oddbuf.ba.go @@ -1,7 +1,7 @@ // Code generated by GoVPP's binapi-generator. DO NOT EDIT. // versions: -// binapi-generator: v0.4.0-dev -// VPP: 20.05-release +// binapi-generator: v0.6.0-dev +// VPP: 22.02-release // source: /usr/share/vpp/api/plugins/oddbuf.api.json // Package oddbuf contains generated bindings for API file oddbuf.api. @@ -12,9 +12,9 @@ package oddbuf 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" + api "go.fd.io/govpp/api" + interface_types "go.fd.io/govpp/binapi/interface_types" + codec "go.fd.io/govpp/codec" ) // This is a compile-time assertion to ensure that this generated file @@ -26,10 +26,11 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "oddbuf" APIVersion = "0.1.0" - VersionCrc = 0x95757869 + VersionCrc = 0x3a1a2c50 ) // OddbufEnableDisable defines message 'oddbuf_enable_disable'. +// InProgress: the message form may change in the future versions type OddbufEnableDisable struct { EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` @@ -67,6 +68,7 @@ func (m *OddbufEnableDisable) Unmarshal(b []byte) error { } // OddbufEnableDisableReply defines message 'oddbuf_enable_disable_reply'. +// InProgress: the message form may change in the future versions type OddbufEnableDisableReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` } diff --git a/binapi/oddbuf/oddbuf_rest.ba.go b/binapi/oddbuf/oddbuf_rest.ba.go deleted file mode 100644 index b50418c..0000000 --- a/binapi/oddbuf/oddbuf_rest.ba.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by GoVPP's binapi-generator. DO NOT EDIT. - -package oddbuf - -import ( - "encoding/json" - "io/ioutil" - "net/http" -) - -func RESTHandler(rpc RPCService) http.Handler { - mux := http.NewServeMux() - mux.HandleFunc("/oddbuf_enable_disable", func(w http.ResponseWriter, req *http.Request) { - var request = new(OddbufEnableDisable) - 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.OddbufEnableDisable(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/oddbuf/oddbuf_rpc.ba.go b/binapi/oddbuf/oddbuf_rpc.ba.go index a8c245e..426eaed 100644 --- a/binapi/oddbuf/oddbuf_rpc.ba.go +++ b/binapi/oddbuf/oddbuf_rpc.ba.go @@ -4,10 +4,11 @@ package oddbuf import ( "context" - api "git.fd.io/govpp.git/api" + + api "go.fd.io/govpp/api" ) -// RPCService defines RPC service oddbuf. +// RPCService defines RPC service oddbuf. type RPCService interface { OddbufEnableDisable(ctx context.Context, in *OddbufEnableDisable) (*OddbufEnableDisableReply, error) } @@ -26,5 +27,5 @@ func (c *serviceClient) OddbufEnableDisable(ctx context.Context, in *OddbufEnabl if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } |