aboutsummaryrefslogtreecommitdiffstats
path: root/binapi/lb
diff options
context:
space:
mode:
Diffstat (limited to 'binapi/lb')
-rw-r--r--binapi/lb/lb.ba.go40
-rw-r--r--binapi/lb/lb_rest.ba.go152
-rw-r--r--binapi/lb/lb_rpc.ba.go35
3 files changed, 42 insertions, 185 deletions
diff --git a/binapi/lb/lb.ba.go b/binapi/lb/lb.ba.go
index 9fdfc7f..035a9bd 100644
--- a/binapi/lb/lb.ba.go
+++ b/binapi/lb/lb.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/lb.api.json
// Package lb contains generated bindings for API file lb.api.
@@ -12,11 +12,11 @@
package lb
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"
- lb_types "git.fd.io/govpp.git/binapi/lb_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"
+ lb_types "go.fd.io/govpp/binapi/lb_types"
+ codec "go.fd.io/govpp/codec"
)
// This is a compile-time assertion to ensure that this generated file
@@ -28,7 +28,7 @@ const _ = api.GoVppAPIPackageIsVersion2
const (
APIFile = "lb"
APIVersion = "1.0.0"
- VersionCrc = 0x5e4e85b1
+ VersionCrc = 0x50c0a6c9
)
// LbAddDelAs defines message 'lb_add_del_as'.
@@ -43,7 +43,7 @@ type LbAddDelAs struct {
func (m *LbAddDelAs) Reset() { *m = LbAddDelAs{} }
func (*LbAddDelAs) GetMessageName() string { return "lb_add_del_as" }
-func (*LbAddDelAs) GetCrcString() string { return "78628987" }
+func (*LbAddDelAs) GetCrcString() string { return "35d72500" }
func (*LbAddDelAs) GetMessageType() api.MessageType {
return api.RequestMessage
}
@@ -282,7 +282,7 @@ type LbAddDelVip struct {
func (m *LbAddDelVip) Reset() { *m = LbAddDelVip{} }
func (*LbAddDelVip) GetMessageName() string { return "lb_add_del_vip" }
-func (*LbAddDelVip) GetCrcString() string { return "d15b7ddc" }
+func (*LbAddDelVip) GetCrcString() string { return "6fa569c7" }
func (*LbAddDelVip) GetMessageType() api.MessageType {
return api.RequestMessage
}
@@ -384,7 +384,7 @@ type LbAsDetails struct {
func (m *LbAsDetails) Reset() { *m = LbAsDetails{} }
func (*LbAsDetails) GetMessageName() string { return "lb_as_details" }
-func (*LbAsDetails) GetCrcString() string { return "9c39f60e" }
+func (*LbAsDetails) GetCrcString() string { return "8d24c29e" }
func (*LbAsDetails) GetMessageType() api.MessageType {
return api.ReplyMessage
}
@@ -491,7 +491,7 @@ type LbConf struct {
func (m *LbConf) Reset() { *m = LbConf{} }
func (*LbConf) GetMessageName() string { return "lb_conf" }
-func (*LbConf) GetCrcString() string { return "22ddb739" }
+func (*LbConf) GetCrcString() string { return "56cd3261" }
func (*LbConf) GetMessageType() api.MessageType {
return api.RequestMessage
}
@@ -651,7 +651,7 @@ type LbVipDetails struct {
func (m *LbVipDetails) Reset() { *m = LbVipDetails{} }
func (*LbVipDetails) GetMessageName() string { return "lb_vip_details" }
-func (*LbVipDetails) GetCrcString() string { return "08f39bed" }
+func (*LbVipDetails) GetCrcString() string { return "1329ec9b" }
func (*LbVipDetails) GetMessageType() api.MessageType {
return api.ReplyMessage
}
@@ -714,7 +714,7 @@ type LbVipDump struct {
func (m *LbVipDump) Reset() { *m = LbVipDump{} }
func (*LbVipDump) GetMessageName() string { return "lb_vip_dump" }
-func (*LbVipDump) GetCrcString() string { return "c7bcb124" }
+func (*LbVipDump) GetCrcString() string { return "56110cb7" }
func (*LbVipDump) GetMessageType() api.MessageType {
return api.RequestMessage
}
@@ -760,22 +760,22 @@ func (m *LbVipDump) Unmarshal(b []byte) error {
func init() { file_lb_binapi_init() }
func file_lb_binapi_init() {
- api.RegisterMessage((*LbAddDelAs)(nil), "lb_add_del_as_78628987")
+ api.RegisterMessage((*LbAddDelAs)(nil), "lb_add_del_as_35d72500")
api.RegisterMessage((*LbAddDelAsReply)(nil), "lb_add_del_as_reply_e8d4e804")
api.RegisterMessage((*LbAddDelIntfNat4)(nil), "lb_add_del_intf_nat4_47d6e753")
api.RegisterMessage((*LbAddDelIntfNat4Reply)(nil), "lb_add_del_intf_nat4_reply_e8d4e804")
api.RegisterMessage((*LbAddDelIntfNat6)(nil), "lb_add_del_intf_nat6_47d6e753")
api.RegisterMessage((*LbAddDelIntfNat6Reply)(nil), "lb_add_del_intf_nat6_reply_e8d4e804")
- api.RegisterMessage((*LbAddDelVip)(nil), "lb_add_del_vip_d15b7ddc")
+ api.RegisterMessage((*LbAddDelVip)(nil), "lb_add_del_vip_6fa569c7")
api.RegisterMessage((*LbAddDelVipReply)(nil), "lb_add_del_vip_reply_e8d4e804")
- api.RegisterMessage((*LbAsDetails)(nil), "lb_as_details_9c39f60e")
+ api.RegisterMessage((*LbAsDetails)(nil), "lb_as_details_8d24c29e")
api.RegisterMessage((*LbAsDump)(nil), "lb_as_dump_1063f819")
- api.RegisterMessage((*LbConf)(nil), "lb_conf_22ddb739")
+ api.RegisterMessage((*LbConf)(nil), "lb_conf_56cd3261")
api.RegisterMessage((*LbConfReply)(nil), "lb_conf_reply_e8d4e804")
api.RegisterMessage((*LbFlushVip)(nil), "lb_flush_vip_1063f819")
api.RegisterMessage((*LbFlushVipReply)(nil), "lb_flush_vip_reply_e8d4e804")
- api.RegisterMessage((*LbVipDetails)(nil), "lb_vip_details_08f39bed")
- api.RegisterMessage((*LbVipDump)(nil), "lb_vip_dump_c7bcb124")
+ api.RegisterMessage((*LbVipDetails)(nil), "lb_vip_details_1329ec9b")
+ api.RegisterMessage((*LbVipDump)(nil), "lb_vip_dump_56110cb7")
}
// Messages returns list of all messages in this module.
diff --git a/binapi/lb/lb_rest.ba.go b/binapi/lb/lb_rest.ba.go
deleted file mode 100644
index ea7fad8..0000000
--- a/binapi/lb/lb_rest.ba.go
+++ /dev/null
@@ -1,152 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package lb
-
-import (
- "encoding/json"
- "io/ioutil"
- "net/http"
-)
-
-func RESTHandler(rpc RPCService) http.Handler {
- mux := http.NewServeMux()
- mux.HandleFunc("/lb_add_del_as", func(w http.ResponseWriter, req *http.Request) {
- var request = new(LbAddDelAs)
- 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.LbAddDelAs(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("/lb_add_del_intf_nat4", func(w http.ResponseWriter, req *http.Request) {
- var request = new(LbAddDelIntfNat4)
- 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.LbAddDelIntfNat4(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("/lb_add_del_intf_nat6", func(w http.ResponseWriter, req *http.Request) {
- var request = new(LbAddDelIntfNat6)
- 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.LbAddDelIntfNat6(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("/lb_add_del_vip", func(w http.ResponseWriter, req *http.Request) {
- var request = new(LbAddDelVip)
- 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.LbAddDelVip(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("/lb_conf", func(w http.ResponseWriter, req *http.Request) {
- var request = new(LbConf)
- 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.LbConf(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("/lb_flush_vip", func(w http.ResponseWriter, req *http.Request) {
- var request = new(LbFlushVip)
- 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.LbFlushVip(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/lb/lb_rpc.ba.go b/binapi/lb/lb_rpc.ba.go
index c28bb47..c520f58 100644
--- a/binapi/lb/lb_rpc.ba.go
+++ b/binapi/lb/lb_rpc.ba.go
@@ -5,12 +5,13 @@ package lb
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 lb.
+// RPCService defines RPC service lb.
type RPCService interface {
LbAddDelAs(ctx context.Context, in *LbAddDelAs) (*LbAddDelAsReply, error)
LbAddDelIntfNat4(ctx context.Context, in *LbAddDelIntfNat4) (*LbAddDelIntfNat4Reply, error)
@@ -36,7 +37,7 @@ func (c *serviceClient) LbAddDelAs(ctx context.Context, in *LbAddDelAs) (*LbAddD
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) LbAddDelIntfNat4(ctx context.Context, in *LbAddDelIntfNat4) (*LbAddDelIntfNat4Reply, error) {
@@ -45,7 +46,7 @@ func (c *serviceClient) LbAddDelIntfNat4(ctx context.Context, in *LbAddDelIntfNa
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) LbAddDelIntfNat6(ctx context.Context, in *LbAddDelIntfNat6) (*LbAddDelIntfNat6Reply, error) {
@@ -54,7 +55,7 @@ func (c *serviceClient) LbAddDelIntfNat6(ctx context.Context, in *LbAddDelIntfNa
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) LbAddDelVip(ctx context.Context, in *LbAddDelVip) (*LbAddDelVipReply, error) {
@@ -63,7 +64,7 @@ func (c *serviceClient) LbAddDelVip(ctx context.Context, in *LbAddDelVip) (*LbAd
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) LbAsDump(ctx context.Context, in *LbAsDump) (RPCService_LbAsDumpClient, error) {
@@ -75,7 +76,7 @@ func (c *serviceClient) LbAsDump(ctx context.Context, in *LbAsDump) (RPCService_
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
@@ -98,7 +99,11 @@ func (c *serviceClient_LbAsDumpClient) Recv() (*LbAsDetails, error) {
switch m := msg.(type) {
case *LbAsDetails:
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)
@@ -111,7 +116,7 @@ func (c *serviceClient) LbConf(ctx context.Context, in *LbConf) (*LbConfReply, e
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) LbFlushVip(ctx context.Context, in *LbFlushVip) (*LbFlushVipReply, error) {
@@ -120,7 +125,7 @@ func (c *serviceClient) LbFlushVip(ctx context.Context, in *LbFlushVip) (*LbFlus
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) LbVipDump(ctx context.Context, in *LbVipDump) (RPCService_LbVipDumpClient, error) {
@@ -132,7 +137,7 @@ func (c *serviceClient) LbVipDump(ctx context.Context, in *LbVipDump) (RPCServic
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
@@ -155,7 +160,11 @@ func (c *serviceClient_LbVipDumpClient) Recv() (*LbVipDetails, error) {
switch m := msg.(type) {
case *LbVipDetails:
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)