diff options
Diffstat (limited to 'binapi/ip6_nd')
-rw-r--r-- | binapi/ip6_nd/ip6_nd.ba.go | 108 | ||||
-rw-r--r-- | binapi/ip6_nd/ip6_nd_rest.ba.go | 129 | ||||
-rw-r--r-- | binapi/ip6_nd/ip6_nd_rpc.ba.go | 35 |
3 files changed, 117 insertions, 155 deletions
diff --git a/binapi/ip6_nd/ip6_nd.ba.go b/binapi/ip6_nd/ip6_nd.ba.go index a5f308e..9db08c3 100644 --- a/binapi/ip6_nd/ip6_nd.ba.go +++ b/binapi/ip6_nd/ip6_nd.ba.go @@ -1,22 +1,22 @@ // 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/core/ip6_nd.api.json // Package ip6_nd contains generated bindings for API file ip6_nd.api. // // Contents: // 1 struct -// 13 messages +// 15 messages // package ip6_nd 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 @@ -28,7 +28,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "ip6_nd" APIVersion = "1.0.0" - VersionCrc = 0x877c10de + VersionCrc = 0x64750117 ) // IP6RaPrefixInfo defines type 'ip6_ra_prefix_info'. @@ -55,7 +55,7 @@ type IP6RaEvent struct { func (m *IP6RaEvent) Reset() { *m = IP6RaEvent{} } func (*IP6RaEvent) GetMessageName() string { return "ip6_ra_event" } -func (*IP6RaEvent) GetCrcString() string { return "47e8cfbe" } +func (*IP6RaEvent) GetCrcString() string { return "0364c1c5" } func (*IP6RaEvent) GetMessageType() api.MessageType { return api.EventMessage } @@ -148,7 +148,7 @@ type IP6ndProxyAddDel struct { func (m *IP6ndProxyAddDel) Reset() { *m = IP6ndProxyAddDel{} } func (*IP6ndProxyAddDel) GetMessageName() string { return "ip6nd_proxy_add_del" } -func (*IP6ndProxyAddDel) GetCrcString() string { return "3fdf6659" } +func (*IP6ndProxyAddDel) GetCrcString() string { return "c2e4a686" } func (*IP6ndProxyAddDel) GetMessageType() api.MessageType { return api.RequestMessage } @@ -221,7 +221,7 @@ type IP6ndProxyDetails struct { func (m *IP6ndProxyDetails) Reset() { *m = IP6ndProxyDetails{} } func (*IP6ndProxyDetails) GetMessageName() string { return "ip6nd_proxy_details" } -func (*IP6ndProxyDetails) GetCrcString() string { return "d35be8ff" } +func (*IP6ndProxyDetails) GetCrcString() string { return "30b9ff4a" } func (*IP6ndProxyDetails) GetMessageType() api.MessageType { return api.ReplyMessage } @@ -277,6 +277,78 @@ func (m *IP6ndProxyDump) Unmarshal(b []byte) error { return nil } +// IP6ndProxyEnableDisable defines message 'ip6nd_proxy_enable_disable'. +type IP6ndProxyEnableDisable struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + IsEnable bool `binapi:"bool,name=is_enable" json:"is_enable,omitempty"` +} + +func (m *IP6ndProxyEnableDisable) Reset() { *m = IP6ndProxyEnableDisable{} } +func (*IP6ndProxyEnableDisable) GetMessageName() string { return "ip6nd_proxy_enable_disable" } +func (*IP6ndProxyEnableDisable) GetCrcString() string { return "7daa1e3a" } +func (*IP6ndProxyEnableDisable) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IP6ndProxyEnableDisable) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 1 // m.IsEnable + return size +} +func (m *IP6ndProxyEnableDisable) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeBool(m.IsEnable) + return buf.Bytes(), nil +} +func (m *IP6ndProxyEnableDisable) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.IsEnable = buf.DecodeBool() + return nil +} + +// IP6ndProxyEnableDisableReply defines message 'ip6nd_proxy_enable_disable_reply'. +type IP6ndProxyEnableDisableReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *IP6ndProxyEnableDisableReply) Reset() { *m = IP6ndProxyEnableDisableReply{} } +func (*IP6ndProxyEnableDisableReply) GetMessageName() string { + return "ip6nd_proxy_enable_disable_reply" +} +func (*IP6ndProxyEnableDisableReply) GetCrcString() string { return "e8d4e804" } +func (*IP6ndProxyEnableDisableReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IP6ndProxyEnableDisableReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *IP6ndProxyEnableDisableReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *IP6ndProxyEnableDisableReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + // IP6ndSendRouterSolicitation defines message 'ip6nd_send_router_solicitation'. type IP6ndSendRouterSolicitation struct { Irt uint32 `binapi:"u32,name=irt" json:"irt,omitempty"` @@ -501,7 +573,7 @@ type SwInterfaceIP6ndRaPrefix struct { func (m *SwInterfaceIP6ndRaPrefix) Reset() { *m = SwInterfaceIP6ndRaPrefix{} } func (*SwInterfaceIP6ndRaPrefix) GetMessageName() string { return "sw_interface_ip6nd_ra_prefix" } -func (*SwInterfaceIP6ndRaPrefix) GetCrcString() string { return "e098785f" } +func (*SwInterfaceIP6ndRaPrefix) GetCrcString() string { return "82cc1b28" } func (*SwInterfaceIP6ndRaPrefix) GetMessageType() api.MessageType { return api.RequestMessage } @@ -667,16 +739,18 @@ func (m *WantIP6RaEventsReply) Unmarshal(b []byte) error { func init() { file_ip6_nd_binapi_init() } func file_ip6_nd_binapi_init() { - api.RegisterMessage((*IP6RaEvent)(nil), "ip6_ra_event_47e8cfbe") - api.RegisterMessage((*IP6ndProxyAddDel)(nil), "ip6nd_proxy_add_del_3fdf6659") + api.RegisterMessage((*IP6RaEvent)(nil), "ip6_ra_event_0364c1c5") + api.RegisterMessage((*IP6ndProxyAddDel)(nil), "ip6nd_proxy_add_del_c2e4a686") api.RegisterMessage((*IP6ndProxyAddDelReply)(nil), "ip6nd_proxy_add_del_reply_e8d4e804") - api.RegisterMessage((*IP6ndProxyDetails)(nil), "ip6nd_proxy_details_d35be8ff") + api.RegisterMessage((*IP6ndProxyDetails)(nil), "ip6nd_proxy_details_30b9ff4a") api.RegisterMessage((*IP6ndProxyDump)(nil), "ip6nd_proxy_dump_51077d14") + api.RegisterMessage((*IP6ndProxyEnableDisable)(nil), "ip6nd_proxy_enable_disable_7daa1e3a") + api.RegisterMessage((*IP6ndProxyEnableDisableReply)(nil), "ip6nd_proxy_enable_disable_reply_e8d4e804") api.RegisterMessage((*IP6ndSendRouterSolicitation)(nil), "ip6nd_send_router_solicitation_e5de609c") api.RegisterMessage((*IP6ndSendRouterSolicitationReply)(nil), "ip6nd_send_router_solicitation_reply_e8d4e804") api.RegisterMessage((*SwInterfaceIP6ndRaConfig)(nil), "sw_interface_ip6nd_ra_config_3eb00b1c") api.RegisterMessage((*SwInterfaceIP6ndRaConfigReply)(nil), "sw_interface_ip6nd_ra_config_reply_e8d4e804") - api.RegisterMessage((*SwInterfaceIP6ndRaPrefix)(nil), "sw_interface_ip6nd_ra_prefix_e098785f") + api.RegisterMessage((*SwInterfaceIP6ndRaPrefix)(nil), "sw_interface_ip6nd_ra_prefix_82cc1b28") api.RegisterMessage((*SwInterfaceIP6ndRaPrefixReply)(nil), "sw_interface_ip6nd_ra_prefix_reply_e8d4e804") api.RegisterMessage((*WantIP6RaEvents)(nil), "want_ip6_ra_events_3ec6d6c2") api.RegisterMessage((*WantIP6RaEventsReply)(nil), "want_ip6_ra_events_reply_e8d4e804") @@ -690,6 +764,8 @@ func AllMessages() []api.Message { (*IP6ndProxyAddDelReply)(nil), (*IP6ndProxyDetails)(nil), (*IP6ndProxyDump)(nil), + (*IP6ndProxyEnableDisable)(nil), + (*IP6ndProxyEnableDisableReply)(nil), (*IP6ndSendRouterSolicitation)(nil), (*IP6ndSendRouterSolicitationReply)(nil), (*SwInterfaceIP6ndRaConfig)(nil), diff --git a/binapi/ip6_nd/ip6_nd_rest.ba.go b/binapi/ip6_nd/ip6_nd_rest.ba.go deleted file mode 100644 index 2bd060d..0000000 --- a/binapi/ip6_nd/ip6_nd_rest.ba.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by GoVPP's binapi-generator. DO NOT EDIT. - -package ip6_nd - -import ( - "encoding/json" - "io/ioutil" - "net/http" -) - -func RESTHandler(rpc RPCService) http.Handler { - mux := http.NewServeMux() - mux.HandleFunc("/ip6nd_proxy_add_del", func(w http.ResponseWriter, req *http.Request) { - var request = new(IP6ndProxyAddDel) - 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.IP6ndProxyAddDel(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("/ip6nd_send_router_solicitation", func(w http.ResponseWriter, req *http.Request) { - var request = new(IP6ndSendRouterSolicitation) - 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.IP6ndSendRouterSolicitation(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_ip6nd_ra_config", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceIP6ndRaConfig) - 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.SwInterfaceIP6ndRaConfig(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_ip6nd_ra_prefix", func(w http.ResponseWriter, req *http.Request) { - var request = new(SwInterfaceIP6ndRaPrefix) - 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.SwInterfaceIP6ndRaPrefix(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("/want_ip6_ra_events", func(w http.ResponseWriter, req *http.Request) { - var request = new(WantIP6RaEvents) - 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.WantIP6RaEvents(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/ip6_nd/ip6_nd_rpc.ba.go b/binapi/ip6_nd/ip6_nd_rpc.ba.go index 3bfbac0..43b85bd 100644 --- a/binapi/ip6_nd/ip6_nd_rpc.ba.go +++ b/binapi/ip6_nd/ip6_nd_rpc.ba.go @@ -5,15 +5,17 @@ package ip6_nd 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 ip6_nd. +// RPCService defines RPC service ip6_nd. type RPCService interface { IP6ndProxyAddDel(ctx context.Context, in *IP6ndProxyAddDel) (*IP6ndProxyAddDelReply, error) IP6ndProxyDump(ctx context.Context, in *IP6ndProxyDump) (RPCService_IP6ndProxyDumpClient, error) + IP6ndProxyEnableDisable(ctx context.Context, in *IP6ndProxyEnableDisable) (*IP6ndProxyEnableDisableReply, error) IP6ndSendRouterSolicitation(ctx context.Context, in *IP6ndSendRouterSolicitation) (*IP6ndSendRouterSolicitationReply, error) SwInterfaceIP6ndRaConfig(ctx context.Context, in *SwInterfaceIP6ndRaConfig) (*SwInterfaceIP6ndRaConfigReply, error) SwInterfaceIP6ndRaPrefix(ctx context.Context, in *SwInterfaceIP6ndRaPrefix) (*SwInterfaceIP6ndRaPrefixReply, error) @@ -34,7 +36,7 @@ func (c *serviceClient) IP6ndProxyAddDel(ctx context.Context, in *IP6ndProxyAddD if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) IP6ndProxyDump(ctx context.Context, in *IP6ndProxyDump) (RPCService_IP6ndProxyDumpClient, error) { @@ -46,7 +48,7 @@ func (c *serviceClient) IP6ndProxyDump(ctx context.Context, in *IP6ndProxyDump) 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 @@ -69,20 +71,33 @@ func (c *serviceClient_IP6ndProxyDumpClient) Recv() (*IP6ndProxyDetails, error) switch m := msg.(type) { case *IP6ndProxyDetails: 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) IP6ndProxyEnableDisable(ctx context.Context, in *IP6ndProxyEnableDisable) (*IP6ndProxyEnableDisableReply, error) { + out := new(IP6ndProxyEnableDisableReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) IP6ndSendRouterSolicitation(ctx context.Context, in *IP6ndSendRouterSolicitation) (*IP6ndSendRouterSolicitationReply, error) { out := new(IP6ndSendRouterSolicitationReply) err := c.conn.Invoke(ctx, in, out) if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceIP6ndRaConfig(ctx context.Context, in *SwInterfaceIP6ndRaConfig) (*SwInterfaceIP6ndRaConfigReply, error) { @@ -91,7 +106,7 @@ func (c *serviceClient) SwInterfaceIP6ndRaConfig(ctx context.Context, in *SwInte if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) SwInterfaceIP6ndRaPrefix(ctx context.Context, in *SwInterfaceIP6ndRaPrefix) (*SwInterfaceIP6ndRaPrefixReply, error) { @@ -100,7 +115,7 @@ func (c *serviceClient) SwInterfaceIP6ndRaPrefix(ctx context.Context, in *SwInte if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) WantIP6RaEvents(ctx context.Context, in *WantIP6RaEvents) (*WantIP6RaEventsReply, error) { @@ -109,5 +124,5 @@ func (c *serviceClient) WantIP6RaEvents(ctx context.Context, in *WantIP6RaEvents if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } |