diff options
Diffstat (limited to 'binapi/acl')
-rw-r--r-- | binapi/acl/acl.ba.go | 184 | ||||
-rw-r--r-- | binapi/acl/acl_rest.ba.go | 300 | ||||
-rw-r--r-- | binapi/acl/acl_rpc.ba.go | 89 |
3 files changed, 228 insertions, 345 deletions
diff --git a/binapi/acl/acl.ba.go b/binapi/acl/acl.ba.go index 1f47a01..958593f 100644 --- a/binapi/acl/acl.ba.go +++ b/binapi/acl/acl.ba.go @@ -1,23 +1,23 @@ // 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/acl.api.json // Package acl contains generated bindings for API file acl.api. // // Contents: -// 38 messages +// 42 messages // package acl import ( - api "git.fd.io/govpp.git/api" - acl_types "git.fd.io/govpp.git/binapi/acl_types" - _ "git.fd.io/govpp.git/binapi/ethernet_types" - 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" + acl_types "go.fd.io/govpp/binapi/acl_types" + _ "go.fd.io/govpp/binapi/ethernet_types" + 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,8 +28,8 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "acl" - APIVersion = "2.0.0" - VersionCrc = 0x68c4cb37 + APIVersion = "2.0.1" + VersionCrc = 0x5133bba0 ) // ACLAddReplace defines message 'acl_add_replace'. @@ -42,7 +42,7 @@ type ACLAddReplace struct { func (m *ACLAddReplace) Reset() { *m = ACLAddReplace{} } func (*ACLAddReplace) GetMessageName() string { return "acl_add_replace" } -func (*ACLAddReplace) GetCrcString() string { return "1cabdeab" } +func (*ACLAddReplace) GetCrcString() string { return "ee5c2f18" } func (*ACLAddReplace) GetMessageType() api.MessageType { return api.RequestMessage } @@ -245,7 +245,7 @@ type ACLDetails struct { func (m *ACLDetails) Reset() { *m = ACLDetails{} } func (*ACLDetails) GetMessageName() string { return "acl_details" } -func (*ACLDetails) GetCrcString() string { return "7a97f21c" } +func (*ACLDetails) GetCrcString() string { return "95babae0" } func (*ACLDetails) GetMessageType() api.MessageType { return api.ReplyMessage } @@ -1000,6 +1000,140 @@ func (m *ACLPluginGetVersionReply) Unmarshal(b []byte) error { return nil } +// ACLPluginUseHashLookupGet defines message 'acl_plugin_use_hash_lookup_get'. +// InProgress: the message form may change in the future versions +type ACLPluginUseHashLookupGet struct{} + +func (m *ACLPluginUseHashLookupGet) Reset() { *m = ACLPluginUseHashLookupGet{} } +func (*ACLPluginUseHashLookupGet) GetMessageName() string { return "acl_plugin_use_hash_lookup_get" } +func (*ACLPluginUseHashLookupGet) GetCrcString() string { return "51077d14" } +func (*ACLPluginUseHashLookupGet) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ACLPluginUseHashLookupGet) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *ACLPluginUseHashLookupGet) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *ACLPluginUseHashLookupGet) Unmarshal(b []byte) error { + return nil +} + +// ACLPluginUseHashLookupGetReply defines message 'acl_plugin_use_hash_lookup_get_reply'. +// InProgress: the message form may change in the future versions +type ACLPluginUseHashLookupGetReply struct { + Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` +} + +func (m *ACLPluginUseHashLookupGetReply) Reset() { *m = ACLPluginUseHashLookupGetReply{} } +func (*ACLPluginUseHashLookupGetReply) GetMessageName() string { + return "acl_plugin_use_hash_lookup_get_reply" +} +func (*ACLPluginUseHashLookupGetReply) GetCrcString() string { return "5392ad31" } +func (*ACLPluginUseHashLookupGetReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ACLPluginUseHashLookupGetReply) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Enable + return size +} +func (m *ACLPluginUseHashLookupGetReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeBool(m.Enable) + return buf.Bytes(), nil +} +func (m *ACLPluginUseHashLookupGetReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Enable = buf.DecodeBool() + return nil +} + +// ACLPluginUseHashLookupSet defines message 'acl_plugin_use_hash_lookup_set'. +// InProgress: the message form may change in the future versions +type ACLPluginUseHashLookupSet struct { + Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` +} + +func (m *ACLPluginUseHashLookupSet) Reset() { *m = ACLPluginUseHashLookupSet{} } +func (*ACLPluginUseHashLookupSet) GetMessageName() string { return "acl_plugin_use_hash_lookup_set" } +func (*ACLPluginUseHashLookupSet) GetCrcString() string { return "b3e225d2" } +func (*ACLPluginUseHashLookupSet) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ACLPluginUseHashLookupSet) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Enable + return size +} +func (m *ACLPluginUseHashLookupSet) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeBool(m.Enable) + return buf.Bytes(), nil +} +func (m *ACLPluginUseHashLookupSet) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Enable = buf.DecodeBool() + return nil +} + +// ACLPluginUseHashLookupSetReply defines message 'acl_plugin_use_hash_lookup_set_reply'. +// InProgress: the message form may change in the future versions +type ACLPluginUseHashLookupSetReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *ACLPluginUseHashLookupSetReply) Reset() { *m = ACLPluginUseHashLookupSetReply{} } +func (*ACLPluginUseHashLookupSetReply) GetMessageName() string { + return "acl_plugin_use_hash_lookup_set_reply" +} +func (*ACLPluginUseHashLookupSetReply) GetCrcString() string { return "e8d4e804" } +func (*ACLPluginUseHashLookupSetReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ACLPluginUseHashLookupSetReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *ACLPluginUseHashLookupSetReply) 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 *ACLPluginUseHashLookupSetReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + // ACLStatsIntfCountersEnable defines message 'acl_stats_intf_counters_enable'. type ACLStatsIntfCountersEnable struct { Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` @@ -1077,7 +1211,7 @@ type MacipACLAdd struct { func (m *MacipACLAdd) Reset() { *m = MacipACLAdd{} } func (*MacipACLAdd) GetMessageName() string { return "macip_acl_add" } -func (*MacipACLAdd) GetCrcString() string { return "d648fd0a" } +func (*MacipACLAdd) GetCrcString() string { return "ce6fbad0" } func (*MacipACLAdd) GetMessageType() api.MessageType { return api.RequestMessage } @@ -1150,7 +1284,7 @@ type MacipACLAddReplace struct { func (m *MacipACLAddReplace) Reset() { *m = MacipACLAddReplace{} } func (*MacipACLAddReplace) GetMessageName() string { return "macip_acl_add_replace" } -func (*MacipACLAddReplace) GetCrcString() string { return "e34402a7" } +func (*MacipACLAddReplace) GetCrcString() string { return "2a461dd4" } func (*MacipACLAddReplace) GetMessageType() api.MessageType { return api.RequestMessage } @@ -1366,7 +1500,7 @@ type MacipACLDetails struct { func (m *MacipACLDetails) Reset() { *m = MacipACLDetails{} } func (*MacipACLDetails) GetMessageName() string { return "macip_acl_details" } -func (*MacipACLDetails) GetCrcString() string { return "57c7482f" } +func (*MacipACLDetails) GetCrcString() string { return "27135b59" } func (*MacipACLDetails) GetMessageType() api.MessageType { return api.ReplyMessage } @@ -1701,11 +1835,11 @@ func (m *MacipACLInterfaceListDump) Unmarshal(b []byte) error { func init() { file_acl_binapi_init() } func file_acl_binapi_init() { - api.RegisterMessage((*ACLAddReplace)(nil), "acl_add_replace_1cabdeab") + api.RegisterMessage((*ACLAddReplace)(nil), "acl_add_replace_ee5c2f18") api.RegisterMessage((*ACLAddReplaceReply)(nil), "acl_add_replace_reply_ac407b0c") api.RegisterMessage((*ACLDel)(nil), "acl_del_ef34fea4") api.RegisterMessage((*ACLDelReply)(nil), "acl_del_reply_e8d4e804") - api.RegisterMessage((*ACLDetails)(nil), "acl_details_7a97f21c") + api.RegisterMessage((*ACLDetails)(nil), "acl_details_95babae0") api.RegisterMessage((*ACLDump)(nil), "acl_dump_ef34fea4") api.RegisterMessage((*ACLInterfaceAddDel)(nil), "acl_interface_add_del_4b54bebd") api.RegisterMessage((*ACLInterfaceAddDelReply)(nil), "acl_interface_add_del_reply_e8d4e804") @@ -1723,15 +1857,19 @@ func file_acl_binapi_init() { api.RegisterMessage((*ACLPluginGetConnTableMaxEntriesReply)(nil), "acl_plugin_get_conn_table_max_entries_reply_7a096d3d") api.RegisterMessage((*ACLPluginGetVersion)(nil), "acl_plugin_get_version_51077d14") api.RegisterMessage((*ACLPluginGetVersionReply)(nil), "acl_plugin_get_version_reply_9b32cf86") + api.RegisterMessage((*ACLPluginUseHashLookupGet)(nil), "acl_plugin_use_hash_lookup_get_51077d14") + api.RegisterMessage((*ACLPluginUseHashLookupGetReply)(nil), "acl_plugin_use_hash_lookup_get_reply_5392ad31") + api.RegisterMessage((*ACLPluginUseHashLookupSet)(nil), "acl_plugin_use_hash_lookup_set_b3e225d2") + api.RegisterMessage((*ACLPluginUseHashLookupSetReply)(nil), "acl_plugin_use_hash_lookup_set_reply_e8d4e804") api.RegisterMessage((*ACLStatsIntfCountersEnable)(nil), "acl_stats_intf_counters_enable_b3e225d2") api.RegisterMessage((*ACLStatsIntfCountersEnableReply)(nil), "acl_stats_intf_counters_enable_reply_e8d4e804") - api.RegisterMessage((*MacipACLAdd)(nil), "macip_acl_add_d648fd0a") - api.RegisterMessage((*MacipACLAddReplace)(nil), "macip_acl_add_replace_e34402a7") + api.RegisterMessage((*MacipACLAdd)(nil), "macip_acl_add_ce6fbad0") + api.RegisterMessage((*MacipACLAddReplace)(nil), "macip_acl_add_replace_2a461dd4") api.RegisterMessage((*MacipACLAddReplaceReply)(nil), "macip_acl_add_replace_reply_ac407b0c") api.RegisterMessage((*MacipACLAddReply)(nil), "macip_acl_add_reply_ac407b0c") api.RegisterMessage((*MacipACLDel)(nil), "macip_acl_del_ef34fea4") api.RegisterMessage((*MacipACLDelReply)(nil), "macip_acl_del_reply_e8d4e804") - api.RegisterMessage((*MacipACLDetails)(nil), "macip_acl_details_57c7482f") + api.RegisterMessage((*MacipACLDetails)(nil), "macip_acl_details_27135b59") api.RegisterMessage((*MacipACLDump)(nil), "macip_acl_dump_ef34fea4") api.RegisterMessage((*MacipACLInterfaceAddDel)(nil), "macip_acl_interface_add_del_4b8690b1") api.RegisterMessage((*MacipACLInterfaceAddDelReply)(nil), "macip_acl_interface_add_del_reply_e8d4e804") @@ -1766,6 +1904,10 @@ func AllMessages() []api.Message { (*ACLPluginGetConnTableMaxEntriesReply)(nil), (*ACLPluginGetVersion)(nil), (*ACLPluginGetVersionReply)(nil), + (*ACLPluginUseHashLookupGet)(nil), + (*ACLPluginUseHashLookupGetReply)(nil), + (*ACLPluginUseHashLookupSet)(nil), + (*ACLPluginUseHashLookupSetReply)(nil), (*ACLStatsIntfCountersEnable)(nil), (*ACLStatsIntfCountersEnableReply)(nil), (*MacipACLAdd)(nil), diff --git a/binapi/acl/acl_rest.ba.go b/binapi/acl/acl_rest.ba.go deleted file mode 100644 index 0dd8c94..0000000 --- a/binapi/acl/acl_rest.ba.go +++ /dev/null @@ -1,300 +0,0 @@ -// Code generated by GoVPP's binapi-generator. DO NOT EDIT. - -package acl - -import ( - "encoding/json" - "io/ioutil" - "net/http" -) - -func RESTHandler(rpc RPCService) http.Handler { - mux := http.NewServeMux() - mux.HandleFunc("/acl_add_replace", func(w http.ResponseWriter, req *http.Request) { - var request = new(ACLAddReplace) - 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.ACLAddReplace(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("/acl_del", func(w http.ResponseWriter, req *http.Request) { - var request = new(ACLDel) - 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.ACLDel(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("/acl_interface_add_del", func(w http.ResponseWriter, req *http.Request) { - var request = new(ACLInterfaceAddDel) - 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.ACLInterfaceAddDel(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("/acl_interface_set_acl_list", func(w http.ResponseWriter, req *http.Request) { - var request = new(ACLInterfaceSetACLList) - 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.ACLInterfaceSetACLList(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("/acl_interface_set_etype_whitelist", func(w http.ResponseWriter, req *http.Request) { - var request = new(ACLInterfaceSetEtypeWhitelist) - 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.ACLInterfaceSetEtypeWhitelist(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("/acl_plugin_control_ping", func(w http.ResponseWriter, req *http.Request) { - var request = new(ACLPluginControlPing) - reply, err := rpc.ACLPluginControlPing(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("/acl_plugin_get_conn_table_max_entries", func(w http.ResponseWriter, req *http.Request) { - var request = new(ACLPluginGetConnTableMaxEntries) - reply, err := rpc.ACLPluginGetConnTableMaxEntries(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("/acl_plugin_get_version", func(w http.ResponseWriter, req *http.Request) { - var request = new(ACLPluginGetVersion) - reply, err := rpc.ACLPluginGetVersion(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("/acl_stats_intf_counters_enable", func(w http.ResponseWriter, req *http.Request) { - var request = new(ACLStatsIntfCountersEnable) - 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.ACLStatsIntfCountersEnable(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("/macip_acl_add", func(w http.ResponseWriter, req *http.Request) { - var request = new(MacipACLAdd) - 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.MacipACLAdd(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("/macip_acl_add_replace", func(w http.ResponseWriter, req *http.Request) { - var request = new(MacipACLAddReplace) - 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.MacipACLAddReplace(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("/macip_acl_del", func(w http.ResponseWriter, req *http.Request) { - var request = new(MacipACLDel) - 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.MacipACLDel(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("/macip_acl_interface_add_del", func(w http.ResponseWriter, req *http.Request) { - var request = new(MacipACLInterfaceAddDel) - 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.MacipACLInterfaceAddDel(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("/macip_acl_interface_get", func(w http.ResponseWriter, req *http.Request) { - var request = new(MacipACLInterfaceGet) - reply, err := rpc.MacipACLInterfaceGet(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/acl/acl_rpc.ba.go b/binapi/acl/acl_rpc.ba.go index a69df27..2269ba8 100644 --- a/binapi/acl/acl_rpc.ba.go +++ b/binapi/acl/acl_rpc.ba.go @@ -5,12 +5,13 @@ package acl 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 acl. +// RPCService defines RPC service acl. type RPCService interface { ACLAddReplace(ctx context.Context, in *ACLAddReplace) (*ACLAddReplaceReply, error) ACLDel(ctx context.Context, in *ACLDel) (*ACLDelReply, error) @@ -23,6 +24,8 @@ type RPCService interface { ACLPluginControlPing(ctx context.Context, in *ACLPluginControlPing) (*ACLPluginControlPingReply, error) ACLPluginGetConnTableMaxEntries(ctx context.Context, in *ACLPluginGetConnTableMaxEntries) (*ACLPluginGetConnTableMaxEntriesReply, error) ACLPluginGetVersion(ctx context.Context, in *ACLPluginGetVersion) (*ACLPluginGetVersionReply, error) + ACLPluginUseHashLookupGet(ctx context.Context, in *ACLPluginUseHashLookupGet) (*ACLPluginUseHashLookupGetReply, error) + ACLPluginUseHashLookupSet(ctx context.Context, in *ACLPluginUseHashLookupSet) (*ACLPluginUseHashLookupSetReply, error) ACLStatsIntfCountersEnable(ctx context.Context, in *ACLStatsIntfCountersEnable) (*ACLStatsIntfCountersEnableReply, error) MacipACLAdd(ctx context.Context, in *MacipACLAdd) (*MacipACLAddReply, error) MacipACLAddReplace(ctx context.Context, in *MacipACLAddReplace) (*MacipACLAddReplaceReply, error) @@ -47,7 +50,7 @@ func (c *serviceClient) ACLAddReplace(ctx context.Context, in *ACLAddReplace) (* if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) ACLDel(ctx context.Context, in *ACLDel) (*ACLDelReply, error) { @@ -56,7 +59,7 @@ func (c *serviceClient) ACLDel(ctx context.Context, in *ACLDel) (*ACLDelReply, e if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) ACLDump(ctx context.Context, in *ACLDump) (RPCService_ACLDumpClient, error) { @@ -68,7 +71,7 @@ func (c *serviceClient) ACLDump(ctx context.Context, in *ACLDump) (RPCService_AC 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 @@ -91,7 +94,11 @@ func (c *serviceClient_ACLDumpClient) Recv() (*ACLDetails, error) { switch m := msg.(type) { case *ACLDetails: 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) @@ -104,7 +111,7 @@ func (c *serviceClient) ACLInterfaceAddDel(ctx context.Context, in *ACLInterface if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) ACLInterfaceEtypeWhitelistDump(ctx context.Context, in *ACLInterfaceEtypeWhitelistDump) (RPCService_ACLInterfaceEtypeWhitelistDumpClient, error) { @@ -116,7 +123,7 @@ func (c *serviceClient) ACLInterfaceEtypeWhitelistDump(ctx context.Context, in * 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 @@ -139,7 +146,11 @@ func (c *serviceClient_ACLInterfaceEtypeWhitelistDumpClient) Recv() (*ACLInterfa switch m := msg.(type) { case *ACLInterfaceEtypeWhitelistDetails: 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) @@ -155,7 +166,7 @@ func (c *serviceClient) ACLInterfaceListDump(ctx context.Context, in *ACLInterfa 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 @@ -178,7 +189,11 @@ func (c *serviceClient_ACLInterfaceListDumpClient) Recv() (*ACLInterfaceListDeta switch m := msg.(type) { case *ACLInterfaceListDetails: 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) @@ -191,7 +206,7 @@ func (c *serviceClient) ACLInterfaceSetACLList(ctx context.Context, in *ACLInter if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) ACLInterfaceSetEtypeWhitelist(ctx context.Context, in *ACLInterfaceSetEtypeWhitelist) (*ACLInterfaceSetEtypeWhitelistReply, error) { @@ -200,7 +215,7 @@ func (c *serviceClient) ACLInterfaceSetEtypeWhitelist(ctx context.Context, in *A if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) ACLPluginControlPing(ctx context.Context, in *ACLPluginControlPing) (*ACLPluginControlPingReply, error) { @@ -209,7 +224,7 @@ func (c *serviceClient) ACLPluginControlPing(ctx context.Context, in *ACLPluginC if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) ACLPluginGetConnTableMaxEntries(ctx context.Context, in *ACLPluginGetConnTableMaxEntries) (*ACLPluginGetConnTableMaxEntriesReply, error) { @@ -230,13 +245,31 @@ func (c *serviceClient) ACLPluginGetVersion(ctx context.Context, in *ACLPluginGe return out, nil } +func (c *serviceClient) ACLPluginUseHashLookupGet(ctx context.Context, in *ACLPluginUseHashLookupGet) (*ACLPluginUseHashLookupGetReply, error) { + out := new(ACLPluginUseHashLookupGetReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) ACLPluginUseHashLookupSet(ctx context.Context, in *ACLPluginUseHashLookupSet) (*ACLPluginUseHashLookupSetReply, error) { + out := new(ACLPluginUseHashLookupSetReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) ACLStatsIntfCountersEnable(ctx context.Context, in *ACLStatsIntfCountersEnable) (*ACLStatsIntfCountersEnableReply, error) { out := new(ACLStatsIntfCountersEnableReply) 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) MacipACLAdd(ctx context.Context, in *MacipACLAdd) (*MacipACLAddReply, error) { @@ -245,7 +278,7 @@ func (c *serviceClient) MacipACLAdd(ctx context.Context, in *MacipACLAdd) (*Maci if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MacipACLAddReplace(ctx context.Context, in *MacipACLAddReplace) (*MacipACLAddReplaceReply, error) { @@ -254,7 +287,7 @@ func (c *serviceClient) MacipACLAddReplace(ctx context.Context, in *MacipACLAddR if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MacipACLDel(ctx context.Context, in *MacipACLDel) (*MacipACLDelReply, error) { @@ -263,7 +296,7 @@ func (c *serviceClient) MacipACLDel(ctx context.Context, in *MacipACLDel) (*Maci if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MacipACLDump(ctx context.Context, in *MacipACLDump) (RPCService_MacipACLDumpClient, error) { @@ -275,7 +308,7 @@ func (c *serviceClient) MacipACLDump(ctx context.Context, in *MacipACLDump) (RPC 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 @@ -298,7 +331,11 @@ func (c *serviceClient_MacipACLDumpClient) Recv() (*MacipACLDetails, error) { switch m := msg.(type) { case *MacipACLDetails: 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) @@ -311,7 +348,7 @@ func (c *serviceClient) MacipACLInterfaceAddDel(ctx context.Context, in *MacipAC if err != nil { return nil, err } - return out, nil + return out, api.RetvalToVPPApiError(out.Retval) } func (c *serviceClient) MacipACLInterfaceGet(ctx context.Context, in *MacipACLInterfaceGet) (*MacipACLInterfaceGetReply, error) { @@ -332,7 +369,7 @@ func (c *serviceClient) MacipACLInterfaceListDump(ctx context.Context, in *Macip 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 @@ -355,7 +392,11 @@ func (c *serviceClient_MacipACLInterfaceListDumpClient) Recv() (*MacipACLInterfa switch m := msg.(type) { case *MacipACLInterfaceListDetails: 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) |