diff options
Diffstat (limited to 'binapi/map')
-rw-r--r-- | binapi/map/map.ba.go | 109 | ||||
-rw-r--r-- | binapi/map/map_rest.ba.go | 295 | ||||
-rw-r--r-- | binapi/map/map_rpc.ba.go | 90 |
3 files changed, 162 insertions, 332 deletions
diff --git a/binapi/map/map.ba.go b/binapi/map/map.ba.go index b906284..278d1ac 100644 --- a/binapi/map/map.ba.go +++ b/binapi/map/map.ba.go @@ -1,21 +1,21 @@ // 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/map.api.json // Package maps contains generated bindings for API file map.api. // // Contents: -// 30 messages +// 32 messages // package maps 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 @@ -26,8 +26,8 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "map" - APIVersion = "4.1.1" - VersionCrc = 0x82b79829 + APIVersion = "4.2.1" + VersionCrc = 0xd1f7f56c ) // MapAddDelRule defines message 'map_add_del_rule'. @@ -122,7 +122,7 @@ type MapAddDomain struct { func (m *MapAddDomain) Reset() { *m = MapAddDomain{} } func (*MapAddDomain) GetMessageName() string { return "map_add_domain" } -func (*MapAddDomain) GetCrcString() string { return "7a5a18c9" } +func (*MapAddDomain) GetCrcString() string { return "249f195c" } func (*MapAddDomain) GetMessageType() api.MessageType { return api.RequestMessage } @@ -297,7 +297,7 @@ type MapDomainDetails struct { func (m *MapDomainDetails) Reset() { *m = MapDomainDetails{} } func (*MapDomainDetails) GetMessageName() string { return "map_domain_details" } -func (*MapDomainDetails) GetCrcString() string { return "fc1859dd" } +func (*MapDomainDetails) GetCrcString() string { return "796edb50" } func (*MapDomainDetails) GetMessageType() api.MessageType { return api.ReplyMessage } @@ -360,6 +360,7 @@ func (m *MapDomainDetails) Unmarshal(b []byte) error { } // MapDomainDump defines message 'map_domain_dump'. +// Deprecated: the message will be removed in the future versions type MapDomainDump struct{} func (m *MapDomainDump) Reset() { *m = MapDomainDump{} } @@ -386,6 +387,76 @@ func (m *MapDomainDump) Unmarshal(b []byte) error { return nil } +// MapDomainsGet defines message 'map_domains_get'. +type MapDomainsGet struct { + Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"` +} + +func (m *MapDomainsGet) Reset() { *m = MapDomainsGet{} } +func (*MapDomainsGet) GetMessageName() string { return "map_domains_get" } +func (*MapDomainsGet) GetCrcString() string { return "f75ba505" } +func (*MapDomainsGet) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapDomainsGet) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Cursor + return size +} +func (m *MapDomainsGet) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Cursor) + return buf.Bytes(), nil +} +func (m *MapDomainsGet) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Cursor = buf.DecodeUint32() + return nil +} + +// MapDomainsGetReply defines message 'map_domains_get_reply'. +type MapDomainsGetReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"` +} + +func (m *MapDomainsGetReply) Reset() { *m = MapDomainsGetReply{} } +func (*MapDomainsGetReply) GetMessageName() string { return "map_domains_get_reply" } +func (*MapDomainsGetReply) GetCrcString() string { return "53b48f5d" } +func (*MapDomainsGetReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapDomainsGetReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.Cursor + return size +} +func (m *MapDomainsGetReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.Cursor) + return buf.Bytes(), nil +} +func (m *MapDomainsGetReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.Cursor = buf.DecodeUint32() + return nil +} + // MapIfEnableDisable defines message 'map_if_enable_disable'. type MapIfEnableDisable struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` @@ -469,7 +540,7 @@ type MapParamAddDelPreResolve struct { func (m *MapParamAddDelPreResolve) Reset() { *m = MapParamAddDelPreResolve{} } func (*MapParamAddDelPreResolve) GetMessageName() string { return "map_param_add_del_pre_resolve" } -func (*MapParamAddDelPreResolve) GetCrcString() string { return "17008c66" } +func (*MapParamAddDelPreResolve) GetCrcString() string { return "dae5af03" } func (*MapParamAddDelPreResolve) GetMessageType() api.MessageType { return api.RequestMessage } @@ -584,7 +655,7 @@ type MapParamGetReply struct { func (m *MapParamGetReply) Reset() { *m = MapParamGetReply{} } func (*MapParamGetReply) GetMessageName() string { return "map_param_get_reply" } -func (*MapParamGetReply) GetCrcString() string { return "28092156" } +func (*MapParamGetReply) GetCrcString() string { return "26272c90" } func (*MapParamGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } @@ -1247,18 +1318,20 @@ func init() { file_maps_binapi_init() } func file_maps_binapi_init() { api.RegisterMessage((*MapAddDelRule)(nil), "map_add_del_rule_c65b32f7") api.RegisterMessage((*MapAddDelRuleReply)(nil), "map_add_del_rule_reply_e8d4e804") - api.RegisterMessage((*MapAddDomain)(nil), "map_add_domain_7a5a18c9") + api.RegisterMessage((*MapAddDomain)(nil), "map_add_domain_249f195c") api.RegisterMessage((*MapAddDomainReply)(nil), "map_add_domain_reply_3e6d4e2c") api.RegisterMessage((*MapDelDomain)(nil), "map_del_domain_8ac76db6") api.RegisterMessage((*MapDelDomainReply)(nil), "map_del_domain_reply_e8d4e804") - api.RegisterMessage((*MapDomainDetails)(nil), "map_domain_details_fc1859dd") + api.RegisterMessage((*MapDomainDetails)(nil), "map_domain_details_796edb50") api.RegisterMessage((*MapDomainDump)(nil), "map_domain_dump_51077d14") + api.RegisterMessage((*MapDomainsGet)(nil), "map_domains_get_f75ba505") + api.RegisterMessage((*MapDomainsGetReply)(nil), "map_domains_get_reply_53b48f5d") api.RegisterMessage((*MapIfEnableDisable)(nil), "map_if_enable_disable_59bb32f4") api.RegisterMessage((*MapIfEnableDisableReply)(nil), "map_if_enable_disable_reply_e8d4e804") - api.RegisterMessage((*MapParamAddDelPreResolve)(nil), "map_param_add_del_pre_resolve_17008c66") + api.RegisterMessage((*MapParamAddDelPreResolve)(nil), "map_param_add_del_pre_resolve_dae5af03") api.RegisterMessage((*MapParamAddDelPreResolveReply)(nil), "map_param_add_del_pre_resolve_reply_e8d4e804") api.RegisterMessage((*MapParamGet)(nil), "map_param_get_51077d14") - api.RegisterMessage((*MapParamGetReply)(nil), "map_param_get_reply_28092156") + api.RegisterMessage((*MapParamGetReply)(nil), "map_param_get_reply_26272c90") api.RegisterMessage((*MapParamSetFragmentation)(nil), "map_param_set_fragmentation_9ff54d90") api.RegisterMessage((*MapParamSetFragmentationReply)(nil), "map_param_set_fragmentation_reply_e8d4e804") api.RegisterMessage((*MapParamSetICMP)(nil), "map_param_set_icmp_58210cbf") @@ -1288,6 +1361,8 @@ func AllMessages() []api.Message { (*MapDelDomainReply)(nil), (*MapDomainDetails)(nil), (*MapDomainDump)(nil), + (*MapDomainsGet)(nil), + (*MapDomainsGetReply)(nil), (*MapIfEnableDisable)(nil), (*MapIfEnableDisableReply)(nil), (*MapParamAddDelPreResolve)(nil), diff --git a/binapi/map/map_rest.ba.go b/binapi/map/map_rest.ba.go deleted file mode 100644 index 922acb5..0000000 --- a/binapi/map/map_rest.ba.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by GoVPP's binapi-generator. DO NOT EDIT. - -package maps - -import ( - "encoding/json" - "io/ioutil" - "net/http" -) - -func RESTHandler(rpc RPCService) http.Handler { - mux := http.NewServeMux() - mux.HandleFunc("/map_add_del_rule", func(w http.ResponseWriter, req *http.Request) { - var request = new(MapAddDelRule) - 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.MapAddDelRule(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("/map_add_domain", func(w http.ResponseWriter, req *http.Request) { - var request = new(MapAddDomain) - 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.MapAddDomain(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("/map_del_domain", func(w http.ResponseWriter, req *http.Request) { - var request = new(MapDelDomain) - 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.MapDelDomain(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("/map_if_enable_disable", func(w http.ResponseWriter, req *http.Request) { - var request = new(MapIfEnableDisable) - 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.MapIfEnableDisable(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("/map_param_add_del_pre_resolve", func(w http.ResponseWriter, req *http.Request) { - var request = new(MapParamAddDelPreResolve) - 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.MapParamAddDelPreResolve(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("/map_param_get", func(w http.ResponseWriter, req *http.Request) { - var request = new(MapParamGet) - reply, err := rpc.MapParamGet(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("/map_param_set_fragmentation", func(w http.ResponseWriter, req *http.Request) { - var request = new(MapParamSetFragmentation) - 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.MapParamSetFragmentation(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("/map_param_set_icmp", func(w http.ResponseWriter, req *http.Request) { - var request = new(MapParamSetICMP) - 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.MapParamSetICMP(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("/map_param_set_icmp6", func(w http.ResponseWriter, req *http.Request) { - var request = new(MapParamSetICMP6) - 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.MapParamSetICMP6(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("/map_param_set_security_check", func(w http.ResponseWriter, req *http.Request) { - var request = new(MapParamSetSecurityCheck) - 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.MapParamSetSecurityCheck(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("/map_param_set_tcp", func(w http.ResponseWriter, req *http.Request) { - var request = new(MapParamSetTCP) - 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.MapParamSetTCP(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("/map_param_set_traffic_class", func(w http.ResponseWriter, req *http.Request) { - var request = new(MapParamSetTrafficClass) - 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.MapParamSetTrafficClass(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("/map_summary_stats", func(w http.ResponseWriter, req *http.Request) { - var request = new(MapSummaryStats) - reply, err := rpc.MapSummaryStats(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/map/map_rpc.ba.go b/binapi/map/map_rpc.ba.go index 6f7c3c7..f667d67 100644 --- a/binapi/map/map_rpc.ba.go +++ b/binapi/map/map_rpc.ba.go @@ -5,17 +5,19 @@ package maps 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 map. +// RPCService defines RPC service map. type RPCService interface { MapAddDelRule(ctx context.Context, in *MapAddDelRule) (*MapAddDelRuleReply, error) MapAddDomain(ctx context.Context, in *MapAddDomain) (*MapAddDomainReply, error) MapDelDomain(ctx context.Context, in *MapDelDomain) (*MapDelDomainReply, error) MapDomainDump(ctx context.Context, in *MapDomainDump) (RPCService_MapDomainDumpClient, error) + MapDomainsGet(ctx context.Context, in *MapDomainsGet) (RPCService_MapDomainsGetClient, error) MapIfEnableDisable(ctx context.Context, in *MapIfEnableDisable) (*MapIfEnableDisableReply, error) MapParamAddDelPreResolve(ctx context.Context, in *MapParamAddDelPreResolve) (*MapParamAddDelPreResolveReply, error) MapParamGet(ctx context.Context, in *MapParamGet) (*MapParamGetReply, error) @@ -43,7 +45,7 @@ func (c *serviceClient) MapAddDelRule(ctx context.Context, in *MapAddDelRule) (* if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MapAddDomain(ctx context.Context, in *MapAddDomain) (*MapAddDomainReply, error) { @@ -52,7 +54,7 @@ func (c *serviceClient) MapAddDomain(ctx context.Context, in *MapAddDomain) (*Ma if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MapDelDomain(ctx context.Context, in *MapDelDomain) (*MapDelDomainReply, error) { @@ -61,7 +63,7 @@ func (c *serviceClient) MapDelDomain(ctx context.Context, in *MapDelDomain) (*Ma if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MapDomainDump(ctx context.Context, in *MapDomainDump) (RPCService_MapDomainDumpClient, error) { @@ -73,7 +75,7 @@ func (c *serviceClient) MapDomainDump(ctx context.Context, in *MapDomainDump) (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 @@ -96,7 +98,51 @@ func (c *serviceClient_MapDomainDumpClient) Recv() (*MapDomainDetails, error) { switch m := msg.(type) { case *MapDomainDetails: 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) + } +} + +func (c *serviceClient) MapDomainsGet(ctx context.Context, in *MapDomainsGet) (RPCService_MapDomainsGetClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_MapDomainsGetClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_MapDomainsGetClient interface { + Recv() (*MapDomainDetails, error) + api.Stream +} + +type serviceClient_MapDomainsGetClient struct { + api.Stream +} + +func (c *serviceClient_MapDomainsGetClient) Recv() (*MapDomainDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *MapDomainDetails: + return m, nil + case *MapDomainsGetReply: + 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) @@ -109,7 +155,7 @@ func (c *serviceClient) MapIfEnableDisable(ctx context.Context, in *MapIfEnableD if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MapParamAddDelPreResolve(ctx context.Context, in *MapParamAddDelPreResolve) (*MapParamAddDelPreResolveReply, error) { @@ -118,7 +164,7 @@ func (c *serviceClient) MapParamAddDelPreResolve(ctx context.Context, in *MapPar if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MapParamGet(ctx context.Context, in *MapParamGet) (*MapParamGetReply, error) { @@ -127,7 +173,7 @@ func (c *serviceClient) MapParamGet(ctx context.Context, in *MapParamGet) (*MapP if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MapParamSetFragmentation(ctx context.Context, in *MapParamSetFragmentation) (*MapParamSetFragmentationReply, error) { @@ -136,7 +182,7 @@ func (c *serviceClient) MapParamSetFragmentation(ctx context.Context, in *MapPar if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MapParamSetICMP(ctx context.Context, in *MapParamSetICMP) (*MapParamSetICMPReply, error) { @@ -145,7 +191,7 @@ func (c *serviceClient) MapParamSetICMP(ctx context.Context, in *MapParamSetICMP if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MapParamSetICMP6(ctx context.Context, in *MapParamSetICMP6) (*MapParamSetICMP6Reply, error) { @@ -154,7 +200,7 @@ func (c *serviceClient) MapParamSetICMP6(ctx context.Context, in *MapParamSetICM if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MapParamSetSecurityCheck(ctx context.Context, in *MapParamSetSecurityCheck) (*MapParamSetSecurityCheckReply, error) { @@ -163,7 +209,7 @@ func (c *serviceClient) MapParamSetSecurityCheck(ctx context.Context, in *MapPar if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MapParamSetTCP(ctx context.Context, in *MapParamSetTCP) (*MapParamSetTCPReply, error) { @@ -172,7 +218,7 @@ func (c *serviceClient) MapParamSetTCP(ctx context.Context, in *MapParamSetTCP) if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MapParamSetTrafficClass(ctx context.Context, in *MapParamSetTrafficClass) (*MapParamSetTrafficClassReply, error) { @@ -181,7 +227,7 @@ func (c *serviceClient) MapParamSetTrafficClass(ctx context.Context, in *MapPara if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MapRuleDump(ctx context.Context, in *MapRuleDump) (RPCService_MapRuleDumpClient, error) { @@ -193,7 +239,7 @@ func (c *serviceClient) MapRuleDump(ctx context.Context, in *MapRuleDump) (RPCSe 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 @@ -216,7 +262,11 @@ func (c *serviceClient_MapRuleDumpClient) Recv() (*MapRuleDetails, error) { switch m := msg.(type) { case *MapRuleDetails: 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) @@ -229,5 +279,5 @@ func (c *serviceClient) MapSummaryStats(ctx context.Context, in *MapSummaryStats if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } |