diff options
Diffstat (limited to 'binapi/lldp')
-rw-r--r-- | binapi/lldp/lldp.ba.go | 20 | ||||
-rw-r--r-- | binapi/lldp/lldp_rest.ba.go | 60 | ||||
-rw-r--r-- | binapi/lldp/lldp_rpc.ba.go | 9 |
3 files changed, 15 insertions, 74 deletions
diff --git a/binapi/lldp/lldp.ba.go b/binapi/lldp/lldp.ba.go index a8769b5..bf513a9 100644 --- a/binapi/lldp/lldp.ba.go +++ b/binapi/lldp/lldp.ba.go @@ -1,8 +1,8 @@ // Code generated by GoVPP's binapi-generator. DO NOT EDIT. // versions: -// binapi-generator: v0.4.0-dev -// VPP: 20.05-release -// source: /usr/share/vpp/api/core/lldp.api.json +// binapi-generator: v0.6.0-dev +// VPP: 22.02-release +// source: /usr/share/vpp/api/plugins/lldp.api.json // Package lldp contains generated bindings for API file lldp.api. // @@ -12,10 +12,10 @@ package lldp import ( - 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" + api "go.fd.io/govpp/api" + interface_types "go.fd.io/govpp/binapi/interface_types" + 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 @@ -27,7 +27,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "lldp" APIVersion = "2.0.0" - VersionCrc = 0x44347d6 + VersionCrc = 0x8a7e7049 ) // LldpConfig defines message 'lldp_config'. @@ -116,7 +116,7 @@ type SwInterfaceSetLldp struct { func (m *SwInterfaceSetLldp) Reset() { *m = SwInterfaceSetLldp{} } func (*SwInterfaceSetLldp) GetMessageName() string { return "sw_interface_set_lldp" } -func (*SwInterfaceSetLldp) GetCrcString() string { return "d646ae0f" } +func (*SwInterfaceSetLldp) GetCrcString() string { return "57afbcd4" } func (*SwInterfaceSetLldp) GetMessageType() api.MessageType { return api.RequestMessage } @@ -195,7 +195,7 @@ func init() { file_lldp_binapi_init() } func file_lldp_binapi_init() { api.RegisterMessage((*LldpConfig)(nil), "lldp_config_c14445df") api.RegisterMessage((*LldpConfigReply)(nil), "lldp_config_reply_e8d4e804") - api.RegisterMessage((*SwInterfaceSetLldp)(nil), "sw_interface_set_lldp_d646ae0f") + api.RegisterMessage((*SwInterfaceSetLldp)(nil), "sw_interface_set_lldp_57afbcd4") api.RegisterMessage((*SwInterfaceSetLldpReply)(nil), "sw_interface_set_lldp_reply_e8d4e804") } diff --git a/binapi/lldp/lldp_rest.ba.go b/binapi/lldp/lldp_rest.ba.go deleted file mode 100644 index 807ef94..0000000 --- a/binapi/lldp/lldp_rest.ba.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by GoVPP's binapi-generator. DO NOT EDIT. - -package lldp - -import ( - "encoding/json" - "io/ioutil" - "net/http" -) - -func RESTHandler(rpc RPCService) http.Handler { - mux := http.NewServeMux() - mux.HandleFunc("/lldp_config", func(w http.ResponseWriter, req *http.Request) { - var request = new(LldpConfig) - 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.LldpConfig(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("/sw_interface_set_lldp", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceSetLldp) - 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.SwInterfaceSetLldp(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/lldp/lldp_rpc.ba.go b/binapi/lldp/lldp_rpc.ba.go index 9d5eb85..bf32fcf 100644 --- a/binapi/lldp/lldp_rpc.ba.go +++ b/binapi/lldp/lldp_rpc.ba.go @@ -4,10 +4,11 @@ package lldp import ( "context" - api "git.fd.io/govpp.git/api" + + api "go.fd.io/govpp/api" ) -// RPCService defines RPC service lldp. +// RPCService defines RPC service lldp. type RPCService interface { LldpConfig(ctx context.Context, in *LldpConfig) (*LldpConfigReply, error) SwInterfaceSetLldp(ctx context.Context, in *SwInterfaceSetLldp) (*SwInterfaceSetLldpReply, error) @@ -27,7 +28,7 @@ func (c *serviceClient) LldpConfig(ctx context.Context, in *LldpConfig) (*LldpCo if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceSetLldp(ctx context.Context, in *SwInterfaceSetLldp) (*SwInterfaceSetLldpReply, error) { @@ -36,5 +37,5 @@ func (c *serviceClient) SwInterfaceSetLldp(ctx context.Context, in *SwInterfaceS if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } |