diff options
Diffstat (limited to 'binapi/abf')
-rw-r--r-- | binapi/abf/abf.ba.go | 34 | ||||
-rw-r--r-- | binapi/abf/abf_rest.ba.go | 74 | ||||
-rw-r--r-- | binapi/abf/abf_rpc.ba.go | 27 |
3 files changed, 40 insertions, 95 deletions
diff --git a/binapi/abf/abf.ba.go b/binapi/abf/abf.ba.go index 2b28afe..e523e8f 100644 --- a/binapi/abf/abf.ba.go +++ b/binapi/abf/abf.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/abf.api.json // Package abf contains generated bindings for API file abf.api. @@ -13,11 +13,11 @@ package abf import ( - api "git.fd.io/govpp.git/api" - fib_types "git.fd.io/govpp.git/binapi/fib_types" - 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" + api "go.fd.io/govpp/api" + fib_types "go.fd.io/govpp/binapi/fib_types" + interface_types "go.fd.io/govpp/binapi/interface_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 @@ -29,7 +29,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "abf" APIVersion = "1.0.0" - VersionCrc = 0x460b09b9 + VersionCrc = 0xf2367b47 ) // AbfItfAttach defines type 'abf_itf_attach'. @@ -49,6 +49,7 @@ type AbfPolicy struct { } // AbfItfAttachAddDel defines message 'abf_itf_attach_add_del'. +// InProgress: the message form may change in the future versions type AbfItfAttachAddDel struct { IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` Attach AbfItfAttach `binapi:"abf_itf_attach,name=attach" json:"attach,omitempty"` @@ -95,6 +96,7 @@ func (m *AbfItfAttachAddDel) Unmarshal(b []byte) error { } // AbfItfAttachAddDelReply defines message 'abf_itf_attach_add_del_reply'. +// InProgress: the message form may change in the future versions type AbfItfAttachAddDelReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` } @@ -128,6 +130,7 @@ func (m *AbfItfAttachAddDelReply) Unmarshal(b []byte) error { } // AbfItfAttachDetails defines message 'abf_itf_attach_details'. +// InProgress: the message form may change in the future versions type AbfItfAttachDetails struct { Attach AbfItfAttach `binapi:"abf_itf_attach,name=attach" json:"attach,omitempty"` } @@ -170,6 +173,7 @@ func (m *AbfItfAttachDetails) Unmarshal(b []byte) error { } // AbfItfAttachDump defines message 'abf_itf_attach_dump'. +// InProgress: the message form may change in the future versions type AbfItfAttachDump struct{} func (m *AbfItfAttachDump) Reset() { *m = AbfItfAttachDump{} } @@ -197,6 +201,7 @@ func (m *AbfItfAttachDump) Unmarshal(b []byte) error { } // AbfPluginGetVersion defines message 'abf_plugin_get_version'. +// InProgress: the message form may change in the future versions type AbfPluginGetVersion struct{} func (m *AbfPluginGetVersion) Reset() { *m = AbfPluginGetVersion{} } @@ -224,6 +229,7 @@ func (m *AbfPluginGetVersion) Unmarshal(b []byte) error { } // AbfPluginGetVersionReply defines message 'abf_plugin_get_version_reply'. +// InProgress: the message form may change in the future versions type AbfPluginGetVersionReply struct { Major uint32 `binapi:"u32,name=major" json:"major,omitempty"` Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"` @@ -261,6 +267,7 @@ func (m *AbfPluginGetVersionReply) Unmarshal(b []byte) error { } // AbfPolicyAddDel defines message 'abf_policy_add_del'. +// InProgress: the message form may change in the future versions type AbfPolicyAddDel struct { IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` Policy AbfPolicy `binapi:"abf_policy,name=policy" json:"policy,omitempty"` @@ -268,7 +275,7 @@ type AbfPolicyAddDel struct { func (m *AbfPolicyAddDel) Reset() { *m = AbfPolicyAddDel{} } func (*AbfPolicyAddDel) GetMessageName() string { return "abf_policy_add_del" } -func (*AbfPolicyAddDel) GetCrcString() string { return "ee66f93e" } +func (*AbfPolicyAddDel) GetCrcString() string { return "c6131197" } func (*AbfPolicyAddDel) GetMessageType() api.MessageType { return api.RequestMessage } @@ -377,6 +384,7 @@ func (m *AbfPolicyAddDel) Unmarshal(b []byte) error { } // AbfPolicyAddDelReply defines message 'abf_policy_add_del_reply'. +// InProgress: the message form may change in the future versions type AbfPolicyAddDelReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` } @@ -410,13 +418,14 @@ func (m *AbfPolicyAddDelReply) Unmarshal(b []byte) error { } // AbfPolicyDetails defines message 'abf_policy_details'. +// InProgress: the message form may change in the future versions type AbfPolicyDetails struct { Policy AbfPolicy `binapi:"abf_policy,name=policy" json:"policy,omitempty"` } func (m *AbfPolicyDetails) Reset() { *m = AbfPolicyDetails{} } func (*AbfPolicyDetails) GetMessageName() string { return "abf_policy_details" } -func (*AbfPolicyDetails) GetCrcString() string { return "6769e504" } +func (*AbfPolicyDetails) GetCrcString() string { return "b7487fa4" } func (*AbfPolicyDetails) GetMessageType() api.MessageType { return api.ReplyMessage } @@ -522,6 +531,7 @@ func (m *AbfPolicyDetails) Unmarshal(b []byte) error { } // AbfPolicyDump defines message 'abf_policy_dump'. +// InProgress: the message form may change in the future versions type AbfPolicyDump struct{} func (m *AbfPolicyDump) Reset() { *m = AbfPolicyDump{} } @@ -556,9 +566,9 @@ func file_abf_binapi_init() { api.RegisterMessage((*AbfItfAttachDump)(nil), "abf_itf_attach_dump_51077d14") api.RegisterMessage((*AbfPluginGetVersion)(nil), "abf_plugin_get_version_51077d14") api.RegisterMessage((*AbfPluginGetVersionReply)(nil), "abf_plugin_get_version_reply_9b32cf86") - api.RegisterMessage((*AbfPolicyAddDel)(nil), "abf_policy_add_del_ee66f93e") + api.RegisterMessage((*AbfPolicyAddDel)(nil), "abf_policy_add_del_c6131197") api.RegisterMessage((*AbfPolicyAddDelReply)(nil), "abf_policy_add_del_reply_e8d4e804") - api.RegisterMessage((*AbfPolicyDetails)(nil), "abf_policy_details_6769e504") + api.RegisterMessage((*AbfPolicyDetails)(nil), "abf_policy_details_b7487fa4") api.RegisterMessage((*AbfPolicyDump)(nil), "abf_policy_dump_51077d14") } diff --git a/binapi/abf/abf_rest.ba.go b/binapi/abf/abf_rest.ba.go deleted file mode 100644 index e05e834..0000000 --- a/binapi/abf/abf_rest.ba.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by GoVPP's binapi-generator. DO NOT EDIT. - -package abf - -import ( - "encoding/json" - "io/ioutil" - "net/http" -) - -func RESTHandler(rpc RPCService) http.Handler { - mux := http.NewServeMux() - mux.HandleFunc("/abf_itf_attach_add_del", func(w http.ResponseWriter, req *http.Request) { - var request = new(AbfItfAttachAddDel) - 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.AbfItfAttachAddDel(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("/abf_plugin_get_version", func(w http.ResponseWriter, req *http.Request) { - var request = new(AbfPluginGetVersion) - reply, err := rpc.AbfPluginGetVersion(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("/abf_policy_add_del", func(w http.ResponseWriter, req *http.Request) { - var request = new(AbfPolicyAddDel) - 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.AbfPolicyAddDel(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/abf/abf_rpc.ba.go b/binapi/abf/abf_rpc.ba.go index 76a88c6..d6e7738 100644 --- a/binapi/abf/abf_rpc.ba.go +++ b/binapi/abf/abf_rpc.ba.go @@ -5,12 +5,13 @@ package abf import ( "context" "fmt" - api "git.fd.io/govpp.git/api" - vpe "git.fd.io/govpp.git/binapi/vpe" "io" + + api "go.fd.io/govpp/api" + memclnt "go.fd.io/govpp/binapi/memclnt" ) -// RPCService defines RPC service abf. +// RPCService defines RPC service abf. type RPCService interface { AbfItfAttachAddDel(ctx context.Context, in *AbfItfAttachAddDel) (*AbfItfAttachAddDelReply, error) AbfItfAttachDump(ctx context.Context, in *AbfItfAttachDump) (RPCService_AbfItfAttachDumpClient, error) @@ -33,7 +34,7 @@ func (c *serviceClient) AbfItfAttachAddDel(ctx context.Context, in *AbfItfAttach if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) AbfItfAttachDump(ctx context.Context, in *AbfItfAttachDump) (RPCService_AbfItfAttachDumpClient, error) { @@ -45,7 +46,7 @@ func (c *serviceClient) AbfItfAttachDump(ctx context.Context, in *AbfItfAttachDu if err := x.Stream.SendMsg(in); err != nil { return nil, err } - if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil { + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { return nil, err } return x, nil @@ -68,7 +69,11 @@ func (c *serviceClient_AbfItfAttachDumpClient) Recv() (*AbfItfAttachDetails, err switch m := msg.(type) { case *AbfItfAttachDetails: return m, nil - case *vpe.ControlPingReply: + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } return nil, io.EOF default: return nil, fmt.Errorf("unexpected message: %T %v", m, m) @@ -90,7 +95,7 @@ func (c *serviceClient) AbfPolicyAddDel(ctx context.Context, in *AbfPolicyAddDel if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) AbfPolicyDump(ctx context.Context, in *AbfPolicyDump) (RPCService_AbfPolicyDumpClient, error) { @@ -102,7 +107,7 @@ func (c *serviceClient) AbfPolicyDump(ctx context.Context, in *AbfPolicyDump) (R if err := x.Stream.SendMsg(in); err != nil { return nil, err } - if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil { + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { return nil, err } return x, nil @@ -125,7 +130,11 @@ func (c *serviceClient_AbfPolicyDumpClient) Recv() (*AbfPolicyDetails, error) { switch m := msg.(type) { case *AbfPolicyDetails: return m, nil - case *vpe.ControlPingReply: + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } return nil, io.EOF default: return nil, fmt.Errorf("unexpected message: %T %v", m, m) |