diff options
Diffstat (limited to 'binapi/udp_ping')
-rw-r--r-- | binapi/udp_ping/udp_ping.ba.go | 16 | ||||
-rw-r--r-- | binapi/udp_ping/udp_ping_rest.ba.go | 60 | ||||
-rw-r--r-- | binapi/udp_ping/udp_ping_rpc.ba.go | 9 |
3 files changed, 13 insertions, 72 deletions
diff --git a/binapi/udp_ping/udp_ping.ba.go b/binapi/udp_ping/udp_ping.ba.go index 7247b38..0ac85ae 100644 --- a/binapi/udp_ping/udp_ping.ba.go +++ b/binapi/udp_ping/udp_ping.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/udp_ping.api.json // Package udp_ping contains generated bindings for API file udp_ping.api. @@ -12,9 +12,9 @@ package udp_ping import ( - api "git.fd.io/govpp.git/api" - ip_types "git.fd.io/govpp.git/binapi/ip_types" - codec "git.fd.io/govpp.git/codec" + api "go.fd.io/govpp/api" + ip_types "go.fd.io/govpp/binapi/ip_types" + codec "go.fd.io/govpp/codec" ) // This is a compile-time assertion to ensure that this generated file @@ -26,7 +26,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "udp_ping" APIVersion = "3.0.0" - VersionCrc = 0x3b2c67de + VersionCrc = 0x16d961db ) // UDPPingAddDel defines message 'udp_ping_add_del'. @@ -45,7 +45,7 @@ type UDPPingAddDel struct { func (m *UDPPingAddDel) Reset() { *m = UDPPingAddDel{} } func (*UDPPingAddDel) GetMessageName() string { return "udp_ping_add_del" } -func (*UDPPingAddDel) GetCrcString() string { return "c692b188" } +func (*UDPPingAddDel) GetCrcString() string { return "fa2628fc" } func (*UDPPingAddDel) GetMessageType() api.MessageType { return api.RequestMessage } @@ -206,7 +206,7 @@ func (m *UDPPingExportReply) Unmarshal(b []byte) error { func init() { file_udp_ping_binapi_init() } func file_udp_ping_binapi_init() { - api.RegisterMessage((*UDPPingAddDel)(nil), "udp_ping_add_del_c692b188") + api.RegisterMessage((*UDPPingAddDel)(nil), "udp_ping_add_del_fa2628fc") api.RegisterMessage((*UDPPingAddDelReply)(nil), "udp_ping_add_del_reply_e8d4e804") api.RegisterMessage((*UDPPingExport)(nil), "udp_ping_export_b3e225d2") api.RegisterMessage((*UDPPingExportReply)(nil), "udp_ping_export_reply_e8d4e804") diff --git a/binapi/udp_ping/udp_ping_rest.ba.go b/binapi/udp_ping/udp_ping_rest.ba.go deleted file mode 100644 index 41317c4..0000000 --- a/binapi/udp_ping/udp_ping_rest.ba.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by GoVPP's binapi-generator. DO NOT EDIT. - -package udp_ping - -import ( - "encoding/json" - "io/ioutil" - "net/http" -) - -func RESTHandler(rpc RPCService) http.Handler { - mux := http.NewServeMux() - mux.HandleFunc("/udp_ping_add_del", func(w http.ResponseWriter, req *http.Request) { - var request = new(UDPPingAddDel) - 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.UDPPingAddDel(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("/udp_ping_export", func(w http.ResponseWriter, req *http.Request) { - var request = new(UDPPingExport) - 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.UDPPingExport(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/udp_ping/udp_ping_rpc.ba.go b/binapi/udp_ping/udp_ping_rpc.ba.go index eae0ab4..03b6154 100644 --- a/binapi/udp_ping/udp_ping_rpc.ba.go +++ b/binapi/udp_ping/udp_ping_rpc.ba.go @@ -4,10 +4,11 @@ package udp_ping import ( "context" - api "git.fd.io/govpp.git/api" + + api "go.fd.io/govpp/api" ) -// RPCService defines RPC service udp_ping. +// RPCService defines RPC service udp_ping. type RPCService interface { UDPPingAddDel(ctx context.Context, in *UDPPingAddDel) (*UDPPingAddDelReply, error) UDPPingExport(ctx context.Context, in *UDPPingExport) (*UDPPingExportReply, error) @@ -27,7 +28,7 @@ func (c *serviceClient) UDPPingAddDel(ctx context.Context, in *UDPPingAddDel) (* if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) UDPPingExport(ctx context.Context, in *UDPPingExport) (*UDPPingExportReply, error) { @@ -36,5 +37,5 @@ func (c *serviceClient) UDPPingExport(ctx context.Context, in *UDPPingExport) (* if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } |