diff --git a/Gopkg.lock b/Gopkg.lock index e93bc8a103..0a46e27df3 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -10,8 +10,8 @@ version = "v0.37.2" [[projects]] - branch = "vpp1901" - digest = "1:ea26c62248bc837f3a4f504e7868726c9a3ae9f04b9fd007ad303b37984fceb0" + branch = "master" + digest = "1:bb5678bab3e7ae80a9a60b474c90356453e4306ff81aa4fbe64ec887b9c47e0e" name = "git.fd.io/govpp.git" packages = [ "adapter", @@ -25,8 +25,7 @@ "examples/bin_api/memclnt", ] pruneopts = "UT" - revision = "b68632527ae6efd62e7ed63e5142cc719da0047a" - source = "github.com/ligato/govpp.git" + revision = "87e79ec9fa48e5f8b2eb949c337488db75a17b29" [[projects]] branch = "master" @@ -471,6 +470,14 @@ revision = "2ff6f7ffd60f0f2410b3105864bdd12c7894f844" version = "v5.0.1" +[[projects]] + digest = "1:fa6faf4a2977dc7643de38ae599a95424d82f8ffc184045510737010a82c4ecd" + name = "github.com/gogo/googleapis" + packages = ["google/rpc"] + pruneopts = "UT" + revision = "d31c731455cb061f42baff3bda55bad0118b126b" + version = "v1.2.0" + [[projects]] digest = "1:2d91858167615bbc9f642045d8f7e38a16b346fcc2523f9dc75b6da4d8b3397c" name = "github.com/gogo/protobuf" @@ -509,6 +516,14 @@ revision = "ba06b47c162d49f2af050fb4c75bcbc86a159d5c" version = "v1.2.1" +[[projects]] + digest = "1:6c0f44b070ed82c2f752d42e936fe12094464a22e70bae5d86790865e1ea326b" + name = "github.com/gogo/status" + packages = ["."] + pruneopts = "UT" + revision = "935308aef7372e7685e8fbee162aae8f7a7e515a" + version = "v1.1.0" + [[projects]] branch = "master" digest = "1:1ba1d79f2810270045c328ae5d674321db34e3aae468eb4233883b473c5c0467" @@ -728,14 +743,14 @@ version = "v1.14.1" [[projects]] - branch = "dev" - digest = "1:2dde42b5ece0c50fc21170d55db972c1eafab9d505a0ee4ddab8f968286da1cb" + digest = "1:52deab9cdd0bebb44dd010c960ebd83406fab5976970d24f724ca1049321202d" name = "github.com/ligato/cn-infra" packages = [ "agent", "config", "datasync", "datasync/kvdbsync", + "datasync/kvdbsync/local", "datasync/resync", "datasync/syncbase", "db/keyval", @@ -768,14 +783,16 @@ "utils/safeclose", ] pruneopts = "UT" - revision = "77e78aeca2f5c728bcf836bcbd20da7afea8ffde" + revision = "ceaf6f4fe9f9fa6aa0629edc20156a969928f0e5" + version = "v2.1.0" [[projects]] - branch = "dev" - digest = "1:980721b7ddf595ed4ab4eb610b39ebb5dcaba74382d5e0026820e6293041eac1" + digest = "1:f2cedc9ea454da9c682cfc7480da9714c993f071a1af77441e901472e6481786" name = "github.com/ligato/vpp-agent" packages = [ + "api/configurator", "api/genericmanager", + "api/models/linux", "api/models/linux/interfaces", "api/models/linux/iptables", "api/models/linux/l3", @@ -796,9 +813,10 @@ "pkg/idxvpp", "pkg/metrics", "pkg/models", + "pkg/util", + "plugins/configurator", "plugins/govppmux", "plugins/govppmux/vppcalls", - "plugins/govppmux/vppcalls/vpp1810", "plugins/govppmux/vppcalls/vpp1901", "plugins/govppmux/vppcalls/vpp1904", "plugins/kvscheduler", @@ -822,11 +840,11 @@ "plugins/linux/nsplugin", "plugins/linux/nsplugin/descriptor", "plugins/linux/nsplugin/linuxcalls", + "plugins/orchestrator", "plugins/restapi", "plugins/restapi/resturl", "plugins/telemetry", "plugins/telemetry/vppcalls", - "plugins/telemetry/vppcalls/vpp1810", "plugins/telemetry/vppcalls/vpp1901", "plugins/telemetry/vppcalls/vpp1904", "plugins/vpp/abfplugin/vppcalls", @@ -835,28 +853,8 @@ "plugins/vpp/aclplugin/descriptor", "plugins/vpp/aclplugin/descriptor/adapter", "plugins/vpp/aclplugin/vppcalls", - "plugins/vpp/aclplugin/vppcalls/vpp1810", "plugins/vpp/aclplugin/vppcalls/vpp1901", "plugins/vpp/aclplugin/vppcalls/vpp1904", - "plugins/vpp/binapi/vpp1810/acl", - "plugins/vpp/binapi/vpp1810/af_packet", - "plugins/vpp/binapi/vpp1810/bond", - "plugins/vpp/binapi/vpp1810/dhcp", - "plugins/vpp/binapi/vpp1810/interfaces", - "plugins/vpp/binapi/vpp1810/ip", - "plugins/vpp/binapi/vpp1810/ipsec", - "plugins/vpp/binapi/vpp1810/l2", - "plugins/vpp/binapi/vpp1810/memclnt", - "plugins/vpp/binapi/vpp1810/memif", - "plugins/vpp/binapi/vpp1810/nat", - "plugins/vpp/binapi/vpp1810/punt", - "plugins/vpp/binapi/vpp1810/sr", - "plugins/vpp/binapi/vpp1810/stn", - "plugins/vpp/binapi/vpp1810/tap", - "plugins/vpp/binapi/vpp1810/tapv2", - "plugins/vpp/binapi/vpp1810/vmxnet3", - "plugins/vpp/binapi/vpp1810/vpe", - "plugins/vpp/binapi/vpp1810/vxlan", "plugins/vpp/binapi/vpp1901/acl", "plugins/vpp/binapi/vpp1901/af_packet", "plugins/vpp/binapi/vpp1901/bond", @@ -900,54 +898,49 @@ "plugins/vpp/ifplugin/descriptor/adapter", "plugins/vpp/ifplugin/ifaceidx", "plugins/vpp/ifplugin/vppcalls", - "plugins/vpp/ifplugin/vppcalls/vpp1810", "plugins/vpp/ifplugin/vppcalls/vpp1901", "plugins/vpp/ifplugin/vppcalls/vpp1904", + "plugins/vpp/ipsecplugin/vppcalls", "plugins/vpp/l2plugin", "plugins/vpp/l2plugin/descriptor", "plugins/vpp/l2plugin/descriptor/adapter", "plugins/vpp/l2plugin/vppcalls", - "plugins/vpp/l2plugin/vppcalls/vpp1810", "plugins/vpp/l2plugin/vppcalls/vpp1901", "plugins/vpp/l2plugin/vppcalls/vpp1904", "plugins/vpp/l3plugin", "plugins/vpp/l3plugin/descriptor", "plugins/vpp/l3plugin/descriptor/adapter", "plugins/vpp/l3plugin/vppcalls", - "plugins/vpp/l3plugin/vppcalls/vpp1810", "plugins/vpp/l3plugin/vppcalls/vpp1901", "plugins/vpp/l3plugin/vppcalls/vpp1904", "plugins/vpp/natplugin", "plugins/vpp/natplugin/descriptor", "plugins/vpp/natplugin/descriptor/adapter", "plugins/vpp/natplugin/vppcalls", - "plugins/vpp/natplugin/vppcalls/vpp1810", "plugins/vpp/natplugin/vppcalls/vpp1901", "plugins/vpp/natplugin/vppcalls/vpp1904", "plugins/vpp/puntplugin", "plugins/vpp/puntplugin/descriptor", "plugins/vpp/puntplugin/descriptor/adapter", "plugins/vpp/puntplugin/vppcalls", - "plugins/vpp/puntplugin/vppcalls/vpp1810", "plugins/vpp/puntplugin/vppcalls/vpp1901", "plugins/vpp/puntplugin/vppcalls/vpp1904", "plugins/vpp/srplugin", "plugins/vpp/srplugin/descriptor", "plugins/vpp/srplugin/descriptor/adapter", "plugins/vpp/srplugin/vppcalls", - "plugins/vpp/srplugin/vppcalls/vpp1810", "plugins/vpp/srplugin/vppcalls/vpp1901", "plugins/vpp/srplugin/vppcalls/vpp1904", "plugins/vpp/stnplugin", "plugins/vpp/stnplugin/descriptor", "plugins/vpp/stnplugin/descriptor/adapter", "plugins/vpp/stnplugin/vppcalls", - "plugins/vpp/stnplugin/vppcalls/vpp1810", "plugins/vpp/stnplugin/vppcalls/vpp1901", "plugins/vpp/stnplugin/vppcalls/vpp1904", ] pruneopts = "UT" - revision = "a66972fa2143dfe83473fd76f9df37784447620d" + revision = "64049536e929372dce3d32678c5160e803816c48" + version = "v2.1.0" [[projects]] branch = "master" diff --git a/Gopkg.toml b/Gopkg.toml index a76b8f54b9..04d402bf1e 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -44,7 +44,7 @@ required = [ [[constraint]] name = "github.com/ligato/vpp-agent" - branch = "dev" + version = "2.1.0" [[constraint]] revision = "b5bfa59ec0adc420475f97f89b58045c721d761c" @@ -139,12 +139,6 @@ required = [ name = "k8s.io/code-generator" version = "kubernetes-1.11.0" -# TODO: remove override once latest govpp can be compiled with vpp 19.01 -[[override]] - name = "git.fd.io/govpp.git" - source = "github.com/ligato/govpp.git" - branch = "vpp1901" - [prune] go-tests = true unused-packages = true diff --git a/vendor/git.fd.io/govpp.git/adapter/socketclient/socketclient.go b/vendor/git.fd.io/govpp.git/adapter/socketclient/socketclient.go index 8efc7ba47b..2b67645461 100644 --- a/vendor/git.fd.io/govpp.git/adapter/socketclient/socketclient.go +++ b/vendor/git.fd.io/govpp.git/adapter/socketclient/socketclient.go @@ -171,10 +171,15 @@ func (c *vppClient) connect(sockAddr string) error { return err } - conn, err := net.DialUnix("unixpacket", nil, addr) + conn, err := net.DialUnix("unix", nil, addr) if err != nil { - Log.Debugln("Dial error:", err) - return err + if strings.Contains(err.Error(), "wrong type for socket") { + conn, err = net.DialUnix("unixpacket", nil, addr) + } + if err != nil { + Log.Debugln("Dial error:", err) + return err + } } c.conn = conn diff --git a/vendor/git.fd.io/govpp.git/adapter/vppapiclient/stat_client.go b/vendor/git.fd.io/govpp.git/adapter/vppapiclient/stat_client.go index e630db1ae7..2615b6537d 100644 --- a/vendor/git.fd.io/govpp.git/adapter/vppapiclient/stat_client.go +++ b/vendor/git.fd.io/govpp.git/adapter/vppapiclient/stat_client.go @@ -20,146 +20,10 @@ package vppapiclient #cgo CFLAGS: -DPNG_DEBUG=1 #cgo LDFLAGS: -lvppapiclient -#include -#include -#include -#include -#include -#include - -static int -govpp_stat_connect(char *socket_name) -{ - return stat_segment_connect(socket_name); -} - -static void -govpp_stat_disconnect() -{ - stat_segment_disconnect(); -} - -static uint32_t* -govpp_stat_segment_ls(uint8_t **pattern) -{ - return stat_segment_ls(pattern); -} - -static int -govpp_stat_segment_vec_len(void *vec) -{ - return stat_segment_vec_len(vec); -} - -static void -govpp_stat_segment_vec_free(void *vec) -{ - stat_segment_vec_free(vec); -} - -static char* -govpp_stat_segment_dir_index_to_name(uint32_t *dir, uint32_t index) -{ - return stat_segment_index_to_name(dir[index]); -} - -static stat_segment_data_t* -govpp_stat_segment_dump(uint32_t *counter_vec) -{ - return stat_segment_dump(counter_vec); -} - -static stat_segment_data_t -govpp_stat_segment_dump_index(stat_segment_data_t *data, int index) -{ - return data[index]; -} - -static int -govpp_stat_segment_data_type(stat_segment_data_t *data) -{ - return data->type; -} - -static double -govpp_stat_segment_data_get_scalar_value(stat_segment_data_t *data) -{ - return data->scalar_value; -} - -static double -govpp_stat_segment_data_get_error_value(stat_segment_data_t *data) -{ - return data->error_value; -} - -static uint64_t** -govpp_stat_segment_data_get_simple_counter(stat_segment_data_t *data) -{ - return data->simple_counter_vec; -} - -static uint64_t* -govpp_stat_segment_data_get_simple_counter_index(stat_segment_data_t *data, int index) -{ - return data->simple_counter_vec[index]; -} - -static uint64_t -govpp_stat_segment_data_get_simple_counter_index_value(stat_segment_data_t *data, int index, int index2) -{ - return data->simple_counter_vec[index][index2]; -} - -static vlib_counter_t** -govpp_stat_segment_data_get_combined_counter(stat_segment_data_t *data) -{ - return data->combined_counter_vec; -} - -static vlib_counter_t* -govpp_stat_segment_data_get_combined_counter_index(stat_segment_data_t *data, int index) -{ - return data->combined_counter_vec[index]; -} - -static uint64_t -govpp_stat_segment_data_get_combined_counter_index_packets(stat_segment_data_t *data, int index, int index2) -{ - return data->combined_counter_vec[index][index2].packets; -} - -static uint64_t -govpp_stat_segment_data_get_combined_counter_index_bytes(stat_segment_data_t *data, int index, int index2) -{ - return data->combined_counter_vec[index][index2].bytes; -} - -// static uint8_t** -// govpp_stat_segment_data_get_name_vector(stat_segment_data_t *data) -// { -// return data->name_vector; -// } - -// static char* -// govpp_stat_segment_data_get_name_vector_index(stat_segment_data_t *data, int index) -// { -// return data->name_vector[index]; -// } - -static void -govpp_stat_segment_data_free(stat_segment_data_t *data) -{ - stat_segment_data_free(data); -} - -static uint8_t** -govpp_stat_segment_string_vector(uint8_t ** string_vector, char *string) -{ - return stat_segment_string_vector(string_vector, string); -} +#include "stat_client_wrapper.h" */ import "C" + import ( "errors" "fmt" @@ -296,8 +160,7 @@ func (c *statClient) DumpStats(patterns ...string) (stats []*adapter.StatEntry, stat.Data = adapter.CombinedCounterStat(vector) case adapter.NameVector: - fallthrough - /*length := int(C.govpp_stat_segment_vec_len(unsafe.Pointer(C.govpp_stat_segment_data_get_name_vector(&v)))) + length := int(C.govpp_stat_segment_vec_len(unsafe.Pointer(C.govpp_stat_segment_data_get_name_vector(&v)))) var vector []adapter.Name for k := 0; k < length; k++ { s := C.govpp_stat_segment_data_get_name_vector_index(&v, C.int(k)) @@ -307,7 +170,7 @@ func (c *statClient) DumpStats(patterns ...string) (stats []*adapter.StatEntry, } vector = append(vector, name) } - stat.Data = adapter.NameStat(vector)*/ + stat.Data = adapter.NameStat(vector) default: fmt.Fprintf(os.Stderr, "invalid stat type: %v (%v)\n", typ, name) diff --git a/vendor/git.fd.io/govpp.git/adapter/vppapiclient/stat_client_wrapper.h b/vendor/git.fd.io/govpp.git/adapter/vppapiclient/stat_client_wrapper.h new file mode 100644 index 0000000000..9178fb5598 --- /dev/null +++ b/vendor/git.fd.io/govpp.git/adapter/vppapiclient/stat_client_wrapper.h @@ -0,0 +1,176 @@ +// Copyright (c) 2018 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef included_stat_client_wrapper_h +#define included_stat_client_wrapper_h + +#include +#include +#include +#include + +#include // VPP has to be installed! + +// The stat_client.h defines its version using two macros: +// STAT_VERSION_MAJOR - for major version +// STAT_VERSION_MINOR - for minor version +// both were introduced in VPP 19.04 (not on release, later on stable/1904) +// https://github.com/FDio/vpp/commit/1cb333cdf5ce26557233c5bdb5a18738cb6e1e2c + +// Name vector directory type was introduced in VPP 19.04 +#if STAT_VERSION_MAJOR >= 1 && STAT_VERSION_MINOR >= 1 + #define SUPPORTS_NAME_VECTOR // VPP 19.04 is required! +#endif + +static int +govpp_stat_connect(char *socket_name) +{ + return stat_segment_connect(socket_name); +} + +static void +govpp_stat_disconnect() +{ + stat_segment_disconnect(); +} + +static uint32_t* +govpp_stat_segment_ls(uint8_t **pattern) +{ + return stat_segment_ls(pattern); +} + +static int +govpp_stat_segment_vec_len(void *vec) +{ + return stat_segment_vec_len(vec); +} + +static void +govpp_stat_segment_vec_free(void *vec) +{ + stat_segment_vec_free(vec); +} + +static char* +govpp_stat_segment_dir_index_to_name(uint32_t *dir, uint32_t index) +{ + return stat_segment_index_to_name(dir[index]); +} + +static stat_segment_data_t* +govpp_stat_segment_dump(uint32_t *counter_vec) +{ + return stat_segment_dump(counter_vec); +} + +static stat_segment_data_t +govpp_stat_segment_dump_index(stat_segment_data_t *data, int index) +{ + return data[index]; +} + +static int +govpp_stat_segment_data_type(stat_segment_data_t *data) +{ + return data->type; +} + +static double +govpp_stat_segment_data_get_scalar_value(stat_segment_data_t *data) +{ + return data->scalar_value; +} + +static double +govpp_stat_segment_data_get_error_value(stat_segment_data_t *data) +{ + return data->error_value; +} + +static uint64_t** +govpp_stat_segment_data_get_simple_counter(stat_segment_data_t *data) +{ + return data->simple_counter_vec; +} + +static uint64_t* +govpp_stat_segment_data_get_simple_counter_index(stat_segment_data_t *data, int index) +{ + return data->simple_counter_vec[index]; +} + +static uint64_t +govpp_stat_segment_data_get_simple_counter_index_value(stat_segment_data_t *data, int index, int index2) +{ + return data->simple_counter_vec[index][index2]; +} + +static vlib_counter_t** +govpp_stat_segment_data_get_combined_counter(stat_segment_data_t *data) +{ + return data->combined_counter_vec; +} + +static vlib_counter_t* +govpp_stat_segment_data_get_combined_counter_index(stat_segment_data_t *data, int index) +{ + return data->combined_counter_vec[index]; +} + +static uint64_t +govpp_stat_segment_data_get_combined_counter_index_packets(stat_segment_data_t *data, int index, int index2) +{ + return data->combined_counter_vec[index][index2].packets; +} + +static uint64_t +govpp_stat_segment_data_get_combined_counter_index_bytes(stat_segment_data_t *data, int index, int index2) +{ + return data->combined_counter_vec[index][index2].bytes; +} + +static uint8_t** +govpp_stat_segment_data_get_name_vector(stat_segment_data_t *data) +{ +#ifdef SUPPORTS_NAME_VECTOR + return data->name_vector; // VPP 19.04 is required! +#else + return 0; +#endif +} + +static char* +govpp_stat_segment_data_get_name_vector_index(stat_segment_data_t *data, int index) +{ +#ifdef SUPPORTS_NAME_VECTOR + return data->name_vector[index]; // VPP 19.04 is required! +#else + return 0; +#endif +} + +static void +govpp_stat_segment_data_free(stat_segment_data_t *data) +{ + stat_segment_data_free(data); +} + +static uint8_t** +govpp_stat_segment_string_vector(uint8_t ** string_vector, char *string) +{ + return stat_segment_string_vector(string_vector, string); +} + +#endif /* included_stat_client_wrapper_h */ diff --git a/vendor/git.fd.io/govpp.git/adapter/vppapiclient/vppapiclient.go b/vendor/git.fd.io/govpp.git/adapter/vppapiclient/vppapiclient.go index f637060afc..d8465d7366 100644 --- a/vendor/git.fd.io/govpp.git/adapter/vppapiclient/vppapiclient.go +++ b/vendor/git.fd.io/govpp.git/adapter/vppapiclient/vppapiclient.go @@ -20,56 +20,7 @@ package vppapiclient #cgo CFLAGS: -DPNG_DEBUG=1 #cgo LDFLAGS: -lvppapiclient -#include -#include -#include -#include -#include - -extern void go_msg_callback(uint16_t msg_id, void* data, size_t size); - -typedef struct __attribute__((__packed__)) _req_header { - uint16_t msg_id; - uint32_t client_index; - uint32_t context; -} req_header_t; - -typedef struct __attribute__((__packed__)) _reply_header { - uint16_t msg_id; -} reply_header_t; - -static void -govpp_msg_callback(unsigned char *data, int size) -{ - reply_header_t *header = ((reply_header_t *)data); - go_msg_callback(ntohs(header->msg_id), data, size); -} - -static int -govpp_send(uint32_t context, void *data, size_t size) -{ - req_header_t *header = ((req_header_t *)data); - header->context = htonl(context); - return vac_write(data, size); -} - -static int -govpp_connect(char *shm, int rx_qlen) -{ - return vac_connect("govpp", shm, govpp_msg_callback, rx_qlen); -} - -static int -govpp_disconnect() -{ - return vac_disconnect(); -} - -static uint32_t -govpp_get_msg_index(char *name_and_crc) -{ - return vac_get_msg_index(name_and_crc); -} +#include "vppapiclient_wrapper.h" */ import "C" @@ -81,8 +32,9 @@ import ( "time" "unsafe" - "git.fd.io/govpp.git/adapter" "github.com/fsnotify/fsnotify" + + "git.fd.io/govpp.git/adapter" ) var ( diff --git a/vendor/git.fd.io/govpp.git/adapter/vppapiclient/vppapiclient_wrapper.h b/vendor/git.fd.io/govpp.git/adapter/vppapiclient/vppapiclient_wrapper.h new file mode 100644 index 0000000000..691c782979 --- /dev/null +++ b/vendor/git.fd.io/govpp.git/adapter/vppapiclient/vppapiclient_wrapper.h @@ -0,0 +1,71 @@ +// Copyright (c) 2018 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef included_vppapiclient_wrapper_h +#define included_vppapiclient_wrapper_h + +#include +#include +#include +#include + +#include // VPP has to be installed! + +// function go_msg_callback is defined in vppapiclient.go +extern void go_msg_callback(uint16_t msg_id, void* data, size_t size); + +typedef struct __attribute__((__packed__)) _req_header { + uint16_t msg_id; + uint32_t client_index; + uint32_t context; +} req_header_t; + +typedef struct __attribute__((__packed__)) _reply_header { + uint16_t msg_id; +} reply_header_t; + +static void +govpp_msg_callback(unsigned char *data, int size) +{ + reply_header_t *header = ((reply_header_t *)data); + go_msg_callback(ntohs(header->msg_id), data, size); +} + +static int +govpp_send(uint32_t context, void *data, size_t size) +{ + req_header_t *header = ((req_header_t *)data); + header->context = htonl(context); + return vac_write(data, size); +} + +static int +govpp_connect(char *shm, int rx_qlen) +{ + return vac_connect("govpp", shm, govpp_msg_callback, rx_qlen); +} + +static int +govpp_disconnect() +{ + return vac_disconnect(); +} + +static uint32_t +govpp_get_msg_index(char *name_and_crc) +{ + return vac_get_msg_index(name_and_crc); +} + +#endif /* included_vppapiclient_wrapper_h */ diff --git a/vendor/github.com/gogo/googleapis/LICENSE b/vendor/github.com/gogo/googleapis/LICENSE new file mode 100644 index 0000000000..d6f85b1817 --- /dev/null +++ b/vendor/github.com/gogo/googleapis/LICENSE @@ -0,0 +1,203 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2015, Google Inc + Copyright 2018, GoGo Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/vendor/github.com/gogo/googleapis/google/rpc/code.pb.go b/vendor/github.com/gogo/googleapis/google/rpc/code.pb.go new file mode 100644 index 0000000000..e2c94aeceb --- /dev/null +++ b/vendor/github.com/gogo/googleapis/google/rpc/code.pb.go @@ -0,0 +1,257 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: google/rpc/code.proto + +package rpc + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + math "math" + strconv "strconv" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +// The canonical error codes for Google APIs. +// +// +// Sometimes multiple error codes may apply. Services should return +// the most specific error code that applies. For example, prefer +// `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. +// Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. +type Code int32 + +const ( + // Not an error; returned on success + // + // HTTP Mapping: 200 OK + OK Code = 0 + // The operation was cancelled, typically by the caller. + // + // HTTP Mapping: 499 Client Closed Request + CANCELLED Code = 1 + // Unknown error. For example, this error may be returned when + // a `Status` value received from another address space belongs to + // an error space that is not known in this address space. Also + // errors raised by APIs that do not return enough error information + // may be converted to this error. + // + // HTTP Mapping: 500 Internal Server Error + UNKNOWN Code = 2 + // The client specified an invalid argument. Note that this differs + // from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments + // that are problematic regardless of the state of the system + // (e.g., a malformed file name). + // + // HTTP Mapping: 400 Bad Request + INVALID_ARGUMENT Code = 3 + // The deadline expired before the operation could complete. For operations + // that change the state of the system, this error may be returned + // even if the operation has completed successfully. For example, a + // successful response from a server could have been delayed long + // enough for the deadline to expire. + // + // HTTP Mapping: 504 Gateway Timeout + DEADLINE_EXCEEDED Code = 4 + // Some requested entity (e.g., file or directory) was not found. + // + // Note to server developers: if a request is denied for an entire class + // of users, such as gradual feature rollout or undocumented whitelist, + // `NOT_FOUND` may be used. If a request is denied for some users within + // a class of users, such as user-based access control, `PERMISSION_DENIED` + // must be used. + // + // HTTP Mapping: 404 Not Found + NOT_FOUND Code = 5 + // The entity that a client attempted to create (e.g., file or directory) + // already exists. + // + // HTTP Mapping: 409 Conflict + ALREADY_EXISTS Code = 6 + // The caller does not have permission to execute the specified + // operation. `PERMISSION_DENIED` must not be used for rejections + // caused by exhausting some resource (use `RESOURCE_EXHAUSTED` + // instead for those errors). `PERMISSION_DENIED` must not be + // used if the caller can not be identified (use `UNAUTHENTICATED` + // instead for those errors). This error code does not imply the + // request is valid or the requested entity exists or satisfies + // other pre-conditions. + // + // HTTP Mapping: 403 Forbidden + PERMISSION_DENIED Code = 7 + // The request does not have valid authentication credentials for the + // operation. + // + // HTTP Mapping: 401 Unauthorized + UNAUTHENTICATED Code = 16 + // Some resource has been exhausted, perhaps a per-user quota, or + // perhaps the entire file system is out of space. + // + // HTTP Mapping: 429 Too Many Requests + RESOURCE_EXHAUSTED Code = 8 + // The operation was rejected because the system is not in a state + // required for the operation's execution. For example, the directory + // to be deleted is non-empty, an rmdir operation is applied to + // a non-directory, etc. + // + // Service implementors can use the following guidelines to decide + // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: + // (a) Use `UNAVAILABLE` if the client can retry just the failing call. + // (b) Use `ABORTED` if the client should retry at a higher level + // (e.g., when a client-specified test-and-set fails, indicating the + // client should restart a read-modify-write sequence). + // (c) Use `FAILED_PRECONDITION` if the client should not retry until + // the system state has been explicitly fixed. E.g., if an "rmdir" + // fails because the directory is non-empty, `FAILED_PRECONDITION` + // should be returned since the client should not retry unless + // the files are deleted from the directory. + // + // HTTP Mapping: 400 Bad Request + FAILED_PRECONDITION Code = 9 + // The operation was aborted, typically due to a concurrency issue such as + // a sequencer check failure or transaction abort. + // + // See the guidelines above for deciding between `FAILED_PRECONDITION`, + // `ABORTED`, and `UNAVAILABLE`. + // + // HTTP Mapping: 409 Conflict + ABORTED Code = 10 + // The operation was attempted past the valid range. E.g., seeking or + // reading past end-of-file. + // + // Unlike `INVALID_ARGUMENT`, this error indicates a problem that may + // be fixed if the system state changes. For example, a 32-bit file + // system will generate `INVALID_ARGUMENT` if asked to read at an + // offset that is not in the range [0,2^32-1], but it will generate + // `OUT_OF_RANGE` if asked to read from an offset past the current + // file size. + // + // There is a fair bit of overlap between `FAILED_PRECONDITION` and + // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific + // error) when it applies so that callers who are iterating through + // a space can easily look for an `OUT_OF_RANGE` error to detect when + // they are done. + // + // HTTP Mapping: 400 Bad Request + OUT_OF_RANGE Code = 11 + // The operation is not implemented or is not supported/enabled in this + // service. + // + // HTTP Mapping: 501 Not Implemented + UNIMPLEMENTED Code = 12 + // Internal errors. This means that some invariants expected by the + // underlying system have been broken. This error code is reserved + // for serious errors. + // + // HTTP Mapping: 500 Internal Server Error + INTERNAL Code = 13 + // The service is currently unavailable. This is most likely a + // transient condition, which can be corrected by retrying with + // a backoff. + // + // See the guidelines above for deciding between `FAILED_PRECONDITION`, + // `ABORTED`, and `UNAVAILABLE`. + // + // HTTP Mapping: 503 Service Unavailable + UNAVAILABLE Code = 14 + // Unrecoverable data loss or corruption. + // + // HTTP Mapping: 500 Internal Server Error + DATA_LOSS Code = 15 +) + +var Code_name = map[int32]string{ + 0: "OK", + 1: "CANCELLED", + 2: "UNKNOWN", + 3: "INVALID_ARGUMENT", + 4: "DEADLINE_EXCEEDED", + 5: "NOT_FOUND", + 6: "ALREADY_EXISTS", + 7: "PERMISSION_DENIED", + 16: "UNAUTHENTICATED", + 8: "RESOURCE_EXHAUSTED", + 9: "FAILED_PRECONDITION", + 10: "ABORTED", + 11: "OUT_OF_RANGE", + 12: "UNIMPLEMENTED", + 13: "INTERNAL", + 14: "UNAVAILABLE", + 15: "DATA_LOSS", +} + +var Code_value = map[string]int32{ + "OK": 0, + "CANCELLED": 1, + "UNKNOWN": 2, + "INVALID_ARGUMENT": 3, + "DEADLINE_EXCEEDED": 4, + "NOT_FOUND": 5, + "ALREADY_EXISTS": 6, + "PERMISSION_DENIED": 7, + "UNAUTHENTICATED": 16, + "RESOURCE_EXHAUSTED": 8, + "FAILED_PRECONDITION": 9, + "ABORTED": 10, + "OUT_OF_RANGE": 11, + "UNIMPLEMENTED": 12, + "INTERNAL": 13, + "UNAVAILABLE": 14, + "DATA_LOSS": 15, +} + +func (Code) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_fe593a732623ccf0, []int{0} +} + +func init() { + proto.RegisterEnum("google.rpc.Code", Code_name, Code_value) +} + +func init() { proto.RegisterFile("google/rpc/code.proto", fileDescriptor_fe593a732623ccf0) } + +var fileDescriptor_fe593a732623ccf0 = []byte{ + // 393 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x91, 0x3d, 0x6e, 0x13, 0x41, + 0x14, 0xc7, 0x3d, 0x76, 0x70, 0xe2, 0xf1, 0xd7, 0xcb, 0x84, 0x40, 0x37, 0x07, 0xa0, 0x70, 0x0a, + 0x4e, 0xf0, 0xbc, 0xf3, 0x9c, 0x8c, 0x32, 0x7e, 0xb3, 0x9a, 0x9d, 0x09, 0x01, 0x21, 0xad, 0xc4, + 0xc6, 0x4a, 0x03, 0x5a, 0xcb, 0xe2, 0x00, 0x9c, 0x85, 0x8a, 0x1b, 0x70, 0x85, 0x94, 0x29, 0x29, + 0xf1, 0xa6, 0xa1, 0x74, 0x49, 0x89, 0x06, 0x0a, 0xda, 0x9f, 0xde, 0xc7, 0xff, 0x43, 0x9e, 0xdf, + 0xb7, 0xed, 0xfd, 0xc7, 0xcd, 0xc5, 0x6e, 0xdb, 0x5c, 0x34, 0xed, 0xdd, 0x66, 0xb1, 0xdd, 0xb5, + 0x9f, 0x5b, 0x25, 0xff, 0xe1, 0xc5, 0x6e, 0xdb, 0xbc, 0xfa, 0xde, 0x97, 0x47, 0x45, 0x7b, 0xb7, + 0x51, 0x43, 0xd9, 0xf7, 0xd7, 0xd0, 0x53, 0x53, 0x39, 0x2a, 0x90, 0x0b, 0x72, 0x8e, 0x0c, 0x08, + 0x35, 0x96, 0xc7, 0x89, 0xaf, 0xd9, 0xbf, 0x61, 0xe8, 0xab, 0xe7, 0x12, 0x2c, 0xdf, 0xa0, 0xb3, + 0xa6, 0xc6, 0x70, 0x99, 0xd6, 0xc4, 0x11, 0x06, 0xea, 0x5c, 0x9e, 0x1a, 0x42, 0xe3, 0x2c, 0x53, + 0x4d, 0xb7, 0x05, 0x91, 0x21, 0x03, 0x47, 0xf9, 0x10, 0xfb, 0x58, 0xaf, 0x7c, 0x62, 0x03, 0xcf, + 0x94, 0x92, 0x33, 0x74, 0x81, 0xd0, 0xbc, 0xad, 0xe9, 0xd6, 0x56, 0xb1, 0x82, 0x61, 0xde, 0x2c, + 0x29, 0xac, 0x6d, 0x55, 0x59, 0xcf, 0xb5, 0x21, 0xb6, 0x64, 0xe0, 0x58, 0x9d, 0xc9, 0x79, 0x62, + 0x4c, 0xf1, 0x8a, 0x38, 0xda, 0x02, 0x23, 0x19, 0x00, 0xf5, 0x42, 0xaa, 0x40, 0x95, 0x4f, 0xa1, + 0xc8, 0x5f, 0xae, 0x30, 0x55, 0x99, 0x9f, 0xa8, 0x97, 0xf2, 0x6c, 0x85, 0xd6, 0x91, 0xa9, 0xcb, + 0x40, 0x85, 0x67, 0x63, 0xa3, 0xf5, 0x0c, 0xa3, 0xac, 0x1c, 0x97, 0x3e, 0xe4, 0x29, 0xa9, 0x40, + 0x4e, 0x7c, 0x8a, 0xb5, 0x5f, 0xd5, 0x01, 0xf9, 0x92, 0x60, 0xac, 0x4e, 0xe5, 0x34, 0xb1, 0x5d, + 0x97, 0x8e, 0xb2, 0x0d, 0x32, 0x30, 0x51, 0x13, 0x79, 0x62, 0x39, 0x52, 0x60, 0x74, 0x30, 0x55, + 0x73, 0x39, 0x4e, 0x8c, 0x37, 0x68, 0x1d, 0x2e, 0x1d, 0xc1, 0x2c, 0x1b, 0x32, 0x18, 0xb1, 0x76, + 0xbe, 0xaa, 0x60, 0xbe, 0x7c, 0xff, 0xb8, 0xd7, 0xbd, 0x1f, 0x7b, 0xdd, 0x3b, 0xec, 0xb5, 0xf8, + 0xbd, 0xd7, 0xe2, 0x4b, 0xa7, 0xc5, 0xb7, 0x4e, 0x8b, 0x87, 0x4e, 0x8b, 0xc7, 0x4e, 0x8b, 0x9f, + 0x9d, 0x16, 0xbf, 0x3a, 0xdd, 0x3b, 0x64, 0xfe, 0xa4, 0xc5, 0xc3, 0x93, 0x16, 0x72, 0xd6, 0xb4, + 0x9f, 0x16, 0xff, 0xf3, 0x5f, 0x8e, 0x72, 0xf8, 0x65, 0xae, 0xa5, 0x14, 0xef, 0x06, 0xbb, 0x6d, + 0xf3, 0xb5, 0x3f, 0x08, 0x65, 0xf1, 0x61, 0xf8, 0xb7, 0xaa, 0xd7, 0x7f, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x03, 0xd4, 0x27, 0xff, 0xc3, 0x01, 0x00, 0x00, +} + +func (x Code) String() string { + s, ok := Code_name[int32(x)] + if ok { + return s + } + return strconv.Itoa(int(x)) +} diff --git a/vendor/github.com/gogo/googleapis/google/rpc/code.proto b/vendor/github.com/gogo/googleapis/google/rpc/code.proto new file mode 100644 index 0000000000..0540a4f6c5 --- /dev/null +++ b/vendor/github.com/gogo/googleapis/google/rpc/code.proto @@ -0,0 +1,185 @@ +// Copyright 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.rpc; + +option go_package = "rpc"; +option java_multiple_files = true; +option java_outer_classname = "CodeProto"; +option java_package = "com.google.rpc"; +option objc_class_prefix = "RPC"; + +// The canonical error codes for Google APIs. +// +// +// Sometimes multiple error codes may apply. Services should return +// the most specific error code that applies. For example, prefer +// `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. +// Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. +enum Code { + // Not an error; returned on success + // + // HTTP Mapping: 200 OK + OK = 0; + + // The operation was cancelled, typically by the caller. + // + // HTTP Mapping: 499 Client Closed Request + CANCELLED = 1; + + // Unknown error. For example, this error may be returned when + // a `Status` value received from another address space belongs to + // an error space that is not known in this address space. Also + // errors raised by APIs that do not return enough error information + // may be converted to this error. + // + // HTTP Mapping: 500 Internal Server Error + UNKNOWN = 2; + + // The client specified an invalid argument. Note that this differs + // from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments + // that are problematic regardless of the state of the system + // (e.g., a malformed file name). + // + // HTTP Mapping: 400 Bad Request + INVALID_ARGUMENT = 3; + + // The deadline expired before the operation could complete. For operations + // that change the state of the system, this error may be returned + // even if the operation has completed successfully. For example, a + // successful response from a server could have been delayed long + // enough for the deadline to expire. + // + // HTTP Mapping: 504 Gateway Timeout + DEADLINE_EXCEEDED = 4; + + // Some requested entity (e.g., file or directory) was not found. + // + // Note to server developers: if a request is denied for an entire class + // of users, such as gradual feature rollout or undocumented whitelist, + // `NOT_FOUND` may be used. If a request is denied for some users within + // a class of users, such as user-based access control, `PERMISSION_DENIED` + // must be used. + // + // HTTP Mapping: 404 Not Found + NOT_FOUND = 5; + + // The entity that a client attempted to create (e.g., file or directory) + // already exists. + // + // HTTP Mapping: 409 Conflict + ALREADY_EXISTS = 6; + + // The caller does not have permission to execute the specified + // operation. `PERMISSION_DENIED` must not be used for rejections + // caused by exhausting some resource (use `RESOURCE_EXHAUSTED` + // instead for those errors). `PERMISSION_DENIED` must not be + // used if the caller can not be identified (use `UNAUTHENTICATED` + // instead for those errors). This error code does not imply the + // request is valid or the requested entity exists or satisfies + // other pre-conditions. + // + // HTTP Mapping: 403 Forbidden + PERMISSION_DENIED = 7; + + // The request does not have valid authentication credentials for the + // operation. + // + // HTTP Mapping: 401 Unauthorized + UNAUTHENTICATED = 16; + + // Some resource has been exhausted, perhaps a per-user quota, or + // perhaps the entire file system is out of space. + // + // HTTP Mapping: 429 Too Many Requests + RESOURCE_EXHAUSTED = 8; + + // The operation was rejected because the system is not in a state + // required for the operation's execution. For example, the directory + // to be deleted is non-empty, an rmdir operation is applied to + // a non-directory, etc. + // + // Service implementors can use the following guidelines to decide + // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: + // (a) Use `UNAVAILABLE` if the client can retry just the failing call. + // (b) Use `ABORTED` if the client should retry at a higher level + // (e.g., when a client-specified test-and-set fails, indicating the + // client should restart a read-modify-write sequence). + // (c) Use `FAILED_PRECONDITION` if the client should not retry until + // the system state has been explicitly fixed. E.g., if an "rmdir" + // fails because the directory is non-empty, `FAILED_PRECONDITION` + // should be returned since the client should not retry unless + // the files are deleted from the directory. + // + // HTTP Mapping: 400 Bad Request + FAILED_PRECONDITION = 9; + + // The operation was aborted, typically due to a concurrency issue such as + // a sequencer check failure or transaction abort. + // + // See the guidelines above for deciding between `FAILED_PRECONDITION`, + // `ABORTED`, and `UNAVAILABLE`. + // + // HTTP Mapping: 409 Conflict + ABORTED = 10; + + // The operation was attempted past the valid range. E.g., seeking or + // reading past end-of-file. + // + // Unlike `INVALID_ARGUMENT`, this error indicates a problem that may + // be fixed if the system state changes. For example, a 32-bit file + // system will generate `INVALID_ARGUMENT` if asked to read at an + // offset that is not in the range [0,2^32-1], but it will generate + // `OUT_OF_RANGE` if asked to read from an offset past the current + // file size. + // + // There is a fair bit of overlap between `FAILED_PRECONDITION` and + // `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific + // error) when it applies so that callers who are iterating through + // a space can easily look for an `OUT_OF_RANGE` error to detect when + // they are done. + // + // HTTP Mapping: 400 Bad Request + OUT_OF_RANGE = 11; + + // The operation is not implemented or is not supported/enabled in this + // service. + // + // HTTP Mapping: 501 Not Implemented + UNIMPLEMENTED = 12; + + // Internal errors. This means that some invariants expected by the + // underlying system have been broken. This error code is reserved + // for serious errors. + // + // HTTP Mapping: 500 Internal Server Error + INTERNAL = 13; + + // The service is currently unavailable. This is most likely a + // transient condition, which can be corrected by retrying with + // a backoff. + // + // See the guidelines above for deciding between `FAILED_PRECONDITION`, + // `ABORTED`, and `UNAVAILABLE`. + // + // HTTP Mapping: 503 Service Unavailable + UNAVAILABLE = 14; + + // Unrecoverable data loss or corruption. + // + // HTTP Mapping: 500 Internal Server Error + DATA_LOSS = 15; +} diff --git a/vendor/github.com/gogo/googleapis/google/rpc/error_details.pb.go b/vendor/github.com/gogo/googleapis/google/rpc/error_details.pb.go new file mode 100644 index 0000000000..657f1dac14 --- /dev/null +++ b/vendor/github.com/gogo/googleapis/google/rpc/error_details.pb.go @@ -0,0 +1,4814 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: google/rpc/error_details.proto + +package rpc + +import ( + bytes "bytes" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + io "io" + math "math" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +// Describes when the clients can retry a failed request. Clients could ignore +// the recommendation here or retry when this information is missing from error +// responses. +// +// It's always recommended that clients should use exponential backoff when +// retrying. +// +// Clients should wait until `retry_delay` amount of time has passed since +// receiving the error response before retrying. If retrying requests also +// fail, clients should use an exponential backoff scheme to gradually increase +// the delay between retries based on `retry_delay`, until either a maximum +// number of retires have been reached or a maximum retry delay cap has been +// reached. +type RetryInfo struct { + // Clients should wait at least this long between retrying the same request. + RetryDelay *types.Duration `protobuf:"bytes,1,opt,name=retry_delay,json=retryDelay,proto3" json:"retry_delay,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RetryInfo) Reset() { *m = RetryInfo{} } +func (*RetryInfo) ProtoMessage() {} +func (*RetryInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_851816e4d6b6361a, []int{0} +} +func (m *RetryInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RetryInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RetryInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RetryInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_RetryInfo.Merge(m, src) +} +func (m *RetryInfo) XXX_Size() int { + return m.Size() +} +func (m *RetryInfo) XXX_DiscardUnknown() { + xxx_messageInfo_RetryInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_RetryInfo proto.InternalMessageInfo + +func (m *RetryInfo) GetRetryDelay() *types.Duration { + if m != nil { + return m.RetryDelay + } + return nil +} + +func (*RetryInfo) XXX_MessageName() string { + return "google.rpc.RetryInfo" +} + +// Describes additional debugging info. +type DebugInfo struct { + // The stack trace entries indicating where the error occurred. + StackEntries []string `protobuf:"bytes,1,rep,name=stack_entries,json=stackEntries,proto3" json:"stack_entries,omitempty"` + // Additional debugging information provided by the server. + Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DebugInfo) Reset() { *m = DebugInfo{} } +func (*DebugInfo) ProtoMessage() {} +func (*DebugInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_851816e4d6b6361a, []int{1} +} +func (m *DebugInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DebugInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DebugInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DebugInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_DebugInfo.Merge(m, src) +} +func (m *DebugInfo) XXX_Size() int { + return m.Size() +} +func (m *DebugInfo) XXX_DiscardUnknown() { + xxx_messageInfo_DebugInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_DebugInfo proto.InternalMessageInfo + +func (m *DebugInfo) GetStackEntries() []string { + if m != nil { + return m.StackEntries + } + return nil +} + +func (m *DebugInfo) GetDetail() string { + if m != nil { + return m.Detail + } + return "" +} + +func (*DebugInfo) XXX_MessageName() string { + return "google.rpc.DebugInfo" +} + +// Describes how a quota check failed. +// +// For example if a daily limit was exceeded for the calling project, +// a service could respond with a QuotaFailure detail containing the project +// id and the description of the quota limit that was exceeded. If the +// calling project hasn't enabled the service in the developer console, then +// a service could respond with the project id and set `service_disabled` +// to true. +// +// Also see RetryDetail and Help types for other details about handling a +// quota failure. +type QuotaFailure struct { + // Describes all quota violations. + Violations []*QuotaFailure_Violation `protobuf:"bytes,1,rep,name=violations,proto3" json:"violations,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *QuotaFailure) Reset() { *m = QuotaFailure{} } +func (*QuotaFailure) ProtoMessage() {} +func (*QuotaFailure) Descriptor() ([]byte, []int) { + return fileDescriptor_851816e4d6b6361a, []int{2} +} +func (m *QuotaFailure) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuotaFailure) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuotaFailure.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuotaFailure) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuotaFailure.Merge(m, src) +} +func (m *QuotaFailure) XXX_Size() int { + return m.Size() +} +func (m *QuotaFailure) XXX_DiscardUnknown() { + xxx_messageInfo_QuotaFailure.DiscardUnknown(m) +} + +var xxx_messageInfo_QuotaFailure proto.InternalMessageInfo + +func (m *QuotaFailure) GetViolations() []*QuotaFailure_Violation { + if m != nil { + return m.Violations + } + return nil +} + +func (*QuotaFailure) XXX_MessageName() string { + return "google.rpc.QuotaFailure" +} + +// A message type used to describe a single quota violation. For example, a +// daily quota or a custom quota that was exceeded. +type QuotaFailure_Violation struct { + // The subject on which the quota check failed. + // For example, "clientip:" or "project:". + Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` + // A description of how the quota check failed. Clients can use this + // description to find more about the quota configuration in the service's + // public documentation, or find the relevant quota limit to adjust through + // developer console. + // + // For example: "Service disabled" or "Daily Limit for read operations + // exceeded". + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *QuotaFailure_Violation) Reset() { *m = QuotaFailure_Violation{} } +func (*QuotaFailure_Violation) ProtoMessage() {} +func (*QuotaFailure_Violation) Descriptor() ([]byte, []int) { + return fileDescriptor_851816e4d6b6361a, []int{2, 0} +} +func (m *QuotaFailure_Violation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuotaFailure_Violation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuotaFailure_Violation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuotaFailure_Violation) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuotaFailure_Violation.Merge(m, src) +} +func (m *QuotaFailure_Violation) XXX_Size() int { + return m.Size() +} +func (m *QuotaFailure_Violation) XXX_DiscardUnknown() { + xxx_messageInfo_QuotaFailure_Violation.DiscardUnknown(m) +} + +var xxx_messageInfo_QuotaFailure_Violation proto.InternalMessageInfo + +func (m *QuotaFailure_Violation) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *QuotaFailure_Violation) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (*QuotaFailure_Violation) XXX_MessageName() string { + return "google.rpc.QuotaFailure.Violation" +} + +// Describes what preconditions have failed. +// +// For example, if an RPC failed because it required the Terms of Service to be +// acknowledged, it could list the terms of service violation in the +// PreconditionFailure message. +type PreconditionFailure struct { + // Describes all precondition violations. + Violations []*PreconditionFailure_Violation `protobuf:"bytes,1,rep,name=violations,proto3" json:"violations,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PreconditionFailure) Reset() { *m = PreconditionFailure{} } +func (*PreconditionFailure) ProtoMessage() {} +func (*PreconditionFailure) Descriptor() ([]byte, []int) { + return fileDescriptor_851816e4d6b6361a, []int{3} +} +func (m *PreconditionFailure) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PreconditionFailure) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PreconditionFailure.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PreconditionFailure) XXX_Merge(src proto.Message) { + xxx_messageInfo_PreconditionFailure.Merge(m, src) +} +func (m *PreconditionFailure) XXX_Size() int { + return m.Size() +} +func (m *PreconditionFailure) XXX_DiscardUnknown() { + xxx_messageInfo_PreconditionFailure.DiscardUnknown(m) +} + +var xxx_messageInfo_PreconditionFailure proto.InternalMessageInfo + +func (m *PreconditionFailure) GetViolations() []*PreconditionFailure_Violation { + if m != nil { + return m.Violations + } + return nil +} + +func (*PreconditionFailure) XXX_MessageName() string { + return "google.rpc.PreconditionFailure" +} + +// A message type used to describe a single precondition failure. +type PreconditionFailure_Violation struct { + // The type of PreconditionFailure. We recommend using a service-specific + // enum type to define the supported precondition violation types. For + // example, "TOS" for "Terms of Service violation". + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // The subject, relative to the type, that failed. + // For example, "google.com/cloud" relative to the "TOS" type would + // indicate which terms of service is being referenced. + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` + // A description of how the precondition failed. Developers can use this + // description to understand how to fix the failure. + // + // For example: "Terms of service not accepted". + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PreconditionFailure_Violation) Reset() { *m = PreconditionFailure_Violation{} } +func (*PreconditionFailure_Violation) ProtoMessage() {} +func (*PreconditionFailure_Violation) Descriptor() ([]byte, []int) { + return fileDescriptor_851816e4d6b6361a, []int{3, 0} +} +func (m *PreconditionFailure_Violation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PreconditionFailure_Violation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PreconditionFailure_Violation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PreconditionFailure_Violation) XXX_Merge(src proto.Message) { + xxx_messageInfo_PreconditionFailure_Violation.Merge(m, src) +} +func (m *PreconditionFailure_Violation) XXX_Size() int { + return m.Size() +} +func (m *PreconditionFailure_Violation) XXX_DiscardUnknown() { + xxx_messageInfo_PreconditionFailure_Violation.DiscardUnknown(m) +} + +var xxx_messageInfo_PreconditionFailure_Violation proto.InternalMessageInfo + +func (m *PreconditionFailure_Violation) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *PreconditionFailure_Violation) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *PreconditionFailure_Violation) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (*PreconditionFailure_Violation) XXX_MessageName() string { + return "google.rpc.PreconditionFailure.Violation" +} + +// Describes violations in a client request. This error type focuses on the +// syntactic aspects of the request. +type BadRequest struct { + // Describes all violations in a client request. + FieldViolations []*BadRequest_FieldViolation `protobuf:"bytes,1,rep,name=field_violations,json=fieldViolations,proto3" json:"field_violations,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BadRequest) Reset() { *m = BadRequest{} } +func (*BadRequest) ProtoMessage() {} +func (*BadRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_851816e4d6b6361a, []int{4} +} +func (m *BadRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BadRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BadRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_BadRequest.Merge(m, src) +} +func (m *BadRequest) XXX_Size() int { + return m.Size() +} +func (m *BadRequest) XXX_DiscardUnknown() { + xxx_messageInfo_BadRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_BadRequest proto.InternalMessageInfo + +func (m *BadRequest) GetFieldViolations() []*BadRequest_FieldViolation { + if m != nil { + return m.FieldViolations + } + return nil +} + +func (*BadRequest) XXX_MessageName() string { + return "google.rpc.BadRequest" +} + +// A message type used to describe a single bad request field. +type BadRequest_FieldViolation struct { + // A path leading to a field in the request body. The value will be a + // sequence of dot-separated identifiers that identify a protocol buffer + // field. E.g., "field_violations.field" would identify this field. + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` + // A description of why the request element is bad. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BadRequest_FieldViolation) Reset() { *m = BadRequest_FieldViolation{} } +func (*BadRequest_FieldViolation) ProtoMessage() {} +func (*BadRequest_FieldViolation) Descriptor() ([]byte, []int) { + return fileDescriptor_851816e4d6b6361a, []int{4, 0} +} +func (m *BadRequest_FieldViolation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BadRequest_FieldViolation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BadRequest_FieldViolation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BadRequest_FieldViolation) XXX_Merge(src proto.Message) { + xxx_messageInfo_BadRequest_FieldViolation.Merge(m, src) +} +func (m *BadRequest_FieldViolation) XXX_Size() int { + return m.Size() +} +func (m *BadRequest_FieldViolation) XXX_DiscardUnknown() { + xxx_messageInfo_BadRequest_FieldViolation.DiscardUnknown(m) +} + +var xxx_messageInfo_BadRequest_FieldViolation proto.InternalMessageInfo + +func (m *BadRequest_FieldViolation) GetField() string { + if m != nil { + return m.Field + } + return "" +} + +func (m *BadRequest_FieldViolation) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (*BadRequest_FieldViolation) XXX_MessageName() string { + return "google.rpc.BadRequest.FieldViolation" +} + +// Contains metadata about the request that clients can attach when filing a bug +// or providing other forms of feedback. +type RequestInfo struct { + // An opaque string that should only be interpreted by the service generating + // it. For example, it can be used to identify requests in the service's logs. + RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` + // Any data that was used to serve this request. For example, an encrypted + // stack trace that can be sent back to the service provider for debugging. + ServingData string `protobuf:"bytes,2,opt,name=serving_data,json=servingData,proto3" json:"serving_data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RequestInfo) Reset() { *m = RequestInfo{} } +func (*RequestInfo) ProtoMessage() {} +func (*RequestInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_851816e4d6b6361a, []int{5} +} +func (m *RequestInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RequestInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RequestInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RequestInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestInfo.Merge(m, src) +} +func (m *RequestInfo) XXX_Size() int { + return m.Size() +} +func (m *RequestInfo) XXX_DiscardUnknown() { + xxx_messageInfo_RequestInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestInfo proto.InternalMessageInfo + +func (m *RequestInfo) GetRequestId() string { + if m != nil { + return m.RequestId + } + return "" +} + +func (m *RequestInfo) GetServingData() string { + if m != nil { + return m.ServingData + } + return "" +} + +func (*RequestInfo) XXX_MessageName() string { + return "google.rpc.RequestInfo" +} + +// Describes the resource that is being accessed. +type ResourceInfo struct { + // A name for the type of resource being accessed, e.g. "sql table", + // "cloud storage bucket", "file", "Google calendar"; or the type URL + // of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". + ResourceType string `protobuf:"bytes,1,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` + // The name of the resource being accessed. For example, a shared calendar + // name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current + // error is + // [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. + ResourceName string `protobuf:"bytes,2,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` + // The owner of the resource (optional). + // For example, "user:" or "project:". + Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` + // Describes what error is encountered when accessing this resource. + // For example, updating a cloud project may require the `writer` permission + // on the developer console project. + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ResourceInfo) Reset() { *m = ResourceInfo{} } +func (*ResourceInfo) ProtoMessage() {} +func (*ResourceInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_851816e4d6b6361a, []int{6} +} +func (m *ResourceInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResourceInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ResourceInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceInfo.Merge(m, src) +} +func (m *ResourceInfo) XXX_Size() int { + return m.Size() +} +func (m *ResourceInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourceInfo proto.InternalMessageInfo + +func (m *ResourceInfo) GetResourceType() string { + if m != nil { + return m.ResourceType + } + return "" +} + +func (m *ResourceInfo) GetResourceName() string { + if m != nil { + return m.ResourceName + } + return "" +} + +func (m *ResourceInfo) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *ResourceInfo) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (*ResourceInfo) XXX_MessageName() string { + return "google.rpc.ResourceInfo" +} + +// Provides links to documentation or for performing an out of band action. +// +// For example, if a quota check failed with an error indicating the calling +// project hasn't enabled the accessed service, this can contain a URL pointing +// directly to the right place in the developer console to flip the bit. +type Help struct { + // URL(s) pointing to additional information on handling the current error. + Links []*Help_Link `protobuf:"bytes,1,rep,name=links,proto3" json:"links,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Help) Reset() { *m = Help{} } +func (*Help) ProtoMessage() {} +func (*Help) Descriptor() ([]byte, []int) { + return fileDescriptor_851816e4d6b6361a, []int{7} +} +func (m *Help) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Help) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Help.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Help) XXX_Merge(src proto.Message) { + xxx_messageInfo_Help.Merge(m, src) +} +func (m *Help) XXX_Size() int { + return m.Size() +} +func (m *Help) XXX_DiscardUnknown() { + xxx_messageInfo_Help.DiscardUnknown(m) +} + +var xxx_messageInfo_Help proto.InternalMessageInfo + +func (m *Help) GetLinks() []*Help_Link { + if m != nil { + return m.Links + } + return nil +} + +func (*Help) XXX_MessageName() string { + return "google.rpc.Help" +} + +// Describes a URL link. +type Help_Link struct { + // Describes what the link offers. + Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` + // The URL of the link. + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Help_Link) Reset() { *m = Help_Link{} } +func (*Help_Link) ProtoMessage() {} +func (*Help_Link) Descriptor() ([]byte, []int) { + return fileDescriptor_851816e4d6b6361a, []int{7, 0} +} +func (m *Help_Link) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Help_Link) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Help_Link.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Help_Link) XXX_Merge(src proto.Message) { + xxx_messageInfo_Help_Link.Merge(m, src) +} +func (m *Help_Link) XXX_Size() int { + return m.Size() +} +func (m *Help_Link) XXX_DiscardUnknown() { + xxx_messageInfo_Help_Link.DiscardUnknown(m) +} + +var xxx_messageInfo_Help_Link proto.InternalMessageInfo + +func (m *Help_Link) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Help_Link) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (*Help_Link) XXX_MessageName() string { + return "google.rpc.Help.Link" +} + +// Provides a localized error message that is safe to return to the user +// which can be attached to an RPC error. +type LocalizedMessage struct { + // The locale used following the specification defined at + // http://www.rfc-editor.org/rfc/bcp/bcp47.txt. + // Examples are: "en-US", "fr-CH", "es-MX" + Locale string `protobuf:"bytes,1,opt,name=locale,proto3" json:"locale,omitempty"` + // The localized error message in the above locale. + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LocalizedMessage) Reset() { *m = LocalizedMessage{} } +func (*LocalizedMessage) ProtoMessage() {} +func (*LocalizedMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_851816e4d6b6361a, []int{8} +} +func (m *LocalizedMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LocalizedMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LocalizedMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LocalizedMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalizedMessage.Merge(m, src) +} +func (m *LocalizedMessage) XXX_Size() int { + return m.Size() +} +func (m *LocalizedMessage) XXX_DiscardUnknown() { + xxx_messageInfo_LocalizedMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_LocalizedMessage proto.InternalMessageInfo + +func (m *LocalizedMessage) GetLocale() string { + if m != nil { + return m.Locale + } + return "" +} + +func (m *LocalizedMessage) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (*LocalizedMessage) XXX_MessageName() string { + return "google.rpc.LocalizedMessage" +} +func init() { + proto.RegisterType((*RetryInfo)(nil), "google.rpc.RetryInfo") + proto.RegisterType((*DebugInfo)(nil), "google.rpc.DebugInfo") + proto.RegisterType((*QuotaFailure)(nil), "google.rpc.QuotaFailure") + proto.RegisterType((*QuotaFailure_Violation)(nil), "google.rpc.QuotaFailure.Violation") + proto.RegisterType((*PreconditionFailure)(nil), "google.rpc.PreconditionFailure") + proto.RegisterType((*PreconditionFailure_Violation)(nil), "google.rpc.PreconditionFailure.Violation") + proto.RegisterType((*BadRequest)(nil), "google.rpc.BadRequest") + proto.RegisterType((*BadRequest_FieldViolation)(nil), "google.rpc.BadRequest.FieldViolation") + proto.RegisterType((*RequestInfo)(nil), "google.rpc.RequestInfo") + proto.RegisterType((*ResourceInfo)(nil), "google.rpc.ResourceInfo") + proto.RegisterType((*Help)(nil), "google.rpc.Help") + proto.RegisterType((*Help_Link)(nil), "google.rpc.Help.Link") + proto.RegisterType((*LocalizedMessage)(nil), "google.rpc.LocalizedMessage") +} + +func init() { proto.RegisterFile("google/rpc/error_details.proto", fileDescriptor_851816e4d6b6361a) } + +var fileDescriptor_851816e4d6b6361a = []byte{ + // 624 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xbf, 0x6f, 0xd3, 0x40, + 0x18, 0xed, 0x35, 0x69, 0x91, 0xbf, 0x84, 0x52, 0xcc, 0x0f, 0x85, 0x48, 0x9c, 0x82, 0x11, 0x52, + 0x11, 0x92, 0x2b, 0x95, 0xad, 0x63, 0x48, 0x7f, 0x49, 0x05, 0x82, 0x85, 0x18, 0x60, 0xb0, 0x2e, + 0xf6, 0x97, 0xe8, 0xa8, 0xe3, 0x33, 0x67, 0xbb, 0xa8, 0x4c, 0xfc, 0x09, 0xec, 0x6c, 0x4c, 0xfd, + 0x27, 0xd8, 0x3b, 0x76, 0x64, 0x24, 0xe9, 0xc2, 0xd8, 0x91, 0x11, 0x9d, 0x7d, 0xd7, 0xba, 0x4d, + 0x41, 0x6c, 0x7e, 0xef, 0xde, 0x3d, 0xbf, 0xf7, 0xe9, 0xee, 0x80, 0x8e, 0x84, 0x18, 0x45, 0xb8, + 0x2a, 0x93, 0x60, 0x15, 0xa5, 0x14, 0xd2, 0x0f, 0x31, 0x63, 0x3c, 0x4a, 0xdd, 0x44, 0x8a, 0x4c, + 0xd8, 0x50, 0xae, 0xbb, 0x32, 0x09, 0xda, 0x46, 0x5b, 0xac, 0x0c, 0xf2, 0xe1, 0x6a, 0x98, 0x4b, + 0x96, 0x71, 0x11, 0x97, 0x5a, 0x67, 0x0b, 0x2c, 0x0f, 0x33, 0x79, 0xb0, 0x13, 0x0f, 0x85, 0xbd, + 0x0e, 0x0d, 0xa9, 0x80, 0x1f, 0x62, 0xc4, 0x0e, 0x5a, 0xa4, 0x43, 0x56, 0x1a, 0x6b, 0xf7, 0x5c, + 0x6d, 0x67, 0x2c, 0xdc, 0x9e, 0xb6, 0xf0, 0xa0, 0x50, 0xf7, 0x94, 0xd8, 0xd9, 0x06, 0xab, 0x87, + 0x83, 0x7c, 0x54, 0x18, 0x3d, 0x84, 0xeb, 0x69, 0xc6, 0x82, 0x3d, 0x1f, 0xe3, 0x4c, 0x72, 0x4c, + 0x5b, 0xa4, 0x53, 0x5b, 0xb1, 0xbc, 0x66, 0x41, 0x6e, 0x94, 0x9c, 0x7d, 0x17, 0x16, 0xcb, 0xdc, + 0xad, 0xf9, 0x0e, 0x59, 0xb1, 0x3c, 0x8d, 0x9c, 0xaf, 0x04, 0x9a, 0xaf, 0x72, 0x91, 0xb1, 0x4d, + 0xc6, 0xa3, 0x5c, 0xa2, 0xdd, 0x05, 0xd8, 0xe7, 0x22, 0x2a, 0xfe, 0x59, 0x5a, 0x35, 0xd6, 0x1c, + 0xf7, 0xbc, 0xa4, 0x5b, 0x55, 0xbb, 0x6f, 0x8c, 0xd4, 0xab, 0xec, 0x6a, 0x6f, 0x81, 0x75, 0xb6, + 0x60, 0xb7, 0xe0, 0x5a, 0x9a, 0x0f, 0xde, 0x63, 0x90, 0x15, 0x1d, 0x2d, 0xcf, 0x40, 0xbb, 0x03, + 0x8d, 0x10, 0xd3, 0x40, 0xf2, 0x44, 0x09, 0x75, 0xb0, 0x2a, 0xe5, 0x7c, 0x27, 0x70, 0xab, 0x2f, + 0x31, 0x10, 0x71, 0xc8, 0x15, 0x61, 0x42, 0xee, 0x5c, 0x11, 0xf2, 0x71, 0x35, 0xe4, 0x15, 0x9b, + 0xfe, 0x92, 0xf5, 0x5d, 0x35, 0xab, 0x0d, 0xf5, 0xec, 0x20, 0x41, 0x1d, 0xb4, 0xf8, 0xae, 0xe6, + 0x9f, 0xff, 0x67, 0xfe, 0xda, 0x6c, 0xfe, 0x43, 0x02, 0xd0, 0x65, 0xa1, 0x87, 0x1f, 0x72, 0x4c, + 0x33, 0xbb, 0x0f, 0xcb, 0x43, 0x8e, 0x51, 0xe8, 0xcf, 0x84, 0x7f, 0x54, 0x0d, 0x7f, 0xbe, 0xc3, + 0xdd, 0x54, 0xf2, 0xf3, 0xe0, 0x37, 0x86, 0x17, 0x70, 0xda, 0xde, 0x86, 0xa5, 0x8b, 0x12, 0xfb, + 0x36, 0x2c, 0x14, 0x22, 0xdd, 0xa1, 0x04, 0xff, 0x31, 0xea, 0x97, 0xd0, 0xd0, 0x3f, 0x2d, 0x0e, + 0xd5, 0x7d, 0x00, 0x59, 0x42, 0x9f, 0x1b, 0x2f, 0x4b, 0x33, 0x3b, 0xa1, 0xfd, 0x00, 0x9a, 0x29, + 0xca, 0x7d, 0x1e, 0x8f, 0xfc, 0x90, 0x65, 0xcc, 0x18, 0x6a, 0xae, 0xc7, 0x32, 0xe6, 0x7c, 0x21, + 0xd0, 0xf4, 0x30, 0x15, 0xb9, 0x0c, 0xd0, 0x9c, 0x53, 0xa9, 0xb1, 0x5f, 0x99, 0x72, 0xd3, 0x90, + 0xaf, 0xd5, 0xb4, 0xab, 0xa2, 0x98, 0x8d, 0x51, 0x3b, 0x9f, 0x89, 0x5e, 0xb0, 0x31, 0xaa, 0x8e, + 0xe2, 0x63, 0x8c, 0x52, 0x8f, 0xbc, 0x04, 0x97, 0x3b, 0xd6, 0x67, 0x3b, 0x0a, 0xa8, 0x6f, 0x63, + 0x94, 0xd8, 0x4f, 0x60, 0x21, 0xe2, 0xf1, 0x9e, 0x19, 0xfe, 0x9d, 0xea, 0xf0, 0x95, 0xc0, 0xdd, + 0xe5, 0xf1, 0x9e, 0x57, 0x6a, 0xda, 0xeb, 0x50, 0x57, 0xf0, 0xb2, 0x3d, 0x99, 0xb1, 0xb7, 0x97, + 0xa1, 0x96, 0x4b, 0x73, 0xc1, 0xd4, 0xa7, 0xd3, 0x83, 0xe5, 0x5d, 0x11, 0xb0, 0x88, 0x7f, 0xc2, + 0xf0, 0x39, 0xa6, 0x29, 0x1b, 0xa1, 0xba, 0x89, 0x91, 0xe2, 0x4c, 0x7f, 0x8d, 0xd4, 0x39, 0x1b, + 0x97, 0x12, 0x73, 0xce, 0x34, 0xec, 0x86, 0xc7, 0x13, 0x3a, 0xf7, 0x63, 0x42, 0xe7, 0x4e, 0x27, + 0x94, 0xfc, 0x9e, 0x50, 0xf2, 0x79, 0x4a, 0xc9, 0xe1, 0x94, 0x92, 0xa3, 0x29, 0x25, 0xc7, 0x53, + 0x4a, 0x7e, 0x4e, 0x29, 0xf9, 0x35, 0xa5, 0x73, 0xa7, 0x8a, 0x3f, 0xa1, 0xe4, 0xe8, 0x84, 0x12, + 0x58, 0x0a, 0xc4, 0xb8, 0x52, 0xac, 0x7b, 0x73, 0x43, 0xbd, 0x5e, 0xbd, 0xf2, 0xf1, 0xea, 0xab, + 0xe7, 0xa5, 0x4f, 0xde, 0xd6, 0x64, 0x12, 0x7c, 0x9b, 0xaf, 0x79, 0xfd, 0x67, 0x83, 0xc5, 0xe2, + 0xc9, 0x79, 0xfa, 0x27, 0x00, 0x00, 0xff, 0xff, 0x63, 0xe4, 0x76, 0x26, 0xf1, 0x04, 0x00, 0x00, +} + +func (this *RetryInfo) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*RetryInfo) + if !ok { + that2, ok := that.(RetryInfo) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if c := this.RetryDelay.Compare(that1.RetryDelay); c != 0 { + return c + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *DebugInfo) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*DebugInfo) + if !ok { + that2, ok := that.(DebugInfo) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if len(this.StackEntries) != len(that1.StackEntries) { + if len(this.StackEntries) < len(that1.StackEntries) { + return -1 + } + return 1 + } + for i := range this.StackEntries { + if this.StackEntries[i] != that1.StackEntries[i] { + if this.StackEntries[i] < that1.StackEntries[i] { + return -1 + } + return 1 + } + } + if this.Detail != that1.Detail { + if this.Detail < that1.Detail { + return -1 + } + return 1 + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *QuotaFailure) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*QuotaFailure) + if !ok { + that2, ok := that.(QuotaFailure) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if len(this.Violations) != len(that1.Violations) { + if len(this.Violations) < len(that1.Violations) { + return -1 + } + return 1 + } + for i := range this.Violations { + if c := this.Violations[i].Compare(that1.Violations[i]); c != 0 { + return c + } + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *QuotaFailure_Violation) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*QuotaFailure_Violation) + if !ok { + that2, ok := that.(QuotaFailure_Violation) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if this.Subject != that1.Subject { + if this.Subject < that1.Subject { + return -1 + } + return 1 + } + if this.Description != that1.Description { + if this.Description < that1.Description { + return -1 + } + return 1 + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *PreconditionFailure) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*PreconditionFailure) + if !ok { + that2, ok := that.(PreconditionFailure) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if len(this.Violations) != len(that1.Violations) { + if len(this.Violations) < len(that1.Violations) { + return -1 + } + return 1 + } + for i := range this.Violations { + if c := this.Violations[i].Compare(that1.Violations[i]); c != 0 { + return c + } + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *PreconditionFailure_Violation) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*PreconditionFailure_Violation) + if !ok { + that2, ok := that.(PreconditionFailure_Violation) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if this.Type != that1.Type { + if this.Type < that1.Type { + return -1 + } + return 1 + } + if this.Subject != that1.Subject { + if this.Subject < that1.Subject { + return -1 + } + return 1 + } + if this.Description != that1.Description { + if this.Description < that1.Description { + return -1 + } + return 1 + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *BadRequest) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*BadRequest) + if !ok { + that2, ok := that.(BadRequest) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if len(this.FieldViolations) != len(that1.FieldViolations) { + if len(this.FieldViolations) < len(that1.FieldViolations) { + return -1 + } + return 1 + } + for i := range this.FieldViolations { + if c := this.FieldViolations[i].Compare(that1.FieldViolations[i]); c != 0 { + return c + } + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *BadRequest_FieldViolation) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*BadRequest_FieldViolation) + if !ok { + that2, ok := that.(BadRequest_FieldViolation) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if this.Field != that1.Field { + if this.Field < that1.Field { + return -1 + } + return 1 + } + if this.Description != that1.Description { + if this.Description < that1.Description { + return -1 + } + return 1 + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *RequestInfo) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*RequestInfo) + if !ok { + that2, ok := that.(RequestInfo) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if this.RequestId != that1.RequestId { + if this.RequestId < that1.RequestId { + return -1 + } + return 1 + } + if this.ServingData != that1.ServingData { + if this.ServingData < that1.ServingData { + return -1 + } + return 1 + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *ResourceInfo) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*ResourceInfo) + if !ok { + that2, ok := that.(ResourceInfo) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if this.ResourceType != that1.ResourceType { + if this.ResourceType < that1.ResourceType { + return -1 + } + return 1 + } + if this.ResourceName != that1.ResourceName { + if this.ResourceName < that1.ResourceName { + return -1 + } + return 1 + } + if this.Owner != that1.Owner { + if this.Owner < that1.Owner { + return -1 + } + return 1 + } + if this.Description != that1.Description { + if this.Description < that1.Description { + return -1 + } + return 1 + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *Help) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*Help) + if !ok { + that2, ok := that.(Help) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if len(this.Links) != len(that1.Links) { + if len(this.Links) < len(that1.Links) { + return -1 + } + return 1 + } + for i := range this.Links { + if c := this.Links[i].Compare(that1.Links[i]); c != 0 { + return c + } + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *Help_Link) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*Help_Link) + if !ok { + that2, ok := that.(Help_Link) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if this.Description != that1.Description { + if this.Description < that1.Description { + return -1 + } + return 1 + } + if this.Url != that1.Url { + if this.Url < that1.Url { + return -1 + } + return 1 + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *LocalizedMessage) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*LocalizedMessage) + if !ok { + that2, ok := that.(LocalizedMessage) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if this.Locale != that1.Locale { + if this.Locale < that1.Locale { + return -1 + } + return 1 + } + if this.Message != that1.Message { + if this.Message < that1.Message { + return -1 + } + return 1 + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *RetryInfo) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*RetryInfo) + if !ok { + that2, ok := that.(RetryInfo) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.RetryDelay.Equal(that1.RetryDelay) { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *DebugInfo) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DebugInfo) + if !ok { + that2, ok := that.(DebugInfo) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.StackEntries) != len(that1.StackEntries) { + return false + } + for i := range this.StackEntries { + if this.StackEntries[i] != that1.StackEntries[i] { + return false + } + } + if this.Detail != that1.Detail { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *QuotaFailure) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QuotaFailure) + if !ok { + that2, ok := that.(QuotaFailure) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Violations) != len(that1.Violations) { + return false + } + for i := range this.Violations { + if !this.Violations[i].Equal(that1.Violations[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *QuotaFailure_Violation) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*QuotaFailure_Violation) + if !ok { + that2, ok := that.(QuotaFailure_Violation) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Subject != that1.Subject { + return false + } + if this.Description != that1.Description { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *PreconditionFailure) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PreconditionFailure) + if !ok { + that2, ok := that.(PreconditionFailure) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Violations) != len(that1.Violations) { + return false + } + for i := range this.Violations { + if !this.Violations[i].Equal(that1.Violations[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *PreconditionFailure_Violation) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PreconditionFailure_Violation) + if !ok { + that2, ok := that.(PreconditionFailure_Violation) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Type != that1.Type { + return false + } + if this.Subject != that1.Subject { + return false + } + if this.Description != that1.Description { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *BadRequest) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*BadRequest) + if !ok { + that2, ok := that.(BadRequest) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.FieldViolations) != len(that1.FieldViolations) { + return false + } + for i := range this.FieldViolations { + if !this.FieldViolations[i].Equal(that1.FieldViolations[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *BadRequest_FieldViolation) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*BadRequest_FieldViolation) + if !ok { + that2, ok := that.(BadRequest_FieldViolation) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Field != that1.Field { + return false + } + if this.Description != that1.Description { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *RequestInfo) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*RequestInfo) + if !ok { + that2, ok := that.(RequestInfo) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.RequestId != that1.RequestId { + return false + } + if this.ServingData != that1.ServingData { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *ResourceInfo) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ResourceInfo) + if !ok { + that2, ok := that.(ResourceInfo) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ResourceType != that1.ResourceType { + return false + } + if this.ResourceName != that1.ResourceName { + return false + } + if this.Owner != that1.Owner { + return false + } + if this.Description != that1.Description { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Help) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Help) + if !ok { + that2, ok := that.(Help) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Links) != len(that1.Links) { + return false + } + for i := range this.Links { + if !this.Links[i].Equal(that1.Links[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Help_Link) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Help_Link) + if !ok { + that2, ok := that.(Help_Link) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Description != that1.Description { + return false + } + if this.Url != that1.Url { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *LocalizedMessage) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LocalizedMessage) + if !ok { + that2, ok := that.(LocalizedMessage) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Locale != that1.Locale { + return false + } + if this.Message != that1.Message { + return false + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *RetryInfo) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&rpc.RetryInfo{") + if this.RetryDelay != nil { + s = append(s, "RetryDelay: "+fmt.Sprintf("%#v", this.RetryDelay)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *DebugInfo) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&rpc.DebugInfo{") + s = append(s, "StackEntries: "+fmt.Sprintf("%#v", this.StackEntries)+",\n") + s = append(s, "Detail: "+fmt.Sprintf("%#v", this.Detail)+",\n") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *QuotaFailure) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&rpc.QuotaFailure{") + if this.Violations != nil { + s = append(s, "Violations: "+fmt.Sprintf("%#v", this.Violations)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *QuotaFailure_Violation) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&rpc.QuotaFailure_Violation{") + s = append(s, "Subject: "+fmt.Sprintf("%#v", this.Subject)+",\n") + s = append(s, "Description: "+fmt.Sprintf("%#v", this.Description)+",\n") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *PreconditionFailure) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&rpc.PreconditionFailure{") + if this.Violations != nil { + s = append(s, "Violations: "+fmt.Sprintf("%#v", this.Violations)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *PreconditionFailure_Violation) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&rpc.PreconditionFailure_Violation{") + s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") + s = append(s, "Subject: "+fmt.Sprintf("%#v", this.Subject)+",\n") + s = append(s, "Description: "+fmt.Sprintf("%#v", this.Description)+",\n") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *BadRequest) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&rpc.BadRequest{") + if this.FieldViolations != nil { + s = append(s, "FieldViolations: "+fmt.Sprintf("%#v", this.FieldViolations)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *BadRequest_FieldViolation) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&rpc.BadRequest_FieldViolation{") + s = append(s, "Field: "+fmt.Sprintf("%#v", this.Field)+",\n") + s = append(s, "Description: "+fmt.Sprintf("%#v", this.Description)+",\n") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *RequestInfo) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&rpc.RequestInfo{") + s = append(s, "RequestId: "+fmt.Sprintf("%#v", this.RequestId)+",\n") + s = append(s, "ServingData: "+fmt.Sprintf("%#v", this.ServingData)+",\n") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *ResourceInfo) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 8) + s = append(s, "&rpc.ResourceInfo{") + s = append(s, "ResourceType: "+fmt.Sprintf("%#v", this.ResourceType)+",\n") + s = append(s, "ResourceName: "+fmt.Sprintf("%#v", this.ResourceName)+",\n") + s = append(s, "Owner: "+fmt.Sprintf("%#v", this.Owner)+",\n") + s = append(s, "Description: "+fmt.Sprintf("%#v", this.Description)+",\n") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Help) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&rpc.Help{") + if this.Links != nil { + s = append(s, "Links: "+fmt.Sprintf("%#v", this.Links)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *Help_Link) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&rpc.Help_Link{") + s = append(s, "Description: "+fmt.Sprintf("%#v", this.Description)+",\n") + s = append(s, "Url: "+fmt.Sprintf("%#v", this.Url)+",\n") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *LocalizedMessage) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&rpc.LocalizedMessage{") + s = append(s, "Locale: "+fmt.Sprintf("%#v", this.Locale)+",\n") + s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n") + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringErrorDetails(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *RetryInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RetryInfo) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.RetryDelay != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(m.RetryDelay.Size())) + n1, err := m.RetryDelay.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *DebugInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DebugInfo) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.StackEntries) > 0 { + for _, s := range m.StackEntries { + dAtA[i] = 0xa + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } + if len(m.Detail) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Detail))) + i += copy(dAtA[i:], m.Detail) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *QuotaFailure) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuotaFailure) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Violations) > 0 { + for _, msg := range m.Violations { + dAtA[i] = 0xa + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *QuotaFailure_Violation) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuotaFailure_Violation) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Subject) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Subject))) + i += copy(dAtA[i:], m.Subject) + } + if len(m.Description) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Description))) + i += copy(dAtA[i:], m.Description) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *PreconditionFailure) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PreconditionFailure) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Violations) > 0 { + for _, msg := range m.Violations { + dAtA[i] = 0xa + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *PreconditionFailure_Violation) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PreconditionFailure_Violation) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Type) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Type))) + i += copy(dAtA[i:], m.Type) + } + if len(m.Subject) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Subject))) + i += copy(dAtA[i:], m.Subject) + } + if len(m.Description) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Description))) + i += copy(dAtA[i:], m.Description) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *BadRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BadRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.FieldViolations) > 0 { + for _, msg := range m.FieldViolations { + dAtA[i] = 0xa + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *BadRequest_FieldViolation) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BadRequest_FieldViolation) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Field) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Field))) + i += copy(dAtA[i:], m.Field) + } + if len(m.Description) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Description))) + i += copy(dAtA[i:], m.Description) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *RequestInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RequestInfo) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.RequestId) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.RequestId))) + i += copy(dAtA[i:], m.RequestId) + } + if len(m.ServingData) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.ServingData))) + i += copy(dAtA[i:], m.ServingData) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *ResourceInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResourceInfo) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ResourceType) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.ResourceType))) + i += copy(dAtA[i:], m.ResourceType) + } + if len(m.ResourceName) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.ResourceName))) + i += copy(dAtA[i:], m.ResourceName) + } + if len(m.Owner) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Owner))) + i += copy(dAtA[i:], m.Owner) + } + if len(m.Description) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Description))) + i += copy(dAtA[i:], m.Description) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Help) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Help) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Links) > 0 { + for _, msg := range m.Links { + dAtA[i] = 0xa + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Help_Link) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Help_Link) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Description) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Description))) + i += copy(dAtA[i:], m.Description) + } + if len(m.Url) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Url))) + i += copy(dAtA[i:], m.Url) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *LocalizedMessage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LocalizedMessage) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Locale) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Locale))) + i += copy(dAtA[i:], m.Locale) + } + if len(m.Message) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintErrorDetails(dAtA, i, uint64(len(m.Message))) + i += copy(dAtA[i:], m.Message) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func encodeVarintErrorDetails(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func NewPopulatedRetryInfo(r randyErrorDetails, easy bool) *RetryInfo { + this := &RetryInfo{} + if r.Intn(10) != 0 { + this.RetryDelay = types.NewPopulatedDuration(r, easy) + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 2) + } + return this +} + +func NewPopulatedDebugInfo(r randyErrorDetails, easy bool) *DebugInfo { + this := &DebugInfo{} + v1 := r.Intn(10) + this.StackEntries = make([]string, v1) + for i := 0; i < v1; i++ { + this.StackEntries[i] = string(randStringErrorDetails(r)) + } + this.Detail = string(randStringErrorDetails(r)) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 3) + } + return this +} + +func NewPopulatedQuotaFailure(r randyErrorDetails, easy bool) *QuotaFailure { + this := &QuotaFailure{} + if r.Intn(10) != 0 { + v2 := r.Intn(5) + this.Violations = make([]*QuotaFailure_Violation, v2) + for i := 0; i < v2; i++ { + this.Violations[i] = NewPopulatedQuotaFailure_Violation(r, easy) + } + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 2) + } + return this +} + +func NewPopulatedQuotaFailure_Violation(r randyErrorDetails, easy bool) *QuotaFailure_Violation { + this := &QuotaFailure_Violation{} + this.Subject = string(randStringErrorDetails(r)) + this.Description = string(randStringErrorDetails(r)) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 3) + } + return this +} + +func NewPopulatedPreconditionFailure(r randyErrorDetails, easy bool) *PreconditionFailure { + this := &PreconditionFailure{} + if r.Intn(10) != 0 { + v3 := r.Intn(5) + this.Violations = make([]*PreconditionFailure_Violation, v3) + for i := 0; i < v3; i++ { + this.Violations[i] = NewPopulatedPreconditionFailure_Violation(r, easy) + } + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 2) + } + return this +} + +func NewPopulatedPreconditionFailure_Violation(r randyErrorDetails, easy bool) *PreconditionFailure_Violation { + this := &PreconditionFailure_Violation{} + this.Type = string(randStringErrorDetails(r)) + this.Subject = string(randStringErrorDetails(r)) + this.Description = string(randStringErrorDetails(r)) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 4) + } + return this +} + +func NewPopulatedBadRequest(r randyErrorDetails, easy bool) *BadRequest { + this := &BadRequest{} + if r.Intn(10) != 0 { + v4 := r.Intn(5) + this.FieldViolations = make([]*BadRequest_FieldViolation, v4) + for i := 0; i < v4; i++ { + this.FieldViolations[i] = NewPopulatedBadRequest_FieldViolation(r, easy) + } + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 2) + } + return this +} + +func NewPopulatedBadRequest_FieldViolation(r randyErrorDetails, easy bool) *BadRequest_FieldViolation { + this := &BadRequest_FieldViolation{} + this.Field = string(randStringErrorDetails(r)) + this.Description = string(randStringErrorDetails(r)) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 3) + } + return this +} + +func NewPopulatedRequestInfo(r randyErrorDetails, easy bool) *RequestInfo { + this := &RequestInfo{} + this.RequestId = string(randStringErrorDetails(r)) + this.ServingData = string(randStringErrorDetails(r)) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 3) + } + return this +} + +func NewPopulatedResourceInfo(r randyErrorDetails, easy bool) *ResourceInfo { + this := &ResourceInfo{} + this.ResourceType = string(randStringErrorDetails(r)) + this.ResourceName = string(randStringErrorDetails(r)) + this.Owner = string(randStringErrorDetails(r)) + this.Description = string(randStringErrorDetails(r)) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 5) + } + return this +} + +func NewPopulatedHelp(r randyErrorDetails, easy bool) *Help { + this := &Help{} + if r.Intn(10) != 0 { + v5 := r.Intn(5) + this.Links = make([]*Help_Link, v5) + for i := 0; i < v5; i++ { + this.Links[i] = NewPopulatedHelp_Link(r, easy) + } + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 2) + } + return this +} + +func NewPopulatedHelp_Link(r randyErrorDetails, easy bool) *Help_Link { + this := &Help_Link{} + this.Description = string(randStringErrorDetails(r)) + this.Url = string(randStringErrorDetails(r)) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 3) + } + return this +} + +func NewPopulatedLocalizedMessage(r randyErrorDetails, easy bool) *LocalizedMessage { + this := &LocalizedMessage{} + this.Locale = string(randStringErrorDetails(r)) + this.Message = string(randStringErrorDetails(r)) + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedErrorDetails(r, 3) + } + return this +} + +type randyErrorDetails interface { + Float32() float32 + Float64() float64 + Int63() int64 + Int31() int32 + Uint32() uint32 + Intn(n int) int +} + +func randUTF8RuneErrorDetails(r randyErrorDetails) rune { + ru := r.Intn(62) + if ru < 10 { + return rune(ru + 48) + } else if ru < 36 { + return rune(ru + 55) + } + return rune(ru + 61) +} +func randStringErrorDetails(r randyErrorDetails) string { + v6 := r.Intn(100) + tmps := make([]rune, v6) + for i := 0; i < v6; i++ { + tmps[i] = randUTF8RuneErrorDetails(r) + } + return string(tmps) +} +func randUnrecognizedErrorDetails(r randyErrorDetails, maxFieldNumber int) (dAtA []byte) { + l := r.Intn(5) + for i := 0; i < l; i++ { + wire := r.Intn(4) + if wire == 3 { + wire = 5 + } + fieldNumber := maxFieldNumber + r.Intn(100) + dAtA = randFieldErrorDetails(dAtA, r, fieldNumber, wire) + } + return dAtA +} +func randFieldErrorDetails(dAtA []byte, r randyErrorDetails, fieldNumber int, wire int) []byte { + key := uint32(fieldNumber)<<3 | uint32(wire) + switch wire { + case 0: + dAtA = encodeVarintPopulateErrorDetails(dAtA, uint64(key)) + v7 := r.Int63() + if r.Intn(2) == 0 { + v7 *= -1 + } + dAtA = encodeVarintPopulateErrorDetails(dAtA, uint64(v7)) + case 1: + dAtA = encodeVarintPopulateErrorDetails(dAtA, uint64(key)) + dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + case 2: + dAtA = encodeVarintPopulateErrorDetails(dAtA, uint64(key)) + ll := r.Intn(100) + dAtA = encodeVarintPopulateErrorDetails(dAtA, uint64(ll)) + for j := 0; j < ll; j++ { + dAtA = append(dAtA, byte(r.Intn(256))) + } + default: + dAtA = encodeVarintPopulateErrorDetails(dAtA, uint64(key)) + dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + } + return dAtA +} +func encodeVarintPopulateErrorDetails(dAtA []byte, v uint64) []byte { + for v >= 1<<7 { + dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) + v >>= 7 + } + dAtA = append(dAtA, uint8(v)) + return dAtA +} +func (m *RetryInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RetryDelay != nil { + l = m.RetryDelay.Size() + n += 1 + l + sovErrorDetails(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DebugInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.StackEntries) > 0 { + for _, s := range m.StackEntries { + l = len(s) + n += 1 + l + sovErrorDetails(uint64(l)) + } + } + l = len(m.Detail) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *QuotaFailure) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Violations) > 0 { + for _, e := range m.Violations { + l = e.Size() + n += 1 + l + sovErrorDetails(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *QuotaFailure_Violation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Subject) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PreconditionFailure) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Violations) > 0 { + for _, e := range m.Violations { + l = e.Size() + n += 1 + l + sovErrorDetails(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PreconditionFailure_Violation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + l = len(m.Subject) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *BadRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.FieldViolations) > 0 { + for _, e := range m.FieldViolations { + l = e.Size() + n += 1 + l + sovErrorDetails(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *BadRequest_FieldViolation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Field) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RequestInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RequestId) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + l = len(m.ServingData) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ResourceInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ResourceType) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + l = len(m.ResourceName) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Help) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Links) > 0 { + for _, e := range m.Links { + l = e.Size() + n += 1 + l + sovErrorDetails(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Help_Link) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Description) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + l = len(m.Url) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *LocalizedMessage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Locale) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovErrorDetails(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovErrorDetails(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozErrorDetails(x uint64) (n int) { + return sovErrorDetails(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *RetryInfo) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RetryInfo{`, + `RetryDelay:` + strings.Replace(fmt.Sprintf("%v", this.RetryDelay), "Duration", "types.Duration", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *DebugInfo) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&DebugInfo{`, + `StackEntries:` + fmt.Sprintf("%v", this.StackEntries) + `,`, + `Detail:` + fmt.Sprintf("%v", this.Detail) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *QuotaFailure) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QuotaFailure{`, + `Violations:` + strings.Replace(fmt.Sprintf("%v", this.Violations), "QuotaFailure_Violation", "QuotaFailure_Violation", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *QuotaFailure_Violation) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&QuotaFailure_Violation{`, + `Subject:` + fmt.Sprintf("%v", this.Subject) + `,`, + `Description:` + fmt.Sprintf("%v", this.Description) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *PreconditionFailure) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PreconditionFailure{`, + `Violations:` + strings.Replace(fmt.Sprintf("%v", this.Violations), "PreconditionFailure_Violation", "PreconditionFailure_Violation", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *PreconditionFailure_Violation) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PreconditionFailure_Violation{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Subject:` + fmt.Sprintf("%v", this.Subject) + `,`, + `Description:` + fmt.Sprintf("%v", this.Description) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *BadRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BadRequest{`, + `FieldViolations:` + strings.Replace(fmt.Sprintf("%v", this.FieldViolations), "BadRequest_FieldViolation", "BadRequest_FieldViolation", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *BadRequest_FieldViolation) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&BadRequest_FieldViolation{`, + `Field:` + fmt.Sprintf("%v", this.Field) + `,`, + `Description:` + fmt.Sprintf("%v", this.Description) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *RequestInfo) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RequestInfo{`, + `RequestId:` + fmt.Sprintf("%v", this.RequestId) + `,`, + `ServingData:` + fmt.Sprintf("%v", this.ServingData) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *ResourceInfo) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ResourceInfo{`, + `ResourceType:` + fmt.Sprintf("%v", this.ResourceType) + `,`, + `ResourceName:` + fmt.Sprintf("%v", this.ResourceName) + `,`, + `Owner:` + fmt.Sprintf("%v", this.Owner) + `,`, + `Description:` + fmt.Sprintf("%v", this.Description) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Help) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Help{`, + `Links:` + strings.Replace(fmt.Sprintf("%v", this.Links), "Help_Link", "Help_Link", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *Help_Link) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Help_Link{`, + `Description:` + fmt.Sprintf("%v", this.Description) + `,`, + `Url:` + fmt.Sprintf("%v", this.Url) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *LocalizedMessage) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LocalizedMessage{`, + `Locale:` + fmt.Sprintf("%v", this.Locale) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func valueToStringErrorDetails(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *RetryInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RetryInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RetryInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetryDelay", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RetryDelay == nil { + m.RetryDelay = &types.Duration{} + } + if err := m.RetryDelay.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErrorDetails(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DebugInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DebugInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DebugInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StackEntries", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StackEntries = append(m.StackEntries, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Detail", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Detail = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErrorDetails(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuotaFailure) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuotaFailure: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuotaFailure: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Violations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Violations = append(m.Violations, &QuotaFailure_Violation{}) + if err := m.Violations[len(m.Violations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErrorDetails(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuotaFailure_Violation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Violation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Violation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErrorDetails(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PreconditionFailure) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PreconditionFailure: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PreconditionFailure: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Violations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Violations = append(m.Violations, &PreconditionFailure_Violation{}) + if err := m.Violations[len(m.Violations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErrorDetails(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PreconditionFailure_Violation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Violation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Violation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErrorDetails(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BadRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BadRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BadRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FieldViolations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FieldViolations = append(m.FieldViolations, &BadRequest_FieldViolation{}) + if err := m.FieldViolations[len(m.FieldViolations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErrorDetails(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BadRequest_FieldViolation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FieldViolation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FieldViolation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErrorDetails(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RequestInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RequestInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RequestInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RequestId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServingData", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServingData = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErrorDetails(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResourceInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResourceInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErrorDetails(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Help) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Help: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Help: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Links", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Links = append(m.Links, &Help_Link{}) + if err := m.Links[len(m.Links)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErrorDetails(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Help_Link) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Link: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Link: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErrorDetails(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LocalizedMessage) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LocalizedMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LocalizedMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Locale", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Locale = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthErrorDetails + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthErrorDetails + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipErrorDetails(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthErrorDetails + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipErrorDetails(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthErrorDetails + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthErrorDetails + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowErrorDetails + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipErrorDetails(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthErrorDetails + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthErrorDetails = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowErrorDetails = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/github.com/gogo/googleapis/google/rpc/error_details.proto b/vendor/github.com/gogo/googleapis/google/rpc/error_details.proto new file mode 100644 index 0000000000..0682cc97bb --- /dev/null +++ b/vendor/github.com/gogo/googleapis/google/rpc/error_details.proto @@ -0,0 +1,200 @@ +// Copyright 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.rpc; + +import "google/protobuf/duration.proto"; + +option go_package = "rpc"; +option java_multiple_files = true; +option java_outer_classname = "ErrorDetailsProto"; +option java_package = "com.google.rpc"; +option objc_class_prefix = "RPC"; + +// Describes when the clients can retry a failed request. Clients could ignore +// the recommendation here or retry when this information is missing from error +// responses. +// +// It's always recommended that clients should use exponential backoff when +// retrying. +// +// Clients should wait until `retry_delay` amount of time has passed since +// receiving the error response before retrying. If retrying requests also +// fail, clients should use an exponential backoff scheme to gradually increase +// the delay between retries based on `retry_delay`, until either a maximum +// number of retires have been reached or a maximum retry delay cap has been +// reached. +message RetryInfo { + // Clients should wait at least this long between retrying the same request. + google.protobuf.Duration retry_delay = 1; +} + +// Describes additional debugging info. +message DebugInfo { + // The stack trace entries indicating where the error occurred. + repeated string stack_entries = 1; + + // Additional debugging information provided by the server. + string detail = 2; +} + +// Describes how a quota check failed. +// +// For example if a daily limit was exceeded for the calling project, +// a service could respond with a QuotaFailure detail containing the project +// id and the description of the quota limit that was exceeded. If the +// calling project hasn't enabled the service in the developer console, then +// a service could respond with the project id and set `service_disabled` +// to true. +// +// Also see RetryDetail and Help types for other details about handling a +// quota failure. +message QuotaFailure { + // A message type used to describe a single quota violation. For example, a + // daily quota or a custom quota that was exceeded. + message Violation { + // The subject on which the quota check failed. + // For example, "clientip:" or "project:". + string subject = 1; + + // A description of how the quota check failed. Clients can use this + // description to find more about the quota configuration in the service's + // public documentation, or find the relevant quota limit to adjust through + // developer console. + // + // For example: "Service disabled" or "Daily Limit for read operations + // exceeded". + string description = 2; + } + + // Describes all quota violations. + repeated Violation violations = 1; +} + +// Describes what preconditions have failed. +// +// For example, if an RPC failed because it required the Terms of Service to be +// acknowledged, it could list the terms of service violation in the +// PreconditionFailure message. +message PreconditionFailure { + // A message type used to describe a single precondition failure. + message Violation { + // The type of PreconditionFailure. We recommend using a service-specific + // enum type to define the supported precondition violation types. For + // example, "TOS" for "Terms of Service violation". + string type = 1; + + // The subject, relative to the type, that failed. + // For example, "google.com/cloud" relative to the "TOS" type would + // indicate which terms of service is being referenced. + string subject = 2; + + // A description of how the precondition failed. Developers can use this + // description to understand how to fix the failure. + // + // For example: "Terms of service not accepted". + string description = 3; + } + + // Describes all precondition violations. + repeated Violation violations = 1; +} + +// Describes violations in a client request. This error type focuses on the +// syntactic aspects of the request. +message BadRequest { + // A message type used to describe a single bad request field. + message FieldViolation { + // A path leading to a field in the request body. The value will be a + // sequence of dot-separated identifiers that identify a protocol buffer + // field. E.g., "field_violations.field" would identify this field. + string field = 1; + + // A description of why the request element is bad. + string description = 2; + } + + // Describes all violations in a client request. + repeated FieldViolation field_violations = 1; +} + +// Contains metadata about the request that clients can attach when filing a bug +// or providing other forms of feedback. +message RequestInfo { + // An opaque string that should only be interpreted by the service generating + // it. For example, it can be used to identify requests in the service's logs. + string request_id = 1; + + // Any data that was used to serve this request. For example, an encrypted + // stack trace that can be sent back to the service provider for debugging. + string serving_data = 2; +} + +// Describes the resource that is being accessed. +message ResourceInfo { + // A name for the type of resource being accessed, e.g. "sql table", + // "cloud storage bucket", "file", "Google calendar"; or the type URL + // of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". + string resource_type = 1; + + // The name of the resource being accessed. For example, a shared calendar + // name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current + // error is + // [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. + string resource_name = 2; + + // The owner of the resource (optional). + // For example, "user:" or "project:". + string owner = 3; + + // Describes what error is encountered when accessing this resource. + // For example, updating a cloud project may require the `writer` permission + // on the developer console project. + string description = 4; +} + +// Provides links to documentation or for performing an out of band action. +// +// For example, if a quota check failed with an error indicating the calling +// project hasn't enabled the accessed service, this can contain a URL pointing +// directly to the right place in the developer console to flip the bit. +message Help { + // Describes a URL link. + message Link { + // Describes what the link offers. + string description = 1; + + // The URL of the link. + string url = 2; + } + + // URL(s) pointing to additional information on handling the current error. + repeated Link links = 1; +} + +// Provides a localized error message that is safe to return to the user +// which can be attached to an RPC error. +message LocalizedMessage { + // The locale used following the specification defined at + // http://www.rfc-editor.org/rfc/bcp/bcp47.txt. + // Examples are: "en-US", "fr-CH", "es-MX" + string locale = 1; + + // The localized error message in the above locale. + string message = 2; +} diff --git a/vendor/github.com/gogo/googleapis/google/rpc/status.pb.go b/vendor/github.com/gogo/googleapis/google/rpc/status.pb.go new file mode 100644 index 0000000000..65fc30f4a2 --- /dev/null +++ b/vendor/github.com/gogo/googleapis/google/rpc/status.pb.go @@ -0,0 +1,747 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: google/rpc/status.proto + +package rpc + +import ( + bytes "bytes" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + io "io" + math "math" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +// The `Status` type defines a logical error model that is suitable for +// different programming environments, including REST APIs and RPC APIs. It is +// used by [gRPC](https://github.com/grpc). The error model is designed to be: +// +// - Simple to use and understand for most users +// - Flexible enough to meet unexpected needs +// +// # Overview +// +// The `Status` message contains three pieces of data: error code, error +// message, and error details. The error code should be an enum value of +// [google.rpc.Code][google.rpc.Code], but it may accept additional error codes +// if needed. The error message should be a developer-facing English message +// that helps developers *understand* and *resolve* the error. If a localized +// user-facing error message is needed, put the localized message in the error +// details or localize it in the client. The optional error details may contain +// arbitrary information about the error. There is a predefined set of error +// detail types in the package `google.rpc` that can be used for common error +// conditions. +// +// # Language mapping +// +// The `Status` message is the logical representation of the error model, but it +// is not necessarily the actual wire format. When the `Status` message is +// exposed in different client libraries and different wire protocols, it can be +// mapped differently. For example, it will likely be mapped to some exceptions +// in Java, but more likely mapped to some error codes in C. +// +// # Other uses +// +// The error model and the `Status` message can be used in a variety of +// environments, either with or without APIs, to provide a +// consistent developer experience across different environments. +// +// Example uses of this error model include: +// +// - Partial errors. If a service needs to return partial errors to the client, +// it may embed the `Status` in the normal response to indicate the partial +// errors. +// +// - Workflow errors. A typical workflow has multiple steps. Each step may +// have a `Status` message for error reporting. +// +// - Batch operations. If a client uses batch request and batch response, the +// `Status` message should be used directly inside batch response, one for +// each error sub-response. +// +// - Asynchronous operations. If an API call embeds asynchronous operation +// results in its response, the status of those operations should be +// represented directly using the `Status` message. +// +// - Logging. If some API errors are stored in logs, the message `Status` could +// be used directly after any stripping needed for security/privacy reasons. +type Status struct { + // The status code, which should be an enum value of + // [google.rpc.Code][google.rpc.Code]. + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + // A developer-facing error message, which should be in English. Any + // user-facing error message should be localized and sent in the + // [google.rpc.Status.details][google.rpc.Status.details] field, or localized + // by the client. + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + // A list of messages that carry the error details. There is a common set of + // message types for APIs to use. + Details []*types.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Status) Reset() { *m = Status{} } +func (*Status) ProtoMessage() {} +func (*Status) Descriptor() ([]byte, []int) { + return fileDescriptor_24d244abaf643bfe, []int{0} +} +func (m *Status) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Status.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Status) XXX_Merge(src proto.Message) { + xxx_messageInfo_Status.Merge(m, src) +} +func (m *Status) XXX_Size() int { + return m.Size() +} +func (m *Status) XXX_DiscardUnknown() { + xxx_messageInfo_Status.DiscardUnknown(m) +} + +var xxx_messageInfo_Status proto.InternalMessageInfo + +func (m *Status) GetCode() int32 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *Status) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *Status) GetDetails() []*types.Any { + if m != nil { + return m.Details + } + return nil +} + +func (*Status) XXX_MessageName() string { + return "google.rpc.Status" +} +func init() { + proto.RegisterType((*Status)(nil), "google.rpc.Status") +} + +func init() { proto.RegisterFile("google/rpc/status.proto", fileDescriptor_24d244abaf643bfe) } + +var fileDescriptor_24d244abaf643bfe = []byte{ + // 235 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x2f, 0x2a, 0x48, 0xd6, 0x2f, 0x2e, 0x49, 0x2c, 0x29, 0x2d, 0xd6, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x48, 0xe8, 0x15, 0x15, 0x24, 0x4b, 0x49, 0x42, 0x15, 0x81, + 0x65, 0x92, 0x4a, 0xd3, 0xf4, 0x13, 0xf3, 0x2a, 0x21, 0xca, 0x94, 0xd2, 0xb8, 0xd8, 0x82, 0xc1, + 0xda, 0x84, 0x84, 0xb8, 0x58, 0x92, 0xf3, 0x53, 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, 0x58, 0x83, + 0xc0, 0x6c, 0x21, 0x09, 0x2e, 0xf6, 0xdc, 0xd4, 0xe2, 0xe2, 0xc4, 0xf4, 0x54, 0x09, 0x26, 0x05, + 0x46, 0x0d, 0xce, 0x20, 0x18, 0x57, 0x48, 0x8f, 0x8b, 0x3d, 0x25, 0xb5, 0x24, 0x31, 0x33, 0xa7, + 0x58, 0x82, 0x59, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x44, 0x0f, 0x6a, 0x21, 0xcc, 0x12, 0x3d, 0xc7, + 0xbc, 0xca, 0x20, 0x98, 0x22, 0xa7, 0xb8, 0x0b, 0x0f, 0xe5, 0x18, 0x6e, 0x3c, 0x94, 0x63, 0xf8, + 0xf0, 0x50, 0x8e, 0xf1, 0xc7, 0x43, 0x39, 0xc6, 0x86, 0x47, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, 0x31, + 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x2f, 0x1e, 0xc9, + 0x31, 0x7c, 0x00, 0x89, 0x3f, 0x96, 0x63, 0x3c, 0xf1, 0x58, 0x8e, 0x91, 0x8b, 0x2f, 0x39, 0x3f, + 0x57, 0x0f, 0xe1, 0x11, 0x27, 0x6e, 0x88, 0x5b, 0x03, 0x40, 0x56, 0x04, 0x30, 0x46, 0x31, 0x17, + 0x15, 0x24, 0x2f, 0x62, 0x62, 0x0e, 0x0a, 0x70, 0x4e, 0x62, 0x03, 0x5b, 0x6b, 0x0c, 0x08, 0x00, + 0x00, 0xff, 0xff, 0xaa, 0x06, 0xa1, 0xaa, 0x10, 0x01, 0x00, 0x00, +} + +func (this *Status) Compare(that interface{}) int { + if that == nil { + if this == nil { + return 0 + } + return 1 + } + + that1, ok := that.(*Status) + if !ok { + that2, ok := that.(Status) + if ok { + that1 = &that2 + } else { + return 1 + } + } + if that1 == nil { + if this == nil { + return 0 + } + return 1 + } else if this == nil { + return -1 + } + if this.Code != that1.Code { + if this.Code < that1.Code { + return -1 + } + return 1 + } + if this.Message != that1.Message { + if this.Message < that1.Message { + return -1 + } + return 1 + } + if len(this.Details) != len(that1.Details) { + if len(this.Details) < len(that1.Details) { + return -1 + } + return 1 + } + for i := range this.Details { + if c := this.Details[i].Compare(that1.Details[i]); c != 0 { + return c + } + } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } + return 0 +} +func (this *Status) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Status) + if !ok { + that2, ok := that.(Status) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Code != that1.Code { + return false + } + if this.Message != that1.Message { + return false + } + if len(this.Details) != len(that1.Details) { + return false + } + for i := range this.Details { + if !this.Details[i].Equal(that1.Details[i]) { + return false + } + } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } + return true +} +func (this *Status) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&rpc.Status{") + s = append(s, "Code: "+fmt.Sprintf("%#v", this.Code)+",\n") + s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n") + if this.Details != nil { + s = append(s, "Details: "+fmt.Sprintf("%#v", this.Details)+",\n") + } + if this.XXX_unrecognized != nil { + s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringStatus(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *Status) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Status) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Code != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintStatus(dAtA, i, uint64(m.Code)) + } + if len(m.Message) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintStatus(dAtA, i, uint64(len(m.Message))) + i += copy(dAtA[i:], m.Message) + } + if len(m.Details) > 0 { + for _, msg := range m.Details { + dAtA[i] = 0x1a + i++ + i = encodeVarintStatus(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func encodeVarintStatus(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func NewPopulatedStatus(r randyStatus, easy bool) *Status { + this := &Status{} + this.Code = int32(r.Int31()) + if r.Intn(2) == 0 { + this.Code *= -1 + } + this.Message = string(randStringStatus(r)) + if r.Intn(10) != 0 { + v1 := r.Intn(5) + this.Details = make([]*types.Any, v1) + for i := 0; i < v1; i++ { + this.Details[i] = types.NewPopulatedAny(r, easy) + } + } + if !easy && r.Intn(10) != 0 { + this.XXX_unrecognized = randUnrecognizedStatus(r, 4) + } + return this +} + +type randyStatus interface { + Float32() float32 + Float64() float64 + Int63() int64 + Int31() int32 + Uint32() uint32 + Intn(n int) int +} + +func randUTF8RuneStatus(r randyStatus) rune { + ru := r.Intn(62) + if ru < 10 { + return rune(ru + 48) + } else if ru < 36 { + return rune(ru + 55) + } + return rune(ru + 61) +} +func randStringStatus(r randyStatus) string { + v2 := r.Intn(100) + tmps := make([]rune, v2) + for i := 0; i < v2; i++ { + tmps[i] = randUTF8RuneStatus(r) + } + return string(tmps) +} +func randUnrecognizedStatus(r randyStatus, maxFieldNumber int) (dAtA []byte) { + l := r.Intn(5) + for i := 0; i < l; i++ { + wire := r.Intn(4) + if wire == 3 { + wire = 5 + } + fieldNumber := maxFieldNumber + r.Intn(100) + dAtA = randFieldStatus(dAtA, r, fieldNumber, wire) + } + return dAtA +} +func randFieldStatus(dAtA []byte, r randyStatus, fieldNumber int, wire int) []byte { + key := uint32(fieldNumber)<<3 | uint32(wire) + switch wire { + case 0: + dAtA = encodeVarintPopulateStatus(dAtA, uint64(key)) + v3 := r.Int63() + if r.Intn(2) == 0 { + v3 *= -1 + } + dAtA = encodeVarintPopulateStatus(dAtA, uint64(v3)) + case 1: + dAtA = encodeVarintPopulateStatus(dAtA, uint64(key)) + dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + case 2: + dAtA = encodeVarintPopulateStatus(dAtA, uint64(key)) + ll := r.Intn(100) + dAtA = encodeVarintPopulateStatus(dAtA, uint64(ll)) + for j := 0; j < ll; j++ { + dAtA = append(dAtA, byte(r.Intn(256))) + } + default: + dAtA = encodeVarintPopulateStatus(dAtA, uint64(key)) + dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + } + return dAtA +} +func encodeVarintPopulateStatus(dAtA []byte, v uint64) []byte { + for v >= 1<<7 { + dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) + v >>= 7 + } + dAtA = append(dAtA, uint8(v)) + return dAtA +} +func (m *Status) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Code != 0 { + n += 1 + sovStatus(uint64(m.Code)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovStatus(uint64(l)) + } + if len(m.Details) > 0 { + for _, e := range m.Details { + l = e.Size() + n += 1 + l + sovStatus(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovStatus(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozStatus(x uint64) (n int) { + return sovStatus(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Status) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Status{`, + `Code:` + fmt.Sprintf("%v", this.Code) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `Details:` + strings.Replace(fmt.Sprintf("%v", this.Details), "Any", "types.Any", 1) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func valueToStringStatus(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Status) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Status: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Status: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + m.Code = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Code |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthStatus + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStatus + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStatus + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStatus + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStatus + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Details = append(m.Details, &types.Any{}) + if err := m.Details[len(m.Details)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStatus(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthStatus + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthStatus + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipStatus(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStatus + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStatus + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStatus + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthStatus + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthStatus + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStatus + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipStatus(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthStatus + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthStatus = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStatus = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/github.com/gogo/googleapis/google/rpc/status.proto b/vendor/github.com/gogo/googleapis/google/rpc/status.proto new file mode 100644 index 0000000000..abcd453431 --- /dev/null +++ b/vendor/github.com/gogo/googleapis/google/rpc/status.proto @@ -0,0 +1,94 @@ +// Copyright 2017 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.rpc; + +import "google/protobuf/any.proto"; + +option go_package = "rpc"; +option java_multiple_files = true; +option java_outer_classname = "StatusProto"; +option java_package = "com.google.rpc"; +option objc_class_prefix = "RPC"; + +// The `Status` type defines a logical error model that is suitable for +// different programming environments, including REST APIs and RPC APIs. It is +// used by [gRPC](https://github.com/grpc). The error model is designed to be: +// +// - Simple to use and understand for most users +// - Flexible enough to meet unexpected needs +// +// # Overview +// +// The `Status` message contains three pieces of data: error code, error +// message, and error details. The error code should be an enum value of +// [google.rpc.Code][google.rpc.Code], but it may accept additional error codes +// if needed. The error message should be a developer-facing English message +// that helps developers *understand* and *resolve* the error. If a localized +// user-facing error message is needed, put the localized message in the error +// details or localize it in the client. The optional error details may contain +// arbitrary information about the error. There is a predefined set of error +// detail types in the package `google.rpc` that can be used for common error +// conditions. +// +// # Language mapping +// +// The `Status` message is the logical representation of the error model, but it +// is not necessarily the actual wire format. When the `Status` message is +// exposed in different client libraries and different wire protocols, it can be +// mapped differently. For example, it will likely be mapped to some exceptions +// in Java, but more likely mapped to some error codes in C. +// +// # Other uses +// +// The error model and the `Status` message can be used in a variety of +// environments, either with or without APIs, to provide a +// consistent developer experience across different environments. +// +// Example uses of this error model include: +// +// - Partial errors. If a service needs to return partial errors to the client, +// it may embed the `Status` in the normal response to indicate the partial +// errors. +// +// - Workflow errors. A typical workflow has multiple steps. Each step may +// have a `Status` message for error reporting. +// +// - Batch operations. If a client uses batch request and batch response, the +// `Status` message should be used directly inside batch response, one for +// each error sub-response. +// +// - Asynchronous operations. If an API call embeds asynchronous operation +// results in its response, the status of those operations should be +// represented directly using the `Status` message. +// +// - Logging. If some API errors are stored in logs, the message `Status` could +// be used directly after any stripping needed for security/privacy reasons. +message Status { + // The status code, which should be an enum value of + // [google.rpc.Code][google.rpc.Code]. + int32 code = 1; + + // A developer-facing error message, which should be in English. Any + // user-facing error message should be localized and sent in the + // [google.rpc.Status.details][google.rpc.Status.details] field, or localized + // by the client. + string message = 2; + + // A list of messages that carry the error details. There is a common set of + // message types for APIs to use. + repeated google.protobuf.Any details = 3; +} diff --git a/vendor/github.com/gogo/status/.gitignore b/vendor/github.com/gogo/status/.gitignore new file mode 100644 index 0000000000..22d0d82f80 --- /dev/null +++ b/vendor/github.com/gogo/status/.gitignore @@ -0,0 +1 @@ +vendor diff --git a/vendor/github.com/gogo/status/LICENSE b/vendor/github.com/gogo/status/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/vendor/github.com/gogo/status/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/gogo/status/README.md b/vendor/github.com/gogo/status/README.md new file mode 100644 index 0000000000..3355fa3afc --- /dev/null +++ b/vendor/github.com/gogo/status/README.md @@ -0,0 +1,47 @@ +# Status + +This is a convenience package for users of `gogo/protobuf` to be able to use +their `gogo/protobuf` generated message easily and transparently with the +gRPC status error structure. + +It requires [Go gRPC version 1.11](https://github.com/grpc/grpc-go/releases/tag/v1.11.0) +or above to successfully transmit statuses over the gRPC transport. + +## Use + +Use as you would the normal `grpc/status` package: + +```go +return status.Error(codes.NotFound, "no such user") +``` + +```go +st := status.New(codes.FailedPrecondition, "wrong user role") +detSt, err := st.WithDetails(&rpc.BadRequest{ + FieldViolations: []*rpc.BadRequest_FieldViolation{ + { + Field: "role", + Description: "The first user created must have the role of an ADMIN", + }, + }, +}) +if err == nil { + return detSt.Err() +} +return st.Err() +``` + +## License + +The code is 95% copied from the official gRPC status package, so the gRPC +License applies. + +### Changes + +The changes applied include changing the use of the +`golang/protobuf` packages to `gogo/protobuf`, and changing the +generated files from `google.golang.org/genproto/googleapis` to +`github.com/gogo/googleapis/`. + +We've also created an implicit interface fulfilled by all `gogo/status` +errors, for use with `grpc/status` and the gRPC runtime libraries. diff --git a/vendor/github.com/gogo/status/go.mod b/vendor/github.com/gogo/status/go.mod new file mode 100644 index 0000000000..6d2c363fea --- /dev/null +++ b/vendor/github.com/gogo/status/go.mod @@ -0,0 +1,12 @@ +module github.com/gogo/status + +go 1.12 + +require ( + github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a + github.com/gogo/protobuf v1.2.0 + github.com/golang/protobuf v1.2.0 + golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 // indirect + google.golang.org/genproto v0.0.0-20180518175338-11a468237815 + google.golang.org/grpc v1.12.0 +) diff --git a/vendor/github.com/gogo/status/go.sum b/vendor/github.com/gogo/status/go.sum new file mode 100644 index 0000000000..6938bfb290 --- /dev/null +++ b/vendor/github.com/gogo/status/go.sum @@ -0,0 +1,12 @@ +github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a h1:dR8+Q0uO5S2ZBcs2IH6VBKYwSxPo2vYCYq0ot0mu7xA= +github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +google.golang.org/genproto v0.0.0-20180518175338-11a468237815 h1:p3qKkjcSW6m32Lr1CInA3jW53vG29/JB6QOvQWie5WI= +google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/grpc v1.12.0 h1:Mm8atZtkT+P6R43n/dqNDWkPPu5BwRVu/1rJnJCeZH8= +google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= diff --git a/vendor/github.com/gogo/status/status.go b/vendor/github.com/gogo/status/status.go new file mode 100644 index 0000000000..d533421fc0 --- /dev/null +++ b/vendor/github.com/gogo/status/status.go @@ -0,0 +1,220 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package status implements errors returned by gRPC. These errors are +// serialized and transmitted on the wire between server and client, and allow +// for additional data to be transmitted via the Details field in the status +// proto. gRPC service handlers should return an error created by this +// package, and gRPC clients should expect a corresponding error to be +// returned from the RPC call. +// +// This package upholds the invariants that a non-nil error may not +// contain an OK code, and an OK code must result in a nil error. +package status + +import ( + "errors" + "fmt" + + "github.com/gogo/googleapis/google/rpc" + "github.com/gogo/protobuf/proto" + "github.com/gogo/protobuf/types" + "github.com/golang/protobuf/ptypes/any" + spb "google.golang.org/genproto/googleapis/rpc/status" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// statusError is an alias of a status proto. It implements error and Status, +// and a nil statusError should never be returned by this package. +type statusError rpc.Status + +func (se *statusError) Error() string { + p := (*rpc.Status)(se) + return fmt.Sprintf("rpc error: code = %s desc = %s", codes.Code(p.GetCode()), p.GetMessage()) +} + +// Status converts the gogo/statusError to a grpc/status. +func (se *statusError) GRPCStatus() *status.Status { + p := (*rpc.Status)(se) + s := &spb.Status{ + Code: p.GetCode(), + Message: p.GetMessage(), + } + for _, detail := range p.GetDetails() { + s.Details = append(s.GetDetails(), &any.Any{ + TypeUrl: detail.GetTypeUrl(), + Value: detail.GetValue(), + }) + } + return status.FromProto(s) +} + +// Status represents an RPC status code, message, and details. It is immutable +// and should be created with New, Newf, or FromProto. +type Status struct { + s *rpc.Status +} + +// Code returns the status code contained in s. +func (s *Status) Code() codes.Code { + if s == nil || s.s == nil { + return codes.OK + } + return codes.Code(s.s.Code) +} + +// Message returns the message contained in s. +func (s *Status) Message() string { + if s == nil || s.s == nil { + return "" + } + return s.s.Message +} + +// Proto returns s's status as an rpc.Status proto message. +func (s *Status) Proto() *rpc.Status { + if s == nil { + return nil + } + return proto.Clone(s.s).(*rpc.Status) +} + +// Err returns an immutable error representing s; returns nil if s.Code() is +// OK. +func (s *Status) Err() error { + if s.Code() == codes.OK { + return nil + } + return (*statusError)(s.s) +} + +// New returns a Status representing c and msg. +func New(c codes.Code, msg string) *Status { + return &Status{s: &rpc.Status{Code: int32(c), Message: msg}} +} + +// Newf returns New(c, fmt.Sprintf(format, a...)). +func Newf(c codes.Code, format string, a ...interface{}) *Status { + return New(c, fmt.Sprintf(format, a...)) +} + +// Error returns an error representing c and msg. If c is OK, returns nil. +func Error(c codes.Code, msg string) error { + return New(c, msg).Err() +} + +// Errorf returns Error(c, fmt.Sprintf(format, a...)). +func Errorf(c codes.Code, format string, a ...interface{}) error { + return Error(c, fmt.Sprintf(format, a...)) +} + +// ErrorProto returns an error representing s. If s.Code is OK, returns nil. +func ErrorProto(s *rpc.Status) error { + return FromProto(s).Err() +} + +// FromProto returns a Status representing s. +func FromProto(s *rpc.Status) *Status { + return &Status{s: proto.Clone(s).(*rpc.Status)} +} + +// FromError returns a Status representing err if it was produced from this +// package or the standard grpc/status package. Otherwise, ok is false and +// a Status is returned with codes.Unknown and the original error message. +func FromError(err error) (s *Status, ok bool) { + if err == nil { + return &Status{s: &rpc.Status{Code: int32(codes.OK)}}, true + } + if se, ok := err.(interface{ GRPCStatus() *status.Status }); ok { + return FromGRPCStatus(se.GRPCStatus()), true + } + return New(codes.Unknown, err.Error()), false +} + +// FromGRPCStatus converts a grpc.Status to gogo.Status. +func FromGRPCStatus(st *status.Status) *Status { + p := st.Proto() + pb := &rpc.Status{ + Code: p.GetCode(), + Message: p.GetMessage(), + } + for _, detail := range p.GetDetails() { + pb.Details = append(pb.GetDetails(), &types.Any{ + TypeUrl: detail.GetTypeUrl(), + Value: detail.GetValue(), + }) + } + return FromProto(pb) +} + +// Convert is a convenience function which removes the need to handle the +// boolean return value from FromError. +func Convert(err error) *Status { + s, _ := FromError(err) + return s +} + +// WithDetails returns a new status with the provided details messages appended to the status. +// If any errors are encountered, it returns nil and the first error encountered. +func (s *Status) WithDetails(details ...proto.Message) (*Status, error) { + if s.Code() == codes.OK { + return nil, errors.New("no error details for status with code OK") + } + // s.Code() != OK implies that s.Proto() != nil. + p := s.Proto() + for _, detail := range details { + any, err := types.MarshalAny(detail) + if err != nil { + return nil, err + } + p.Details = append(p.Details, any) + } + return &Status{s: p}, nil +} + +// Details returns a slice of details messages attached to the status. +// If a detail cannot be decoded, the error is returned in place of the detail. +func (s *Status) Details() []interface{} { + if s == nil || s.s == nil { + return nil + } + details := make([]interface{}, 0, len(s.s.Details)) + for _, any := range s.s.Details { + detail := &types.DynamicAny{} + if err := types.UnmarshalAny(any, detail); err != nil { + details = append(details, err) + continue + } + details = append(details, detail.Message) + } + return details +} + +// Code returns the Code of the error if it is a Status error, codes.OK if err +// is nil, or codes.Unknown otherwise. +func Code(err error) codes.Code { + // Don't use FromError to avoid allocation of OK status. + if err == nil { + return codes.OK + } + if se, ok := err.(interface{ GRPCStatus() *status.Status }); ok { + return se.GRPCStatus().Code() + } + return codes.Unknown +} diff --git a/vendor/github.com/ligato/cn-infra/agent/README.md b/vendor/github.com/ligato/cn-infra/agent/README.md deleted file mode 100644 index cc26fd4450..0000000000 --- a/vendor/github.com/ligato/cn-infra/agent/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# Agent [![GoDoc](https://godoc.org/github.com/ligato/cn-infra/agent?status.svg)](https://godoc.org/github.com/ligato/cn-infra/agent) - -The **agent** package provides the life-cycle management agent for plugins. -It is intended to be used as a base point of an application used in main package. - -```go -func main() { - plugin := myplugin.NewPlugin() - - a := agent.NewAgent( - agent.Plugins(plugin), - ) - if err := a.Run(); err != nil { - log.Fatal(err) - } -} -``` - -## Agent options - -There are various options available to customize agent: - -- `Version(ver, date, id)` sets version of the program -- `QuitOnClose(chan)` sets signal used to quit the running agent when closed -- `QuitSignals(signals)` sets signals used to quit the running agent (default: SIGINT, SIGTERM) -- `StartTimeout(dur)/StopTimeout(dur)` sets start/stop timeout (defaults: 15s/5s) - -Add plugins to list of plugins managed by agent using: -- `Plugins(...)` adds just single plugins -- `AllPlugins(...)` adds plugin along with all of its plugin deps - -See all options [here](https://godoc.org/github.com/ligato/cn-infra/agent#Option). diff --git a/vendor/github.com/ligato/cn-infra/agent/agent.go b/vendor/github.com/ligato/cn-infra/agent/agent.go index f92d5b042e..f3c077d93f 100644 --- a/vendor/github.com/ligato/cn-infra/agent/agent.go +++ b/vendor/github.com/ligato/cn-infra/agent/agent.go @@ -24,12 +24,13 @@ import ( "sync" "time" + "github.com/namsral/flag" + "github.com/ligato/cn-infra/config" "github.com/ligato/cn-infra/infra" "github.com/ligato/cn-infra/logging" "github.com/ligato/cn-infra/logging/measure" "github.com/ligato/cn-infra/utils/once" - "github.com/namsral/flag" ) var agentLogger = logging.DefaultRegistry.NewLogger("agent") diff --git a/vendor/github.com/ligato/cn-infra/agent/doc.go b/vendor/github.com/ligato/cn-infra/agent/doc.go new file mode 100644 index 0000000000..5cd9a38265 --- /dev/null +++ b/vendor/github.com/ligato/cn-infra/agent/doc.go @@ -0,0 +1,48 @@ +// Copyright (c) 2019 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* +Package agent provides the life-cycle management agent for plugins. It is +intended to be used as a base point of an application used in main package. + +Here is a common example usage: + + func main() { + plugin := myplugin.NewPlugin() + + a := agent.NewAgent( + agent.Plugins(plugin), + ) + if err := a.Run(); err != nil { + log.Fatal(err) + } + } + +Options + +There are various options available to customize agent: + + Version(ver, date, id) - sets version of the program + QuitOnClose(chan) - sets signal used to quit the running agent when closed + QuitSignals(signals) - sets signals used to quit the running agent (default: SIGINT, SIGTERM) + StartTimeout(dur) - sets start timeout (default: 15s) + StopTimeout(dur) - sets stop timeout (default: 5s) + +There are two options for adding plugins to the agent: + + Plugins(...) - adds just single plugins without lookup + AllPlugins(...) - adds plugin along with all of its plugin deps + +*/ +package agent diff --git a/vendor/github.com/ligato/cn-infra/datasync/README.md b/vendor/github.com/ligato/cn-infra/datasync/README.md deleted file mode 100644 index fb860326ce..0000000000 --- a/vendor/github.com/ligato/cn-infra/datasync/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# Concept -Package datasync defines the interfaces for the abstraction -[datasync_api.go](datasync_api.go) -of a data synchronization between app plugins and different backend data -sources (such as data stores, message buses, or RPC-connected clients). - -In this context, data synchronization is about multiple data sets -that need to be synchronized whenever a particular event is published. -The event can be published by: -- database (when particular data was changed); -- by message bus (such as consuming messages from Kafka topics); -- or by RPC clients (when GRPC or REST service call ). - -The data synchronization APIs are centered around watching -and publishing data change events. These events are processed -asynchronously. - -The data handled by one plugin can have references to the data -of another plugin. Therefore, a proper time/order of data -resynchronization between plugins needs to be maintained. The datasync -plugin initiates a full data resync in the same order as the other -plugins have been registered in Init(). - -## Watch data API -Watch data API is used by app plugin (see the following diagram and -the [example](../examples/datasync-plugin)) to: -1. Subscribe channels for data changes using `Watch()`, while being - abstracted from a particular message source (data store, message bus - or RPC) -2. Process full Data RESYNC (startup & fault recovery scenarios). - Feedback is given back to the user of this API (e.g. successful - configuration or an error) via callback. -3. Process Incremental Data CHANGE. This is an optimized variant - of RESYNC, where only the minimal set of changes (deltas) needed - to get in-sync gets propagated to plugins. - Again, feedback to the user of the API (e.g. successful configuration - or an error) is returned via callback. - -![datasync](../docs/imgs/datasync_watch.png) - -This APIs define two types of events that a plugin must be able -to process: -1. Full Data RESYNC (resynchronization) event is defined to trigger - resynchronization of the whole configuration. This event is used - after agent start/restart, or for a fault recovery scenario - (e.g. when agent's connectivity to an external data source is lost - and restored). -2. Incremental Data CHANGE event is defined to trigger incremental - processing of configuration changes. Each data change event contains - both the previous and the new/current value. The Data synchronization - is switched to this optimized mode only after successful Full Data - RESYNC. - -## Publish data API - -Publish data API is used by app plugins to asynchronously publish events -with particular data change values and still remain abstracted from -the target data store, message bus, local/RPC client. - -![datasync publish](../docs/imgs/datasync_pub.png) diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/mac_vppcalls.go b/vendor/github.com/ligato/cn-infra/datasync/kvdbsync/local/doc.go similarity index 51% rename from vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/mac_vppcalls.go rename to vendor/github.com/ligato/cn-infra/datasync/kvdbsync/local/doc.go index 4dcc719437..f668cebb05 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/mac_vppcalls.go +++ b/vendor/github.com/ligato/cn-infra/datasync/kvdbsync/local/doc.go @@ -12,30 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package vpp1810 - -import ( - "net" - - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces" -) - -// SetInterfaceMac implements interface handler. -func (h *InterfaceVppHandler) SetInterfaceMac(ifIdx uint32, macAddress string) error { - mac, err := net.ParseMAC(macAddress) - if err != nil { - return err - } - - req := &interfaces.SwInterfaceSetMacAddress{ - SwIfIndex: ifIdx, - MacAddress: mac, - } - reply := &interfaces.SwInterfaceSetMacAddressReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} +// Package local implements DB Transactions for the local "in memory" +// transport. This implementation uses a collection of transaction items that +// are propagated to registered GO channels. +package local diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/mtu_vppcalls.go b/vendor/github.com/ligato/cn-infra/datasync/kvdbsync/local/global_api.go similarity index 57% rename from vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/mtu_vppcalls.go rename to vendor/github.com/ligato/cn-infra/datasync/kvdbsync/local/global_api.go index 38a1c44d61..2f020c7b6e 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/mtu_vppcalls.go +++ b/vendor/github.com/ligato/cn-infra/datasync/kvdbsync/local/global_api.go @@ -12,23 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -package vpp1810 +package local import ( - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces" + "github.com/ligato/cn-infra/datasync/syncbase" ) -// SetInterfaceMtu implements interface handler. -func (h *InterfaceVppHandler) SetInterfaceMtu(ifIdx uint32, mtu uint32) error { - req := &interfaces.HwInterfaceSetMtu{ - SwIfIndex: ifIdx, - Mtu: uint16(mtu), - } - reply := &interfaces.HwInterfaceSetMtuReply{} +// DefaultRegistry is a default registry. +var DefaultRegistry = syncbase.NewRegistry() - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil +// Get returns the global singleton instance. +func Get() *syncbase.Registry { + // TODO: obsolete, use DefaultRegistry directly instead + return DefaultRegistry } diff --git a/vendor/github.com/ligato/cn-infra/datasync/kvdbsync/local/local_bytes_txn.go b/vendor/github.com/ligato/cn-infra/datasync/kvdbsync/local/local_bytes_txn.go new file mode 100644 index 0000000000..b4e3a78fca --- /dev/null +++ b/vendor/github.com/ligato/cn-infra/datasync/kvdbsync/local/local_bytes_txn.go @@ -0,0 +1,83 @@ +// Copyright (c) 2017 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package local + +import ( + "sync" + + "github.com/ligato/cn-infra/datasync" + "github.com/ligato/cn-infra/datasync/syncbase" + "github.com/ligato/cn-infra/db/keyval" + "context" +) + +// bytesTxnItem is used in BytesTxn. +type bytesTxnItem struct { + data []byte + delete bool +} + +// BytesTxn is just a concurrent map of Bytes messages. +// The intent is to collect the user data and propagate them when commit happens. +type BytesTxn struct { + access sync.Mutex + items map[string]*bytesTxnItem + commit func(context.Context, map[string]datasync.ChangeValue) error +} + +// NewBytesTxn is a constructor. +func NewBytesTxn(commit func(context.Context, map[string]datasync.ChangeValue) error) *BytesTxn { + return &BytesTxn{ + items: make(map[string]*bytesTxnItem), + commit: commit, + } +} + +// Put adds store operation into transaction. +func (txn *BytesTxn) Put(key string, data []byte) keyval.BytesTxn { + txn.access.Lock() + defer txn.access.Unlock() + + txn.items[key] = &bytesTxnItem{data: data} + + return txn +} + +// Delete add delete operation into transaction. +func (txn *BytesTxn) Delete(key string) keyval.BytesTxn { + txn.access.Lock() + defer txn.access.Unlock() + + txn.items[key] = &bytesTxnItem{delete: true} + + return txn +} + +// Commit executes the transaction. +func (txn *BytesTxn) Commit(ctx context.Context) error { + txn.access.Lock() + defer txn.access.Unlock() + + kvs := map[string]datasync.ChangeValue{} + for key, item := range txn.items { + changeType := datasync.Put + if item.delete { + changeType = datasync.Delete + } + + kvs[key] = syncbase.NewChangeBytes(key, item.data, 0, changeType) + } + return txn.commit(ctx, kvs) +} diff --git a/vendor/github.com/ligato/cn-infra/datasync/kvdbsync/local/local_proto_txn.go b/vendor/github.com/ligato/cn-infra/datasync/kvdbsync/local/local_proto_txn.go new file mode 100644 index 0000000000..7a4ed704d7 --- /dev/null +++ b/vendor/github.com/ligato/cn-infra/datasync/kvdbsync/local/local_proto_txn.go @@ -0,0 +1,94 @@ +// Copyright (c) 2017 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package local + +import ( + "context" + "sync" + + "github.com/gogo/protobuf/proto" + "github.com/ligato/cn-infra/datasync" + "github.com/ligato/cn-infra/datasync/syncbase" + "github.com/ligato/cn-infra/db/keyval" +) + +// protoTxnItem is used in ProtoTxn. +type protoTxnItem struct { + data proto.Message + delete bool +} + +// GetValue returns the value of the pair. +func (item *protoTxnItem) GetValue(out proto.Message) error { + if item.data != nil { + proto.Merge(out, item.data) + } + return nil +} + +// ProtoTxn is a concurrent map of proto messages. +// The intent is to collect the user data and propagate them when commit happens. +type ProtoTxn struct { + access sync.Mutex + items map[string]*protoTxnItem + commit func(context.Context, map[string]datasync.ChangeValue) error +} + +// NewProtoTxn is a constructor. +func NewProtoTxn(commit func(context.Context, map[string]datasync.ChangeValue) error) *ProtoTxn { + return &ProtoTxn{ + items: make(map[string]*protoTxnItem), + commit: commit, + } +} + +// Put adds store operation into transaction. +func (txn *ProtoTxn) Put(key string, data proto.Message) keyval.ProtoTxn { + txn.access.Lock() + defer txn.access.Unlock() + + txn.items[key] = &protoTxnItem{data: data} + + return txn +} + +// Delete adds delete operation into transaction. +func (txn *ProtoTxn) Delete(key string) keyval.ProtoTxn { + txn.access.Lock() + defer txn.access.Unlock() + + txn.items[key] = &protoTxnItem{delete: true} + + return txn +} + +// Commit executes the transaction. +func (txn *ProtoTxn) Commit(ctx context.Context) error { + txn.access.Lock() + defer txn.access.Unlock() + + kvs := make(map[string]datasync.ChangeValue, len(txn.items)) + + for key, item := range txn.items { + changeType := datasync.Put + if item.delete { + changeType = datasync.Delete + } + + kvs[key] = syncbase.NewChange(key, item.data, 0, changeType) + } + + return txn.commit(ctx, kvs) +} diff --git a/vendor/github.com/ligato/cn-infra/db/keyval/README.md b/vendor/github.com/ligato/cn-infra/db/keyval/README.md deleted file mode 100644 index 50a743a2f5..0000000000 --- a/vendor/github.com/ligato/cn-infra/db/keyval/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Key-value datastore - -The `keyval` package defines the client API to access a key-value data -store. It comprises two sub-APIs: the `Broker` interface supports reading -and manipulation of key-value pairs; the `Watcher` API provides functions -for monitoring of changes in a data store. Both interfaces are available -with arguments of type `[]bytes` (raw data) and `proto.Message` (protobuf -formatted data). - -The `keyval` package also provides a skeleton for a key-value plugin. -A particular data store is selected in the `NewSkeleton` constructor -using an argument of type `CoreBrokerWatcher`. The skeleton handles -the plugin's life-cycle and provides unified access to datastore -implementing the `KvPlugin` interface. diff --git a/vendor/github.com/ligato/cn-infra/db/keyval/bolt/bolt.go b/vendor/github.com/ligato/cn-infra/db/keyval/bolt/bolt.go index 1222555899..8812024ab0 100644 --- a/vendor/github.com/ligato/cn-infra/db/keyval/bolt/bolt.go +++ b/vendor/github.com/ligato/cn-infra/db/keyval/bolt/bolt.go @@ -49,7 +49,7 @@ type Client struct { updateChan chan *updateTx mu sync.RWMutex - watchers []*prefixWatcher + watchers watchers wg sync.WaitGroup quit chan struct{} @@ -78,6 +78,7 @@ func NewClient(cfg *Config) (client *Client, err error) { cfg: *cfg, quit: make(chan struct{}), updateChan: make(chan *updateTx, UpdatesChannelSize), + watchers: make(watchers), } c.wg.Add(1) @@ -199,17 +200,6 @@ func (c *Client) ListValues(keyPrefix string) (keyval.BytesKeyValIterator, error return &bytesKeyValIterator{len: len(pairs), pairs: pairs}, err } -// Watch watches given list of key prefixes. -func (c *Client) Watch(resp func(keyval.BytesWatchResp), closeChan chan string, keys ...string) error { - boltLogger.Debugf("Watch: %q", keys) - for _, k := range keys { - if err := c.watch(resp, closeChan, k); err != nil { - return err - } - } - return nil -} - // NewTxn creates new transaction func (c *Client) NewTxn() keyval.BytesTxn { return &txn{ diff --git a/vendor/github.com/ligato/cn-infra/db/keyval/bolt/broker.go b/vendor/github.com/ligato/cn-infra/db/keyval/bolt/broker.go index bc87fe5274..12212c4a55 100644 --- a/vendor/github.com/ligato/cn-infra/db/keyval/bolt/broker.go +++ b/vendor/github.com/ligato/cn-infra/db/keyval/bolt/broker.go @@ -17,6 +17,7 @@ package bolt import ( "bytes" "strings" + "sync" "github.com/boltdb/bolt" "github.com/ligato/cn-infra/datasync" @@ -29,10 +30,15 @@ import ( // BrokerWatcher allows defining a keyPrefix that is prepended // to all keys in its methods in order to shorten keys used in arguments. type BrokerWatcher struct { + sync.Mutex *Client - prefix string + + prefix string + prefixedChs prefixedChannels } +type prefixedChannels map[chan string]chan string + // NewBroker creates a new instance of a proxy that provides // access to Bolt. The proxy will reuse the connection from Client. // will be prepended to the key argument in all calls from the created @@ -40,8 +46,9 @@ type BrokerWatcher struct { // an argument. func (c *Client) NewBroker(prefix string) keyval.BytesBroker { return &BrokerWatcher{ - Client: c, - prefix: prefix, + Client: c, + prefix: prefix, + prefixedChs: make(prefixedChannels), } } @@ -52,8 +59,9 @@ func (c *Client) NewBroker(prefix string) keyval.BytesBroker { // an argument. func (c *Client) NewWatcher(prefix string) keyval.BytesWatcher { return &BrokerWatcher{ - Client: c, - prefix: prefix, + Client: c, + prefix: prefix, + prefixedChs: make(prefixedChannels), } } @@ -61,6 +69,36 @@ func (pdb *BrokerWatcher) prefixKey(key string) string { return pdb.prefix + key } +func (pdb *BrokerWatcher) prefixChannel(ch chan string) chan string { + pdb.Lock() + defer pdb.Unlock() + + if pdb.prefix == "" { + return ch + } + + if prefCh, has := pdb.prefixedChs[ch]; has { + return prefCh + } + + origCh := ch + ch = make(chan string) + pdb.prefixedChs[origCh] = ch + go func() { + for { + select { + case key, ok := <-origCh: + if !ok { + close(ch) + return + } + ch <- pdb.prefixKey(key) + } + } + }() + return ch +} + // Put calls 'Put' function of the underlying Client. // KeyPrefix defined in constructor is prepended to the key argument. func (pdb *BrokerWatcher) Put(key string, data []byte, opts ...datasync.PutOption) error { @@ -142,6 +180,7 @@ func (pdb *BrokerWatcher) Watch(resp func(keyval.BytesWatchResp), closeChan chan for _, key := range keys { prefixedKeys = append(prefixedKeys, pdb.prefixKey(key)) } + closeChan = pdb.prefixChannel(closeChan) return pdb.Client.Watch(func(origResp keyval.BytesWatchResp) { r := origResp.(*watchResp) r.key = strings.TrimPrefix(r.key, pdb.prefix) diff --git a/vendor/github.com/ligato/cn-infra/db/keyval/bolt/watch.go b/vendor/github.com/ligato/cn-infra/db/keyval/bolt/watch.go index 29c40f4026..6079777313 100644 --- a/vendor/github.com/ligato/cn-infra/db/keyval/bolt/watch.go +++ b/vendor/github.com/ligato/cn-infra/db/keyval/bolt/watch.go @@ -16,22 +16,27 @@ package bolt import ( "bytes" - "context" "strings" "github.com/ligato/cn-infra/datasync" "github.com/ligato/cn-infra/db/keyval" ) -func (c *Client) bumpWatchers(we *watchEvent) { - c.mu.RLock() - defer c.mu.RUnlock() +type watchEvent struct { + Type datasync.Op + Key string + Value []byte + PrevValue []byte + Revision int64 +} - for _, w := range c.watchers { - if strings.HasPrefix(we.Key, w.prefix) { - w.watchCh <- we - } - } +type watchers map[chan string]*watcher // close channel -> watcher + +type watcher struct { + prefixes []watchPrefix + watchCh chan *watchEvent + closeCh chan string + prefixRegCh chan watchPrefix // for registration of new key prefixes to watch } type watchResp struct { @@ -41,6 +46,25 @@ type watchResp struct { rev int64 } +type watchPrefix struct { + prefix string + cb watchCallback +} + +type watchCallback func(watchResp keyval.BytesWatchResp) + +func (c *Client) bumpWatchers(we *watchEvent) { + c.mu.RLock() + defer c.mu.RUnlock() + + if c.cfg.FilterDupNotifs && bytes.Equal(we.Value, we.PrevValue) { + return + } + for _, w := range c.watchers { + w.watchCh <- we + } +} + // GetChangeType returns "Put" for BytesWatchPutResp. func (resp *watchResp) GetChangeType() datasync.Op { return resp.typ @@ -66,85 +90,102 @@ func (resp *watchResp) GetRevision() int64 { return resp.rev } -func (c *Client) watch(resp func(watchResp keyval.BytesWatchResp), closeCh chan string, prefix string) error { - boltLogger.Debug("watch:", prefix) +// Watch watches given list of key prefixes. +func (c *Client) Watch(resp func(watchResp keyval.BytesWatchResp), closeCh chan string, prefixes ...string) error { + boltLogger.Debugf("watch: %q", prefixes) - ctx, cancel := context.WithCancel(context.Background()) - - recvChan := c.watchPrefix(ctx, prefix) - - go func(regPrefix string) { - defer cancel() - for { - select { - case ev, ok := <-recvChan: - if !ok { - boltLogger.WithField("prefix", prefix). - Debug("Watch recv chan was closed") - return - } - if c.cfg.FilterDupNotifs && bytes.Equal(ev.Value, ev.PrevValue) { - continue - } - r := &watchResp{ - typ: ev.Type, - key: ev.Key, - value: ev.Value, - prevValue: ev.PrevValue, - rev: ev.Revision, - } - resp(r) - case closeVal, ok := <-closeCh: - if !ok || closeVal == regPrefix { - boltLogger.WithField("prefix", prefix). - Debug("Watch ended") - return - } + c.mu.Lock() + defer c.mu.Unlock() + + w, exists := c.watchers[closeCh] + if exists { + // this close channel is already in use + for _, prefix := range prefixes { + w.prefixRegCh <- watchPrefix{ + prefix: prefix, + cb: resp, } } - }(prefix) - - return nil -} + return nil + } -type watchEvent struct { - Type datasync.Op - Key string - Value []byte - PrevValue []byte - Revision int64 -} + // create and register new watcher + w = &watcher{ + prefixes: make([]watchPrefix, len(prefixes)), + watchCh: make(chan *watchEvent, 10), + closeCh: closeCh, + prefixRegCh: make(chan watchPrefix, 10), + } + for i, prefix := range prefixes { + w.prefixes[i] = watchPrefix{ + prefix: prefix, + cb: resp, + } + } + c.watchers[closeCh] = w -type prefixWatcher struct { - prefix string - watchCh chan *watchEvent + go func() { + w.watch() + // un-register when done + c.mu.Lock() + delete(c.watchers, closeCh) + c.mu.Unlock() + }() + return nil } -func (c *Client) watchPrefix(ctx context.Context, prefix string) <-chan *watchEvent { - boltLogger.Debug("watchPrefix:", prefix) - - ch := make(chan *watchEvent, 1) - - c.mu.Lock() - index := len(c.watchers) - c.watchers = append(c.watchers, &prefixWatcher{ - prefix: prefix, - watchCh: ch, - }) - c.mu.Unlock() - - go func() { +func (w *watcher) watch() { + for { select { - case <-ctx.Done(): - c.mu.Lock() - if len(c.watchers) == index+1 { - c.watchers = c.watchers[:index] - } else { - c.watchers = append(c.watchers[:index], c.watchers[index+1:]...) + case ev, ok := <-w.watchCh: + if !ok { + boltLogger.WithField("prefixes", w.prefixes). + Debug("Watch channel was closed") + return } - c.mu.Unlock() - } - }() + var cb watchCallback + for _, wp := range w.prefixes { + if strings.HasPrefix(ev.Key, wp.prefix) { + cb = wp.cb + break + } + } + if cb == nil { + // key not watched by this watcher + continue + } + r := &watchResp{ + typ: ev.Type, + key: ev.Key, + value: ev.Value, + prevValue: ev.PrevValue, + rev: ev.Revision, + } + cb(r) - return ch -} + case regPrefix, ok := <- w.prefixRegCh: + if !ok { + boltLogger.WithField("prefixes", w.prefixes). + Debug("Prefix-registration channel was closed") + return + } + w.prefixes = append(w.prefixes, regPrefix) + boltLogger.WithField("prefixes", w.prefixes).Debug( + "The set of watched prefixes was extended") + + case closeVal, ok := <-w.closeCh: + if !ok { + boltLogger.WithField("prefixes", w.prefixes).Debug("Watch ended") + return + } + for i, wp := range w.prefixes { + if wp.prefix == closeVal { + boltLogger.WithField("prefix", wp.prefix).Debug("Watch ended") + w.prefixes[i] = w.prefixes[len(w.prefixes)-1] + w.prefixes = w.prefixes[:len(w.prefixes)-1] + break + } + } + } + } +} \ No newline at end of file diff --git a/vendor/github.com/ligato/cn-infra/db/keyval/etcd/README.md b/vendor/github.com/ligato/cn-infra/db/keyval/etcd/README.md deleted file mode 100644 index 0cbc7b879f..0000000000 --- a/vendor/github.com/ligato/cn-infra/db/keyval/etcd/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Etcd plugin - -The Etcd plugin provides access to an etcd key-value data store. - -## Configuration - -- Location of the Etcd configuration file can be defined either by the - command line flag `etcd-config` or set via the `ETCD_CONFIG` - environment variable. - -## Status Check - -- If injected, Etcd plugin will use StatusCheck plugin to periodically - issue a minimalistic GET request to check for the status - of the connection. - The etcd connection state affects the global status of the agent. - If agent cannot establish connection with etcd, both the readiness - and the liveness probe from the [probe plugin](../../../health/probe) - will return a negative result (accessible only via REST API in such - case). - -## Compacting - -You can compact Etcd using two ways. - -- using API by calling `plugin.Compact()` which will compact the database - to the current revision. -- using config file by setting `auto-compact` option to the duration of - period that you want the Etcd to be compacted. - -## Reconnect resynchronization - -- If connection to the ETCD is interrupted, resync can be automatically called - after re-connection. This option is disabled by default and has to be allowed - in the `etcd.conf` file. - - Set `resync-after-reconnect` to `true` to enable the feature. diff --git a/vendor/github.com/ligato/cn-infra/health/statuscheck/README.md b/vendor/github.com/ligato/cn-infra/health/statuscheck/README.md deleted file mode 100644 index fb8768f258..0000000000 --- a/vendor/github.com/ligato/cn-infra/health/statuscheck/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# Concept - -The `statuscheck` infrastructure plugin monitors the overall status of a -CN-Infra based app by collecting and aggregating partial statuses -of agents plugins. -The status is exposed to external clients via [ETCD - datasync](../../datasync) -and [HTTP](../../rpc/rest), as shown in the following diagram: - -![status check](../../docs/imgs/status_check.png) - -For more detailed description see the godoc (especially [doc.go](doc.go)). - -## Overall Agent Status - -The overall Agent Status is aggregated from all Plugins' Status (logical -AND for each Plugin Status success/error). - -The agent's current overall status can be retrieved from ETCD from the -following key: `/vnf-agent//check/status` - -``` -$ etcdctl get /vnf-agent//check/status/v1/agent -/vnf-agent//check/status/v1/agent -{"build_version":"e059fdfcd96565eb976a947b59ce56cfb7b1e8a0","build_date":"2017-06-16.14:59","state":1,"start_time":1497617981,"last_change":1497617981,"last_update":1497617991} -``` - -To verify the agent status via HTTP (e.g. for Kubernetes -[liveness and readiness probes][1], use the `/liveness` and `/readiness` -URLs: -``` -$ curl -X GET http://localhost:9191/liveness -{"build_version":"e059fdfcd96565eb976a947b59ce56cfb7b1e8a0","build_date":"2017-06-16.14:59","state":1,"start_time":1497617981,"last_change":1497617981,"last_update":1497617991} -$ curl -X GET http://localhost:9191/readiness -{"build_version":"e059fdfcd96565eb976a947b59ce56cfb7b1e8a0","build_date":"2017-06-16.14:59","state":1,"start_time":1497617981,"last_change":1497617981,"last_update":1497617991} -``` - -To change the HTTP server port (default `9191`), use the `http-port` -option of the agent, e.g.: -``` -$ vpp-agent -http-port 9090 -``` - -## Plugin Status - -Plugin may use `PluginStatusWriter.ReportStateChange` API to **PUSH** -the status information at any time. For optimum performance, -'statuscheck' will then propagate the status report further to external -clients only if it has changed since the last update. - -Alternatively, plugin may chose to use the **PULL** based approach and -define the `probe` function passed to `PluginStatusWriter.Register` API. -`statuscheck` will then periodically probe the plugin for the current -status. Once again, the status is propagated further only if it has -changed since the last enquiry. - -It is recommended not to mix the PULL and the PUSH based approach -within the same plugin. - -To retrieve the current status of a plugin from ETCD, use the following -key template: `/vnf-agent//check/status/v1/plugin/` - -For example, to retrieve the status of the GoVPP plugin, use: - -``` -$ etcdctl get /vnf-agent//check/status/v1/plugin/GOVPP -/vnf-agent//check/status/v1/plugin/GOVPP -{"state":2,"last_change":1496322205,"last_update":1496322361,"error":"VPP disconnected"} -``` - -### PUSH Plugin Status: -![status check pull](../../docs/imgs/status_check_push.png) - -### PULL Plugins Status - PROBING: -![status check push](../../docs/imgs/status_check_pull.png) - - -[1]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/ \ No newline at end of file diff --git a/vendor/github.com/ligato/cn-infra/idxmap/README.md b/vendor/github.com/ligato/cn-infra/idxmap/README.md deleted file mode 100644 index b63d5ba468..0000000000 --- a/vendor/github.com/ligato/cn-infra/idxmap/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Concept - -The idxmap package provides an enhanced mapping structure to help in -the following use cases: -* Exposing read-only access to plugin local data for other plugins -* Secondary indexing -* Data caching for key-value store (such as etcd) - -For more detailed description see the godoc. - -## Exposing plugin local information Use Case -App plugins often need to expose some structured information to other -plugins inside the agent (see the following diagram). - -Structured data stored in idxmap are available for (possibly concurrent) -read access to other plugins: -1. either via lookup using primary keys or secondary indices; -2. or via watching for data changes in the map using channels - or callbacks (subscribe for changes and receive notification once - an item is added, changed or removed). - -TODO: remove "\<\\>" string from the image - -![idxmap local](../docs/imgs/idxmap_local.png) - -## Caching Use Case -It is useful to have the data from a key-value store cached when -you need to: -- minimize the number of lookups into the key-value store -- execute lookups by secondary indexes for key-value stores that - do not necessarily support secondary indexing (e.g. etcd) - -[CacheHelper](mem/cache_helper.go) turns `idxmap` (injected as field -`IDX`) into an indexed local copy of remotely stored key-value data. -`CacheHelper` watches the target key-value store for data changes -and resync events. Received key-value pairs are transformed into -the name-value (+ secondary indices if defined) pairs and stored into -the injected idxmap instance. -For a visual explanation, see the diagram below: - - -![idxmap cache](../docs/imgs/idxmap_cache.png) - -Packages that [use index map](https://godoc.org/github.com/ligato/cn-infra/idxmap?importers). -The constructor that combines `CacheHelper` with `idxmap` to build the cache from the example -can be found there as well. - -## Examples -* Isolated and simplified examples can be found here: - * [lookup](https://github.com/ligato/vpp-agent/tree/master/examples/idx_mapping_lookup) - * [watch](https://github.com/ligato/vpp-agent/tree/master/examples/idx_mapping_watcher) - diff --git a/vendor/github.com/ligato/cn-infra/infra/infra.go b/vendor/github.com/ligato/cn-infra/infra/infra.go index 2bd5019e21..93309f51d9 100644 --- a/vendor/github.com/ligato/cn-infra/infra/infra.go +++ b/vendor/github.com/ligato/cn-infra/infra/infra.go @@ -1,3 +1,18 @@ +// Copyright (c) 2019 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package infra provides Plugin interface and related utilities. package infra import ( diff --git a/vendor/github.com/ligato/cn-infra/logging/README.md b/vendor/github.com/ligato/cn-infra/logging/README.md deleted file mode 100644 index 10ffe267cf..0000000000 --- a/vendor/github.com/ligato/cn-infra/logging/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Logging - -The package defines the logging API used in CN-Infra. The default logger -implementation is based on the Logrus library. \ No newline at end of file diff --git a/vendor/github.com/ligato/cn-infra/logging/logmanager/README.md b/vendor/github.com/ligato/cn-infra/logging/logmanager/README.md deleted file mode 100644 index 5d97a73277..0000000000 --- a/vendor/github.com/ligato/cn-infra/logging/logmanager/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Log Manager - -Log manager plugin allows to view and modify log levels of loggers using REST API. - -**API** -- List all registered loggers: - - ```curl -X GET http://:/log/list``` -- Set log level for a registered logger: - ```curl -X PUT http://:/log//``` - - `` is one of `debug`,`info`,`warning`,`error`,`fatal`,`panic` - -`` and `` are determined by configuration of rest.Plugin. - -**Config file** - -- Logger config file is composed of two parts: the default level applied for all plugins, - and a map where every logger can have its own log level defined. See config file - [example](../logging.conf) to learn how to define it. - - **Note:** initial log level can be set using environmental variable `INITIAL_LOGLVL`. The - variable replaces default-level from configuration file. However, loggers (partial definition) - replace default value set by environmental variable for specific loggers defined. - \ No newline at end of file diff --git a/vendor/github.com/ligato/cn-infra/logging/logrus/README.md b/vendor/github.com/ligato/cn-infra/logging/logrus/README.md deleted file mode 100644 index 0545f14fac..0000000000 --- a/vendor/github.com/ligato/cn-infra/logging/logrus/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Logrus plugin - -Package logrus is the Logrus-based implementation of [logging API](../log_api.go). diff --git a/vendor/github.com/ligato/cn-infra/logging/measure/README.md b/vendor/github.com/ligato/cn-infra/logging/measure/README.md deleted file mode 100644 index 82dcab8d75..0000000000 --- a/vendor/github.com/ligato/cn-infra/logging/measure/README.md +++ /dev/null @@ -1,14 +0,0 @@ -## Tracer - -A simple utility able to log measured time periods various events. To create a new tracer, call: - -`t := NewTracer(name string, log logging.Logger)` - -Tracer object can store a new entry with `t.LogTime(entity string, start Time)` where `entity` is a string -representation of a measured object (name of a function, structure or just simple string) and `start` is a start time. - -Tracer can measure repeating event (in a loop for example). Every event will be stored with the particular index. - -Use `t.Get()` to read all measurements. The Trace object contains a list of entries and overall time duration. - -Last method is `t.Clear()` which removes all entries from the internal database. \ No newline at end of file diff --git a/vendor/github.com/ligato/cn-infra/processmanager/README.md b/vendor/github.com/ligato/cn-infra/processmanager/README.md deleted file mode 100644 index f6408fba74..0000000000 --- a/vendor/github.com/ligato/cn-infra/processmanager/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# Process manager - -The process manager plugin provides a set of methods to create a plugin-defined processes instance implementing a set -of methods to manage and monitor them. - -There are several ways how to obtain a process instance via `ProcessManager` API: - -**New process with options:** using method `NewProcess(, ...)` which requires a command -and a set of optional parameters. -**New process from template:** using method `NewProcessFromTemplate()` which requires template as a parameter -**Attach to existing process:** using method `AttachProcess()`. The process ID is required to order to attach. - -## Management - -Note: since application (management plugin) is parent of all processes, application termination causes all -started processes to stop as well. This can be changed with *Detach* option (see process options). - -Process management methods: - -* `Start()` starts the plugin-defined process, stores the instance and does initial status file read -* `Restart()` tries to gracefully stop (force stop if fails) the process and starts it again. If the instance -is not running, it is started. -* `Stop()` stops the instance using SIGTERM signal. Process is not guaranteed to be stopped. Note that -child processes (not detached) may end up as defunct if stopped this way. -* `StopAndWait()` stops the instance using SIGTERM signal and waits until the process completes. -* `Kill()` force-stops the process using SIGKILL signal and releases all the resources used. -* `Wait()` waits until the process completes. -* `Signal()` allows user to send custom signal to a process. Note that some signals may cause unexpected -behavior in process handling. - -Process monitor methods: - -* `IsAlive()` returns true if process is running -* `GetNotificationChan()` returns channel where process status notifications will be sent. Useful when a process -is created via template with 'notify' field set to true. In other cases, the channel is provided by user. -* `GetName` returns process name as defined in status file -* `GetPid()` returns process ID -* `UpdateStatus()` updates internal status of the plugin and returns the actual status file -* `GetCommand()` returns original process command. Always empty for attached processes. -* `GetArguments()` returns original arguments the process was run with. Always empty for attached processes. -* `GetStartTime()` returns time stamp when the process was started for the last time -* `GetUpTime()` returns process up-time in nanoseconds - -## Status watcher - -Every process is watched for status changes (it does not matter which way it was crated) despite the process -is running or not. The watcher uses standard statuses (running, sleeping, idle, etc.). The state is read -from process status file and every change is reported. The plugin also defines two plugin-wide statues: -* **Initial** - only for newly created processes, means that the process command was defined but not started yet -* **Terminated** - if the process is not running or does not respond -* **Unavailable** - if the process is running but the status cannot be obtained -The process status is periodically polled and notifications can be sent to the user defined channel. In case -process was crated via template, channel was initialized in the plugin and can be obtained via `GetNotificationChan()`. - -## Process options - -Following options are available for processes. All options can be defined in the API method as well as in the template. -All of them are optional. - -**Args:** takes string array as parameter, process will be started with given arguments. -**Restarts:** takes a number as a parameter, defines count of automatic restarts when the process -state becomes terminated. -**Writer** allows to define custom `stdOut` and `stdErr` values. Note: usability is limited when defined via template (only standard `os.stdout` and `os.stderr` can be used) -**Detach:** no parameters, started process detaches from the parent application and will be given to current user. -This setting allows the process to run even after the parent was terminated. -**EnvVar** can be used to define environment variables (for example `os.Environ` for all) -**Template:** requires name, and run-on-startup flag. This setup creates a template on process creation. -The template path has to be set in the plugin. -**Notify:** allows user to provide a notification channel for status changes. - -## Templates - -The template is a file which defines process configuration for plugin manager. All templates should be stored -in the path defined in the plugin config file. Example can be found [here](pm.conf). - -``` -./process-manager-plugin -process-manager-config= -``` - -The template can be either written by hand using -[proto model](template/model/process/process.proto), or generated with the *Template* option while creating a new -process. - -On the plugin init, all templates are read, and those with *run-on-startup* set to 'true' are also immediately started. -The template contains several fields defining process name, command, arguments and all the other fields from options. - -The plugin API allows to read templates directly with `GetTemplate(///", where 'd' stands for domain (max ffff), 'b' is bus (max ff), -// 's' is slot (max 1f) and 'f is function' (max 7). All values are base 16 +//name is in format "vmxnet3-///", where 'd' stands for domain (max ffff), 'b' is bus (max ff), +//'s' is slot (max 1f) and 'f is function' (max 7). All values are base 16 type VmxNet3Link struct { EnableElog bool `protobuf:"varint,2,opt,name=enable_elog,json=enableElog,proto3" json:"enable_elog,omitempty"` RxqSize uint32 `protobuf:"varint,3,opt,name=rxq_size,json=rxqSize,proto3" json:"rxq_size,omitempty"` @@ -1337,7 +1359,7 @@ func (m *VmxNet3Link) Reset() { *m = VmxNet3Link{} } func (m *VmxNet3Link) String() string { return proto.CompactTextString(m) } func (*VmxNet3Link) ProtoMessage() {} func (*VmxNet3Link) Descriptor() ([]byte, []int) { - return fileDescriptor_interface_5716be75ac69639b, []int{7} + return fileDescriptor_1ac7cab935c1dc4d, []int{7} } func (m *VmxNet3Link) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_VmxNet3Link.Unmarshal(m, b) @@ -1345,8 +1367,8 @@ func (m *VmxNet3Link) XXX_Unmarshal(b []byte) error { func (m *VmxNet3Link) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_VmxNet3Link.Marshal(b, m, deterministic) } -func (dst *VmxNet3Link) XXX_Merge(src proto.Message) { - xxx_messageInfo_VmxNet3Link.Merge(dst, src) +func (m *VmxNet3Link) XXX_Merge(src proto.Message) { + xxx_messageInfo_VmxNet3Link.Merge(m, src) } func (m *VmxNet3Link) XXX_Size() int { return xxx_messageInfo_VmxNet3Link.Size(m) @@ -1396,7 +1418,7 @@ func (m *BondLink) Reset() { *m = BondLink{} } func (m *BondLink) String() string { return proto.CompactTextString(m) } func (*BondLink) ProtoMessage() {} func (*BondLink) Descriptor() ([]byte, []int) { - return fileDescriptor_interface_5716be75ac69639b, []int{8} + return fileDescriptor_1ac7cab935c1dc4d, []int{8} } func (m *BondLink) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BondLink.Unmarshal(m, b) @@ -1404,8 +1426,8 @@ func (m *BondLink) XXX_Unmarshal(b []byte) error { func (m *BondLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_BondLink.Marshal(b, m, deterministic) } -func (dst *BondLink) XXX_Merge(src proto.Message) { - xxx_messageInfo_BondLink.Merge(dst, src) +func (m *BondLink) XXX_Merge(src proto.Message) { + xxx_messageInfo_BondLink.Merge(m, src) } func (m *BondLink) XXX_Size() int { return xxx_messageInfo_BondLink.Size(m) @@ -1461,7 +1483,7 @@ func (m *BondLink_BondedInterface) Reset() { *m = BondLink_BondedInterfa func (m *BondLink_BondedInterface) String() string { return proto.CompactTextString(m) } func (*BondLink_BondedInterface) ProtoMessage() {} func (*BondLink_BondedInterface) Descriptor() ([]byte, []int) { - return fileDescriptor_interface_5716be75ac69639b, []int{8, 0} + return fileDescriptor_1ac7cab935c1dc4d, []int{8, 0} } func (m *BondLink_BondedInterface) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BondLink_BondedInterface.Unmarshal(m, b) @@ -1469,8 +1491,8 @@ func (m *BondLink_BondedInterface) XXX_Unmarshal(b []byte) error { func (m *BondLink_BondedInterface) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_BondLink_BondedInterface.Marshal(b, m, deterministic) } -func (dst *BondLink_BondedInterface) XXX_Merge(src proto.Message) { - xxx_messageInfo_BondLink_BondedInterface.Merge(dst, src) +func (m *BondLink_BondedInterface) XXX_Merge(src proto.Message) { + xxx_messageInfo_BondLink_BondedInterface.Merge(m, src) } func (m *BondLink_BondedInterface) XXX_Size() int { return xxx_messageInfo_BondLink_BondedInterface.Size(m) @@ -1506,6 +1528,12 @@ func (*BondLink_BondedInterface) XXX_MessageName() string { return "vpp.interfaces.BondLink.BondedInterface" } func init() { + proto.RegisterEnum("vpp.interfaces.Interface_Type", Interface_Type_name, Interface_Type_value) + proto.RegisterEnum("vpp.interfaces.Interface_RxModeSettings_RxModeType", Interface_RxModeSettings_RxModeType_name, Interface_RxModeSettings_RxModeType_value) + proto.RegisterEnum("vpp.interfaces.SubInterface_TagRewriteOptions", SubInterface_TagRewriteOptions_name, SubInterface_TagRewriteOptions_value) + proto.RegisterEnum("vpp.interfaces.MemifLink_MemifMode", MemifLink_MemifMode_name, MemifLink_MemifMode_value) + proto.RegisterEnum("vpp.interfaces.BondLink_Mode", BondLink_Mode_name, BondLink_Mode_value) + proto.RegisterEnum("vpp.interfaces.BondLink_LoadBalance", BondLink_LoadBalance_name, BondLink_LoadBalance_value) proto.RegisterType((*Interface)(nil), "vpp.interfaces.Interface") proto.RegisterType((*Interface_Unnumbered)(nil), "vpp.interfaces.Interface.Unnumbered") proto.RegisterType((*Interface_RxModeSettings)(nil), "vpp.interfaces.Interface.RxModeSettings") @@ -1519,136 +1547,131 @@ func init() { proto.RegisterType((*VmxNet3Link)(nil), "vpp.interfaces.VmxNet3Link") proto.RegisterType((*BondLink)(nil), "vpp.interfaces.BondLink") proto.RegisterType((*BondLink_BondedInterface)(nil), "vpp.interfaces.BondLink.BondedInterface") - proto.RegisterEnum("vpp.interfaces.Interface_Type", Interface_Type_name, Interface_Type_value) - proto.RegisterEnum("vpp.interfaces.Interface_RxModeSettings_RxModeType", Interface_RxModeSettings_RxModeType_name, Interface_RxModeSettings_RxModeType_value) - proto.RegisterEnum("vpp.interfaces.SubInterface_TagRewriteOptions", SubInterface_TagRewriteOptions_name, SubInterface_TagRewriteOptions_value) - proto.RegisterEnum("vpp.interfaces.MemifLink_MemifMode", MemifLink_MemifMode_name, MemifLink_MemifMode_value) - proto.RegisterEnum("vpp.interfaces.BondLink_Mode", BondLink_Mode_name, BondLink_Mode_value) - proto.RegisterEnum("vpp.interfaces.BondLink_LoadBalance", BondLink_LoadBalance_name, BondLink_LoadBalance_value) } func init() { - proto.RegisterFile("models/vpp/interfaces/interface.proto", fileDescriptor_interface_5716be75ac69639b) -} - -var fileDescriptor_interface_5716be75ac69639b = []byte{ - // 1883 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0xdd, 0x72, 0xdb, 0xc6, - 0x15, 0x16, 0x7f, 0x24, 0x92, 0x87, 0x3f, 0x82, 0xd7, 0x71, 0x03, 0x2b, 0x76, 0xa2, 0xb2, 0x69, - 0xa3, 0x69, 0xc7, 0x92, 0x45, 0x65, 0xa6, 0x99, 0xf6, 0x0a, 0x14, 0xa1, 0x9a, 0x31, 0x45, 0xa2, - 0x20, 0x68, 0x3b, 0x9d, 0xce, 0x60, 0x40, 0x60, 0x09, 0x6d, 0x05, 0x02, 0x30, 0x76, 0x49, 0x53, - 0x99, 0xe9, 0x33, 0xf4, 0x5d, 0xfa, 0x04, 0xbd, 0xec, 0x45, 0x5f, 0xa0, 0xd7, 0xbd, 0xec, 0x55, - 0xa6, 0x2f, 0xd0, 0xd9, 0x1f, 0x82, 0xd4, 0x8f, 0x33, 0xb9, 0xe1, 0xec, 0x7e, 0xe7, 0x7c, 0x67, - 0x97, 0x67, 0xcf, 0x1f, 0xe0, 0x97, 0xf3, 0x24, 0xc0, 0x11, 0x3d, 0x59, 0xa6, 0xe9, 0x09, 0x89, - 0x19, 0xce, 0x66, 0x9e, 0x8f, 0xe9, 0x66, 0x79, 0x9c, 0x66, 0x09, 0x4b, 0x50, 0x6b, 0x99, 0xa6, - 0xc7, 0x1b, 0xf9, 0xc1, 0x8b, 0x90, 0xb0, 0xab, 0xc5, 0xf4, 0xd8, 0x4f, 0xe6, 0x27, 0x61, 0x12, - 0x26, 0x27, 0x42, 0x6d, 0xba, 0x98, 0x89, 0x9d, 0xd8, 0x88, 0x95, 0xa4, 0x1f, 0x3c, 0xdb, 0x3e, - 0x25, 0xa5, 0xd8, 0x97, 0xbf, 0x52, 0xda, 0xfe, 0xa1, 0x0e, 0xb5, 0xfe, 0xda, 0x36, 0x42, 0x50, - 0x8e, 0xbd, 0x39, 0xd6, 0x0b, 0x87, 0x85, 0xa3, 0x9a, 0x2d, 0xd6, 0xa8, 0x03, 0x65, 0x76, 0x93, - 0x62, 0xbd, 0x78, 0x58, 0x38, 0x6a, 0x75, 0x3e, 0x3f, 0xbe, 0x7d, 0x9b, 0xe3, 0x9c, 0x7c, 0xec, - 0xdc, 0xa4, 0xd8, 0x16, 0xba, 0x48, 0x87, 0x0a, 0x8e, 0xbd, 0x69, 0x84, 0x03, 0xbd, 0x74, 0x58, - 0x38, 0xaa, 0xda, 0xeb, 0x2d, 0xfa, 0x39, 0x34, 0xd2, 0xab, 0x1b, 0xea, 0x7a, 0x41, 0x90, 0x61, - 0x4a, 0xf5, 0xb2, 0x38, 0xa9, 0xce, 0x31, 0x43, 0x42, 0x5c, 0x85, 0xa4, 0x6b, 0x05, 0x4c, 0xf5, - 0xdd, 0xc3, 0x12, 0x57, 0x21, 0xa9, 0xb1, 0x86, 0x90, 0x06, 0xa5, 0x65, 0x36, 0xd3, 0xf7, 0x0e, - 0x0b, 0x47, 0x4d, 0x9b, 0x2f, 0xd1, 0xaf, 0x60, 0x9f, 0x62, 0xe6, 0x06, 0x57, 0x7e, 0xea, 0xfa, - 0x11, 0xc1, 0x31, 0xd3, 0x2b, 0xe2, 0xe4, 0x26, 0xc5, 0xac, 0x77, 0xe5, 0xa7, 0xe7, 0x02, 0xe4, - 0xcc, 0x39, 0x5b, 0xe8, 0x55, 0xc9, 0x9c, 0xb3, 0x05, 0xea, 0x01, 0x2c, 0xe2, 0x78, 0x31, 0x9f, - 0xe2, 0x0c, 0x07, 0x7a, 0xed, 0xb0, 0x70, 0x54, 0xef, 0x7c, 0xf9, 0xf1, 0x7f, 0x39, 0xc9, 0x75, - 0xed, 0x2d, 0x1e, 0xb2, 0x41, 0xcb, 0x56, 0x2e, 0x77, 0xb5, 0x4b, 0x31, 0x63, 0x24, 0x0e, 0xa9, - 0x0e, 0xc2, 0xd6, 0xd1, 0xc7, 0x6d, 0xd9, 0xab, 0xcb, 0x24, 0xc0, 0x63, 0xa5, 0x6f, 0xb7, 0xb2, - 0x5b, 0x7b, 0xe4, 0xc1, 0x93, 0x6c, 0xe5, 0xa6, 0x91, 0xe7, 0xe3, 0x39, 0x8e, 0xd9, 0xc6, 0x70, - 0x5d, 0x18, 0x7e, 0xf1, 0x63, 0x86, 0xad, 0x35, 0x2b, 0xb7, 0xfe, 0x38, 0xbb, 0x0f, 0xa2, 0x97, - 0x50, 0xa2, 0x8b, 0xa9, 0x1e, 0x08, 0x83, 0xcf, 0xee, 0x1a, 0x1c, 0x2f, 0xa6, 0xb9, 0xcd, 0x57, - 0x3b, 0x36, 0x57, 0x45, 0xa7, 0xb0, 0x3b, 0xc7, 0x73, 0x32, 0xd3, 0xb1, 0xe0, 0x3c, 0xbd, 0xcb, - 0xb9, 0xe4, 0xc2, 0x01, 0x89, 0xaf, 0x5f, 0xed, 0xd8, 0x52, 0x13, 0xfd, 0x0e, 0xaa, 0xde, 0x2c, - 0xf5, 0xfc, 0x6b, 0xcc, 0xf4, 0xd9, 0xc3, 0x27, 0x19, 0x4a, 0xae, 0x88, 0xb9, 0x3e, 0xfa, 0x0d, - 0x94, 0x98, 0x97, 0xea, 0xa1, 0xa0, 0x7d, 0x7a, 0x97, 0xe6, 0x78, 0xa9, 0x62, 0x70, 0x2d, 0x7e, - 0xb7, 0xe5, 0x2a, 0xf2, 0x62, 0xfd, 0xea, 0xe1, 0xbb, 0xbd, 0xe1, 0xc2, 0xf5, 0xdd, 0x84, 0x26, - 0xa7, 0x88, 0x74, 0xd0, 0xc9, 0xc3, 0x94, 0xbe, 0x35, 0xc6, 0xfe, 0x9a, 0x22, 0x34, 0xd1, 0x37, - 0x50, 0x5d, 0xce, 0x57, 0x6e, 0x8c, 0xd9, 0x99, 0xfe, 0x17, 0xc1, 0xfa, 0xec, 0xde, 0x41, 0xf3, - 0xd5, 0x10, 0xb3, 0x33, 0xc5, 0xab, 0x2c, 0xe5, 0x16, 0x1d, 0x43, 0x79, 0x9a, 0xc4, 0x81, 0x7e, - 0x2d, 0x58, 0xfa, 0x5d, 0x56, 0x37, 0x89, 0x03, 0x45, 0x11, 0x7a, 0x07, 0xdf, 0x00, 0x6c, 0xc2, - 0x0d, 0xfd, 0x1a, 0x1e, 0xe5, 0xca, 0xee, 0x07, 0xc2, 0xae, 0x5c, 0x92, 0xaa, 0x4c, 0xdd, 0xcf, - 0x05, 0x6f, 0x09, 0xbb, 0xea, 0xa7, 0x07, 0x3f, 0x14, 0xa0, 0x75, 0x3b, 0xba, 0xd0, 0x00, 0x2a, - 0x2a, 0x42, 0x05, 0xa9, 0xd5, 0x39, 0xfb, 0xa9, 0x81, 0xa9, 0xb6, 0x22, 0xbf, 0xf7, 0x64, 0x8c, - 0xa2, 0xa7, 0x50, 0x7d, 0xbf, 0xc0, 0x0b, 0xec, 0x92, 0x40, 0x54, 0x86, 0xa6, 0x5d, 0x11, 0xfb, - 0x7e, 0x80, 0xbe, 0x84, 0xd6, 0x5a, 0xe4, 0x2e, 0xbd, 0x88, 0xc8, 0x1a, 0xd0, 0xb4, 0x1b, 0x4a, - 0xe1, 0x0d, 0xc7, 0xda, 0x16, 0xc0, 0xc6, 0x2c, 0xaa, 0x43, 0x65, 0x32, 0x7c, 0x3d, 0x1c, 0xbd, - 0x1d, 0x6a, 0x3b, 0x7c, 0x63, 0x8d, 0x06, 0x83, 0xfe, 0xf0, 0x0f, 0x5a, 0x01, 0x35, 0xa1, 0xd6, - 0x1f, 0x3a, 0xa6, 0x6d, 0x4f, 0x2c, 0x47, 0x2b, 0xa2, 0x06, 0x54, 0x8d, 0x9e, 0x61, 0x39, 0xfd, - 0x37, 0xa6, 0x56, 0xe2, 0x9a, 0x3d, 0xf3, 0xc2, 0x98, 0x0c, 0x1c, 0xad, 0x7c, 0xf0, 0x67, 0x78, - 0xfc, 0x40, 0xdc, 0xa3, 0x4f, 0x60, 0x57, 0x1c, 0x2c, 0xfe, 0x75, 0xd3, 0x96, 0x1b, 0xf4, 0x33, - 0xd8, 0xfb, 0x90, 0x64, 0xd7, 0x38, 0x53, 0xb7, 0x57, 0x3b, 0xf4, 0x29, 0x54, 0x08, 0x75, 0xe7, - 0x1e, 0x89, 0x55, 0xe5, 0xda, 0x23, 0xf4, 0xd2, 0x23, 0x71, 0xfb, 0x1f, 0x05, 0x28, 0x8b, 0xab, - 0x22, 0x68, 0x4d, 0x86, 0x3d, 0xf3, 0xa2, 0x3f, 0x34, 0x7b, 0xae, 0xf3, 0x9d, 0x65, 0x6a, 0x3b, - 0xe8, 0x11, 0x34, 0xc7, 0x93, 0xae, 0x2b, 0x2e, 0x7a, 0x61, 0x9c, 0x9b, 0x5a, 0x01, 0x3d, 0x81, - 0x47, 0xe3, 0xd1, 0x85, 0xf3, 0xd6, 0xb0, 0x4d, 0x77, 0x30, 0x1a, 0x59, 0x5d, 0xe3, 0xfc, 0xb5, - 0x56, 0x44, 0x55, 0x28, 0xf7, 0xac, 0xde, 0x6b, 0xad, 0x84, 0x6a, 0xb0, 0x7b, 0x69, 0x5e, 0xf6, - 0x2f, 0xb4, 0x32, 0xaa, 0x40, 0xc9, 0x31, 0x2c, 0x6d, 0x97, 0xff, 0x59, 0xe3, 0xc2, 0xb5, 0x8c, - 0xf3, 0xd7, 0xa6, 0xa3, 0xed, 0x21, 0x0d, 0x1a, 0x6f, 0xde, 0x0d, 0x8c, 0xa1, 0xeb, 0x4c, 0x86, - 0x43, 0x73, 0xa0, 0x55, 0x38, 0xd2, 0xb7, 0xc6, 0xe6, 0xf9, 0x1a, 0xa9, 0xf2, 0x73, 0xde, 0x5c, - 0xbe, 0x1b, 0x9a, 0xce, 0xd9, 0xd6, 0xf1, 0x35, 0x7e, 0xcb, 0xee, 0x68, 0xd8, 0xdb, 0xc2, 0xa0, - 0xbb, 0x07, 0xe5, 0x88, 0xc4, 0xd7, 0xed, 0xff, 0x15, 0xa1, 0xb1, 0x9d, 0xda, 0xe8, 0x0b, 0xa8, - 0xa7, 0x5e, 0xc6, 0x4b, 0xcc, 0x56, 0xf5, 0x07, 0x09, 0x0d, 0x79, 0x0f, 0x78, 0x02, 0x7b, 0x74, - 0x31, 0xdd, 0xbc, 0xf5, 0x2e, 0x5d, 0x4c, 0xfb, 0xbc, 0xe8, 0x35, 0x99, 0x17, 0xba, 0xd9, 0x07, - 0x37, 0x49, 0x19, 0x49, 0xa4, 0xcb, 0x5a, 0x9d, 0xe3, 0x1f, 0xab, 0x23, 0xc7, 0x8e, 0x17, 0xda, - 0xf8, 0x43, 0x46, 0x18, 0x1e, 0x09, 0x12, 0xb5, 0xeb, 0xcc, 0x0b, 0xed, 0x0f, 0x72, 0x87, 0x9e, - 0x03, 0xa4, 0x0b, 0x7a, 0xe5, 0x06, 0x09, 0x3b, 0x7d, 0x2f, 0xda, 0x43, 0xd5, 0xae, 0x71, 0xa4, - 0xc7, 0x01, 0xde, 0xa1, 0x98, 0x17, 0x9e, 0xea, 0xbb, 0xe2, 0x1e, 0x62, 0xad, 0xb0, 0x8e, 0x6a, - 0x07, 0x62, 0xdd, 0xfe, 0x5b, 0x01, 0x1e, 0xdd, 0x3b, 0x89, 0x47, 0x4f, 0xaf, 0x3f, 0x36, 0xba, - 0x03, 0xb3, 0xa7, 0xed, 0xf0, 0x17, 0xb0, 0x26, 0xe3, 0x57, 0xa7, 0x5a, 0x61, 0xbd, 0xec, 0xc8, - 0x17, 0xb2, 0x46, 0xd6, 0xa9, 0x56, 0x52, 0xab, 0x8e, 0x56, 0x46, 0xfb, 0x50, 0x77, 0x6c, 0x63, - 0x38, 0x1e, 0x18, 0x8e, 0x79, 0x7a, 0xaa, 0xed, 0xde, 0x06, 0x3a, 0xda, 0xde, 0x2d, 0xa0, 0x73, - 0xaa, 0x55, 0x6e, 0x03, 0x1d, 0xad, 0xda, 0xfe, 0x77, 0x11, 0x6a, 0x79, 0x71, 0x44, 0xbf, 0x85, - 0xf2, 0x56, 0x2a, 0xfe, 0xe2, 0xa3, 0x55, 0x54, 0xae, 0x78, 0x9e, 0xd8, 0x82, 0xc0, 0x03, 0x77, - 0xee, 0x51, 0xa6, 0x02, 0xb7, 0x6a, 0xab, 0x1d, 0x6a, 0x41, 0x31, 0xcf, 0xb4, 0x22, 0x09, 0xd0, - 0x57, 0xb0, 0x4f, 0x13, 0x5e, 0x42, 0xdd, 0x19, 0x89, 0xb0, 0x78, 0x57, 0xd9, 0x6b, 0x5b, 0x12, - 0xbe, 0x50, 0x28, 0x37, 0x48, 0xb1, 0x9f, 0x61, 0x26, 0x7c, 0x5a, 0xb3, 0xd5, 0x0e, 0x7d, 0x06, - 0xb5, 0x8c, 0xc4, 0xa1, 0x4b, 0xc9, 0xf7, 0x58, 0xb9, 0xb6, 0xca, 0x81, 0x31, 0xf9, 0x5e, 0x44, - 0xcc, 0x74, 0x31, 0x9b, 0xe1, 0x4c, 0x8a, 0x2b, 0x42, 0x0c, 0x12, 0x12, 0x0a, 0x9c, 0xbd, 0x72, - 0x45, 0xae, 0x51, 0xd5, 0x6d, 0xab, 0xd9, 0xea, 0x8f, 0x62, 0xcf, 0x85, 0x2c, 0x17, 0xd6, 0xa4, - 0x90, 0x29, 0x61, 0xbb, 0xa3, 0xdc, 0x24, 0xca, 0x4c, 0x03, 0xaa, 0xa6, 0xf3, 0xca, 0xb4, 0x87, - 0xa6, 0xa3, 0xed, 0xa0, 0x3d, 0x28, 0xf6, 0x2d, 0xad, 0xc0, 0x7d, 0x6b, 0x4d, 0x86, 0x8e, 0xdb, - 0x1f, 0x7e, 0x6b, 0x9e, 0x3b, 0x5a, 0xb1, 0xfd, 0x57, 0xa8, 0xe5, 0xb5, 0x9d, 0xdf, 0x8d, 0x66, - 0x7e, 0x3e, 0x61, 0xa8, 0x68, 0xa6, 0x99, 0xbf, 0x1e, 0x30, 0xbe, 0x80, 0x7a, 0x40, 0x59, 0xae, - 0x50, 0x94, 0x0a, 0x01, 0x65, 0x6b, 0x05, 0x3e, 0x5e, 0xc4, 0x44, 0x39, 0x93, 0x2f, 0xd1, 0x33, - 0xa8, 0xcd, 0x17, 0x11, 0x23, 0xbe, 0x47, 0x99, 0xf2, 0xe3, 0x06, 0x68, 0xbf, 0x84, 0xc6, 0x76, - 0x03, 0x43, 0x87, 0xd0, 0xb8, 0x4a, 0x28, 0x73, 0xc9, 0xec, 0x56, 0x42, 0x71, 0xac, 0x3f, 0xe3, - 0x09, 0xd5, 0xfe, 0x7b, 0x01, 0x2a, 0xaa, 0x79, 0xf1, 0x61, 0x69, 0x89, 0x33, 0xca, 0xf3, 0x47, - 0x96, 0xa8, 0xf5, 0xf6, 0x9e, 0x9d, 0xe2, 0x5d, 0x3b, 0xfc, 0x95, 0x59, 0xe2, 0xce, 0x89, 0x9f, - 0x25, 0x14, 0x67, 0x4b, 0xe2, 0x63, 0x71, 0xeb, 0x9a, 0xdd, 0x62, 0xc9, 0xe5, 0x16, 0xca, 0x4d, - 0x65, 0x2b, 0x77, 0xf3, 0xa0, 0x65, 0xf9, 0x62, 0xd9, 0xca, 0x5e, 0x3f, 0xe9, 0x21, 0x34, 0xd8, - 0xb6, 0x86, 0xcc, 0x30, 0x60, 0xb9, 0x46, 0xfb, 0xbf, 0x25, 0xa8, 0xe5, 0xfd, 0x90, 0x3b, 0x09, - 0xd3, 0x58, 0x45, 0x21, 0x5f, 0x72, 0xbf, 0x7a, 0x31, 0x23, 0x6e, 0x86, 0xd3, 0xc8, 0xbb, 0x51, - 0xf5, 0x13, 0x38, 0x64, 0x0b, 0x84, 0x37, 0x8d, 0x28, 0xf1, 0xbd, 0x88, 0x37, 0x2e, 0xe9, 0xc4, - 0x8a, 0xd8, 0xf7, 0x53, 0x11, 0x2f, 0x78, 0x9e, 0x30, 0xcc, 0x65, 0x32, 0x10, 0xab, 0x12, 0x90, - 0x42, 0xc9, 0xa3, 0x29, 0x59, 0x87, 0xa2, 0x00, 0xc6, 0x29, 0xe1, 0x05, 0x43, 0x31, 0xb9, 0x54, - 0x46, 0xa2, 0xb2, 0xc5, 0xc5, 0x67, 0x00, 0x7e, 0x76, 0x93, 0xb2, 0xc4, 0xf5, 0xa2, 0x50, 0x44, - 0x62, 0xab, 0xf3, 0x89, 0x4c, 0x37, 0x31, 0x06, 0x9f, 0x0b, 0xa1, 0x11, 0x85, 0x76, 0xcd, 0x5f, - 0x2f, 0xd1, 0x11, 0x68, 0xf2, 0x40, 0x45, 0xbd, 0xc6, 0x37, 0x22, 0x4e, 0x6b, 0x76, 0x4b, 0xe0, - 0x92, 0xf4, 0x1a, 0xdf, 0xf0, 0xa6, 0xac, 0x4e, 0xdf, 0x52, 0x05, 0xd9, 0x94, 0xa5, 0x60, 0xa3, - 0xfb, 0x12, 0x6a, 0x3c, 0xc5, 0x43, 0x71, 0x93, 0xba, 0xb8, 0xc9, 0xe3, 0xad, 0x9b, 0xf0, 0x12, - 0x19, 0xf2, 0x8b, 0x54, 0x89, 0x5a, 0xf1, 0xa9, 0x56, 0x39, 0x4c, 0xf0, 0xb8, 0xed, 0x86, 0xb0, - 0xdd, 0x94, 0x7e, 0xe3, 0x28, 0xb7, 0x7c, 0x04, 0xda, 0xda, 0x7b, 0xb9, 0x62, 0x53, 0xde, 0x57, - 0x39, 0x71, 0x4b, 0x53, 0x8e, 0xe2, 0xee, 0x22, 0x48, 0x5d, 0x1c, 0xfb, 0x5e, 0xaa, 0xb7, 0xc4, - 0x43, 0xb5, 0x24, 0x3e, 0x09, 0x52, 0x93, 0xa3, 0xed, 0x00, 0xea, 0x5b, 0x63, 0x0c, 0x7f, 0x5c, - 0x45, 0xc4, 0x51, 0x12, 0xaa, 0x67, 0x07, 0x09, 0x99, 0x51, 0x12, 0xf2, 0xc7, 0xcd, 0x56, 0xef, - 0x65, 0xec, 0xc8, 0xcc, 0xa9, 0x64, 0xab, 0xf7, 0x22, 0xb4, 0x9e, 0x42, 0x95, 0xad, 0x45, 0x32, - 0xf0, 0x2a, 0x4c, 0x8a, 0xda, 0xff, 0x2a, 0x41, 0x75, 0x3d, 0xf7, 0xa8, 0x1a, 0x56, 0xc8, 0x6b, - 0xd8, 0xa9, 0x2a, 0x92, 0xb2, 0xad, 0x3c, 0xff, 0xd8, 0xbc, 0x74, 0xbc, 0x55, 0x1e, 0xbf, 0x86, - 0x62, 0x34, 0x15, 0x87, 0xb4, 0xee, 0x4f, 0xf1, 0x39, 0x61, 0x90, 0x78, 0x41, 0xd7, 0x8b, 0xbc, - 0xd8, 0xc7, 0x76, 0x31, 0x9a, 0xa2, 0x09, 0x3c, 0xe2, 0x03, 0x17, 0x0e, 0xdc, 0x8d, 0xb6, 0xde, - 0x38, 0x2c, 0x3d, 0x34, 0xbe, 0xe7, 0x46, 0xba, 0x82, 0x91, 0x37, 0x36, 0x5b, 0x9b, 0xde, 0x06, - 0xe8, 0x41, 0x04, 0xfb, 0x77, 0x94, 0x1e, 0xfc, 0xc2, 0x7a, 0x0e, 0x40, 0xa8, 0x9b, 0x7a, 0x94, - 0x92, 0x25, 0x56, 0x9e, 0xad, 0x11, 0x6a, 0x49, 0x80, 0x07, 0x01, 0xa1, 0x6e, 0x94, 0xc4, 0xa1, - 0xcb, 0xc8, 0x1c, 0x27, 0x0b, 0xa6, 0x52, 0xab, 0x49, 0xe8, 0x20, 0x89, 0x43, 0x47, 0x82, 0xed, - 0xef, 0xa0, 0x2c, 0x6a, 0xe6, 0xad, 0x59, 0x6a, 0x1f, 0xea, 0xf6, 0x68, 0x32, 0xec, 0xb9, 0xf6, - 0xa8, 0xdb, 0x1f, 0x6a, 0x05, 0x3e, 0xaa, 0x18, 0xe7, 0x7c, 0x7c, 0x72, 0xf9, 0x44, 0x32, 0xb1, - 0xb4, 0x22, 0x1f, 0x3f, 0xde, 0x8d, 0x6c, 0xad, 0xc4, 0xc7, 0x8f, 0xae, 0x3d, 0x32, 0x7a, 0xe7, - 0xc6, 0xd8, 0xd1, 0xca, 0xbc, 0xff, 0x0d, 0x8c, 0x73, 0x4b, 0xdb, 0x6d, 0x7f, 0x05, 0xf5, 0x2d, - 0x97, 0xf1, 0x3a, 0x3c, 0xe8, 0x68, 0x3b, 0x9c, 0x38, 0x38, 0xfb, 0x5a, 0x2b, 0x88, 0x45, 0xe7, - 0x4c, 0x2b, 0x76, 0xbf, 0xfd, 0xe7, 0x7f, 0x3e, 0x2f, 0xfc, 0xa9, 0xb7, 0xf5, 0x85, 0x1a, 0x91, - 0xd0, 0x63, 0x09, 0xff, 0xfa, 0x7c, 0xe1, 0x85, 0x38, 0x66, 0x27, 0x5e, 0x4a, 0x4e, 0x1e, 0xfc, - 0xf0, 0xfd, 0xfd, 0x32, 0x4d, 0xb7, 0xfc, 0x3f, 0xdd, 0x13, 0x5f, 0xa8, 0x67, 0xff, 0x0f, 0x00, - 0x00, 0xff, 0xff, 0x50, 0xfe, 0x0f, 0x64, 0x27, 0x0f, 0x00, 0x00, + proto.RegisterFile("models/vpp/interfaces/interface.proto", fileDescriptor_1ac7cab935c1dc4d) +} + +var fileDescriptor_1ac7cab935c1dc4d = []byte{ + // 1898 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0x4b, 0x73, 0xdb, 0xc8, + 0x11, 0x16, 0x1f, 0x12, 0xc9, 0xe6, 0x43, 0xf0, 0x78, 0x9d, 0x85, 0xb5, 0xf6, 0xae, 0xc2, 0x6c, + 0xb2, 0xaa, 0xa4, 0x2c, 0x59, 0xd4, 0x56, 0x65, 0x2b, 0x39, 0x81, 0x22, 0xb4, 0xe6, 0x9a, 0x02, + 0x11, 0x10, 0xb4, 0xbd, 0xa9, 0x54, 0xa1, 0x40, 0x60, 0x08, 0x4d, 0x04, 0x02, 0x30, 0x66, 0x48, + 0x53, 0x5b, 0x95, 0xdf, 0x90, 0xbf, 0x94, 0x63, 0x0e, 0xb9, 0xe4, 0x98, 0x73, 0x8e, 0x39, 0x6d, + 0xe5, 0x0f, 0xa4, 0xe6, 0xc1, 0x87, 0x1e, 0xde, 0xca, 0x85, 0x35, 0xf3, 0x75, 0x7f, 0x3d, 0xcd, + 0x9e, 0x9e, 0xee, 0x06, 0xfc, 0x72, 0x96, 0x86, 0x38, 0xa6, 0x27, 0x8b, 0x2c, 0x3b, 0x21, 0x09, + 0xc3, 0xf9, 0xd4, 0x0f, 0x30, 0xdd, 0x2c, 0x8f, 0xb3, 0x3c, 0x65, 0x29, 0x6a, 0x2d, 0xb2, 0xec, + 0x78, 0x23, 0x3f, 0x78, 0x11, 0x11, 0x76, 0x35, 0x9f, 0x1c, 0x07, 0xe9, 0xec, 0x24, 0x4a, 0xa3, + 0xf4, 0x44, 0xa8, 0x4d, 0xe6, 0x53, 0xb1, 0x13, 0x1b, 0xb1, 0x92, 0xf4, 0x83, 0x67, 0xdb, 0xa7, + 0x64, 0x14, 0x07, 0xf2, 0x57, 0x4a, 0xdb, 0x3f, 0xd6, 0xa1, 0xd6, 0x5f, 0xd9, 0x46, 0x08, 0xca, + 0x89, 0x3f, 0xc3, 0x7a, 0xe1, 0xb0, 0x70, 0x54, 0x73, 0xc4, 0x1a, 0x75, 0xa0, 0xcc, 0x6e, 0x32, + 0xac, 0x17, 0x0f, 0x0b, 0x47, 0xad, 0xce, 0xe7, 0xc7, 0xb7, 0xbd, 0x39, 0x5e, 0x93, 0x8f, 0xdd, + 0x9b, 0x0c, 0x3b, 0x42, 0x17, 0xe9, 0x50, 0xc1, 0x89, 0x3f, 0x89, 0x71, 0xa8, 0x97, 0x0e, 0x0b, + 0x47, 0x55, 0x67, 0xb5, 0x45, 0x3f, 0x87, 0x46, 0x76, 0x75, 0x43, 0x3d, 0x3f, 0x0c, 0x73, 0x4c, + 0xa9, 0x5e, 0x16, 0x27, 0xd5, 0x39, 0x66, 0x48, 0x88, 0xab, 0x90, 0x6c, 0xa5, 0x80, 0xa9, 0xbe, + 0x7b, 0x58, 0xe2, 0x2a, 0x24, 0x33, 0x56, 0x10, 0xd2, 0xa0, 0xb4, 0xc8, 0xa7, 0xfa, 0xde, 0x61, + 0xe1, 0xa8, 0xe9, 0xf0, 0x25, 0xfa, 0x15, 0xec, 0x53, 0xcc, 0xbc, 0xf0, 0x2a, 0xc8, 0xbc, 0x20, + 0x26, 0x38, 0x61, 0x7a, 0x45, 0x9c, 0xdc, 0xa4, 0x98, 0xf5, 0xae, 0x82, 0xec, 0x5c, 0x80, 0x9c, + 0x39, 0x63, 0x73, 0xbd, 0x2a, 0x99, 0x33, 0x36, 0x47, 0x3d, 0x80, 0x79, 0x92, 0xcc, 0x67, 0x13, + 0x9c, 0xe3, 0x50, 0xaf, 0x1d, 0x16, 0x8e, 0xea, 0x9d, 0x2f, 0x3f, 0xfe, 0x2f, 0xc7, 0x6b, 0x5d, + 0x67, 0x8b, 0x87, 0x1c, 0xd0, 0xf2, 0xa5, 0xc7, 0x43, 0xed, 0x51, 0xcc, 0x18, 0x49, 0x22, 0xaa, + 0x83, 0xb0, 0x75, 0xf4, 0x71, 0x5b, 0xce, 0xf2, 0x32, 0x0d, 0xf1, 0x48, 0xe9, 0x3b, 0xad, 0xfc, + 0xd6, 0x1e, 0xf9, 0xf0, 0x24, 0x5f, 0x7a, 0x59, 0xec, 0x07, 0x78, 0x86, 0x13, 0xb6, 0x31, 0x5c, + 0x17, 0x86, 0x5f, 0xfc, 0x94, 0x61, 0x7b, 0xc5, 0x5a, 0x5b, 0x7f, 0x9c, 0xdf, 0x07, 0xd1, 0x4b, + 0x28, 0xd1, 0xf9, 0x44, 0x0f, 0x85, 0xc1, 0x67, 0x77, 0x0d, 0x8e, 0xe6, 0x93, 0xb5, 0xcd, 0x57, + 0x3b, 0x0e, 0x57, 0x45, 0xa7, 0xb0, 0x3b, 0xc3, 0x33, 0x32, 0xd5, 0xb1, 0xe0, 0x3c, 0xbd, 0xcb, + 0xb9, 0xe4, 0xc2, 0x01, 0x49, 0xae, 0x5f, 0xed, 0x38, 0x52, 0x13, 0xfd, 0x0e, 0xaa, 0xfe, 0x34, + 0xf3, 0x83, 0x6b, 0xcc, 0xf4, 0xe9, 0xc3, 0x27, 0x19, 0x4a, 0xae, 0x88, 0x6b, 0x7d, 0xf4, 0x1b, + 0x28, 0x31, 0x3f, 0xd3, 0x23, 0x41, 0xfb, 0xf4, 0x2e, 0xcd, 0xf5, 0x33, 0xc5, 0xe0, 0x5a, 0xdc, + 0xb7, 0xc5, 0x32, 0xf6, 0x13, 0xfd, 0xea, 0x61, 0xdf, 0xde, 0x70, 0xe1, 0xca, 0x37, 0xa1, 0xc9, + 0x29, 0xe2, 0x39, 0xe8, 0xe4, 0x61, 0x4a, 0xdf, 0x1e, 0xe1, 0x60, 0x45, 0x11, 0x9a, 0xe8, 0x1b, + 0xa8, 0x2e, 0x66, 0x4b, 0x2f, 0xc1, 0xec, 0x4c, 0xff, 0xb3, 0x60, 0x7d, 0x76, 0xef, 0xa0, 0xd9, + 0xd2, 0xc2, 0xec, 0x4c, 0xf1, 0x2a, 0x0b, 0xb9, 0x45, 0xc7, 0x50, 0x9e, 0xa4, 0x49, 0xa8, 0x5f, + 0x0b, 0x96, 0x7e, 0x97, 0xd5, 0x4d, 0x93, 0x50, 0x51, 0x84, 0xde, 0xc1, 0x37, 0x00, 0x9b, 0x74, + 0x43, 0xbf, 0x86, 0x47, 0x6b, 0x65, 0xef, 0x03, 0x61, 0x57, 0x1e, 0xc9, 0xd4, 0x4b, 0xdd, 0x5f, + 0x0b, 0xde, 0x12, 0x76, 0xd5, 0xcf, 0x0e, 0x7e, 0x2c, 0x40, 0xeb, 0x76, 0x76, 0xa1, 0x01, 0x54, + 0x54, 0x86, 0x0a, 0x52, 0xab, 0x73, 0xf6, 0xff, 0x26, 0xa6, 0xda, 0x8a, 0xf7, 0xbd, 0x27, 0x73, + 0x14, 0x3d, 0x85, 0xea, 0xfb, 0x39, 0x9e, 0x63, 0x8f, 0x84, 0xa2, 0x32, 0x34, 0x9d, 0x8a, 0xd8, + 0xf7, 0x43, 0xf4, 0x25, 0xb4, 0x56, 0x22, 0x6f, 0xe1, 0xc7, 0x44, 0xd6, 0x80, 0xa6, 0xd3, 0x50, + 0x0a, 0x6f, 0x38, 0xd6, 0xb6, 0x01, 0x36, 0x66, 0x51, 0x1d, 0x2a, 0x63, 0xeb, 0xb5, 0x35, 0x7c, + 0x6b, 0x69, 0x3b, 0x7c, 0x63, 0x0f, 0x07, 0x83, 0xbe, 0xf5, 0xad, 0x56, 0x40, 0x4d, 0xa8, 0xf5, + 0x2d, 0xd7, 0x74, 0x9c, 0xb1, 0xed, 0x6a, 0x45, 0xd4, 0x80, 0xaa, 0xd1, 0x33, 0x6c, 0xb7, 0xff, + 0xc6, 0xd4, 0x4a, 0x5c, 0xb3, 0x67, 0x5e, 0x18, 0xe3, 0x81, 0xab, 0x95, 0x0f, 0xfe, 0x04, 0x8f, + 0x1f, 0xc8, 0x7b, 0xf4, 0x09, 0xec, 0x8a, 0x83, 0xc5, 0xbf, 0x6e, 0x3a, 0x72, 0x83, 0x7e, 0x06, + 0x7b, 0x1f, 0xd2, 0xfc, 0x1a, 0xe7, 0xca, 0x7b, 0xb5, 0x43, 0x9f, 0x42, 0x85, 0x50, 0x6f, 0xe6, + 0x93, 0x44, 0x55, 0xae, 0x3d, 0x42, 0x2f, 0x7d, 0x92, 0xb4, 0xff, 0x56, 0x80, 0xb2, 0x70, 0x15, + 0x41, 0x6b, 0x6c, 0xf5, 0xcc, 0x8b, 0xbe, 0x65, 0xf6, 0x3c, 0xf7, 0x7b, 0xdb, 0xd4, 0x76, 0xd0, + 0x23, 0x68, 0x8e, 0xc6, 0x5d, 0x4f, 0x38, 0x7a, 0x61, 0x9c, 0x9b, 0x5a, 0x01, 0x3d, 0x81, 0x47, + 0xa3, 0xe1, 0x85, 0xfb, 0xd6, 0x70, 0x4c, 0x6f, 0x30, 0x1c, 0xda, 0x5d, 0xe3, 0xfc, 0xb5, 0x56, + 0x44, 0x55, 0x28, 0xf7, 0xec, 0xde, 0x6b, 0xad, 0x84, 0x6a, 0xb0, 0x7b, 0x69, 0x5e, 0xf6, 0x2f, + 0xb4, 0x32, 0xaa, 0x40, 0xc9, 0x35, 0x6c, 0x6d, 0x97, 0xff, 0x59, 0xe3, 0xc2, 0xb3, 0x8d, 0xf3, + 0xd7, 0xa6, 0xab, 0xed, 0x21, 0x0d, 0x1a, 0x6f, 0xde, 0x0d, 0x0c, 0xcb, 0x73, 0xc7, 0x96, 0x65, + 0x0e, 0xb4, 0x0a, 0x47, 0xfa, 0xf6, 0xc8, 0x3c, 0x5f, 0x21, 0x55, 0x7e, 0xce, 0x9b, 0xcb, 0x77, + 0x96, 0xe9, 0x9e, 0x6d, 0x1d, 0x5f, 0xe3, 0x5e, 0x76, 0x87, 0x56, 0x6f, 0x0b, 0x83, 0xee, 0x1e, + 0x94, 0x63, 0x92, 0x5c, 0xb7, 0xff, 0x5b, 0x84, 0xc6, 0xf6, 0xd3, 0x46, 0x5f, 0x40, 0x3d, 0xf3, + 0x73, 0x5e, 0x62, 0xb6, 0xaa, 0x3f, 0x48, 0xc8, 0xe2, 0x3d, 0xe0, 0x09, 0xec, 0xd1, 0xf9, 0x64, + 0x73, 0xd7, 0xbb, 0x74, 0x3e, 0xe9, 0xf3, 0xa2, 0xd7, 0x64, 0x7e, 0xe4, 0xe5, 0x1f, 0xbc, 0x34, + 0x63, 0x24, 0x95, 0x21, 0x6b, 0x75, 0x8e, 0x7f, 0xaa, 0x8e, 0x1c, 0xbb, 0x7e, 0xe4, 0xe0, 0x0f, + 0x39, 0x61, 0x78, 0x28, 0x48, 0xd4, 0xa9, 0x33, 0x3f, 0x72, 0x3e, 0xc8, 0x1d, 0x7a, 0x0e, 0x90, + 0xcd, 0xe9, 0x95, 0x17, 0xa6, 0xec, 0xf4, 0xbd, 0x68, 0x0f, 0x55, 0xa7, 0xc6, 0x91, 0x1e, 0x07, + 0x78, 0x87, 0x62, 0x7e, 0x74, 0xaa, 0xef, 0x0a, 0x3f, 0xc4, 0x5a, 0x61, 0x1d, 0xd5, 0x0e, 0xc4, + 0xba, 0xfd, 0xd7, 0x02, 0x3c, 0xba, 0x77, 0x12, 0xcf, 0x9e, 0x5e, 0x7f, 0x64, 0x74, 0x07, 0x66, + 0x4f, 0xdb, 0xe1, 0x37, 0x60, 0x8f, 0x47, 0xaf, 0x4e, 0xb5, 0xc2, 0x6a, 0xd9, 0x91, 0x37, 0x64, + 0x0f, 0xed, 0x53, 0xad, 0xa4, 0x56, 0x1d, 0xad, 0x8c, 0xf6, 0xa1, 0xee, 0x3a, 0x86, 0x35, 0x1a, + 0x18, 0xae, 0x79, 0x7a, 0xaa, 0xed, 0xde, 0x06, 0x3a, 0xda, 0xde, 0x2d, 0xa0, 0x73, 0xaa, 0x55, + 0x6e, 0x03, 0x1d, 0xad, 0xda, 0xfe, 0x57, 0x11, 0x6a, 0xeb, 0xe2, 0x88, 0x7e, 0x0b, 0xe5, 0xad, + 0xa7, 0xf8, 0x8b, 0x8f, 0x56, 0x51, 0xb9, 0xe2, 0xef, 0xc4, 0x11, 0x04, 0x9e, 0xb8, 0x33, 0x9f, + 0x32, 0x95, 0xb8, 0x55, 0x47, 0xed, 0x50, 0x0b, 0x8a, 0xeb, 0x97, 0x56, 0x24, 0x21, 0xfa, 0x0a, + 0xf6, 0x69, 0xca, 0x4b, 0xa8, 0x37, 0x25, 0x31, 0x16, 0xf7, 0x2a, 0x7b, 0x6d, 0x4b, 0xc2, 0x17, + 0x0a, 0xe5, 0x06, 0x29, 0x0e, 0x72, 0xcc, 0x44, 0x4c, 0x6b, 0x8e, 0xda, 0xa1, 0xcf, 0xa0, 0x96, + 0x93, 0x24, 0xf2, 0x28, 0xf9, 0x01, 0xab, 0xd0, 0x56, 0x39, 0x30, 0x22, 0x3f, 0x88, 0x8c, 0x99, + 0xcc, 0xa7, 0x53, 0x9c, 0x4b, 0x71, 0x45, 0x88, 0x41, 0x42, 0x42, 0x81, 0xb3, 0x97, 0x9e, 0x78, + 0x6b, 0x54, 0x75, 0xdb, 0x6a, 0xbe, 0xfc, 0x83, 0xd8, 0x73, 0x21, 0x5b, 0x0b, 0x6b, 0x52, 0xc8, + 0x94, 0xb0, 0xdd, 0x51, 0x61, 0x12, 0x65, 0xa6, 0x01, 0x55, 0xd3, 0x7d, 0x65, 0x3a, 0x96, 0xe9, + 0x6a, 0x3b, 0x68, 0x0f, 0x8a, 0x7d, 0x5b, 0x2b, 0xf0, 0xd8, 0xda, 0x63, 0xcb, 0xf5, 0xfa, 0xd6, + 0x77, 0xe6, 0xb9, 0xab, 0x15, 0xdb, 0x7f, 0x81, 0xda, 0xba, 0xb6, 0x73, 0xdf, 0x68, 0x1e, 0xac, + 0x27, 0x0c, 0x95, 0xcd, 0x34, 0x0f, 0x56, 0x03, 0xc6, 0x17, 0x50, 0x0f, 0x29, 0x5b, 0x2b, 0x14, + 0xa5, 0x42, 0x48, 0xd9, 0x4a, 0x81, 0x8f, 0x17, 0x09, 0x51, 0xc1, 0xe4, 0x4b, 0xf4, 0x0c, 0x6a, + 0xb3, 0x79, 0xcc, 0x48, 0xe0, 0x53, 0xa6, 0xe2, 0xb8, 0x01, 0xda, 0x2f, 0xa1, 0xb1, 0xdd, 0xc0, + 0xd0, 0x21, 0x34, 0xae, 0x52, 0xca, 0x3c, 0x32, 0xbd, 0xf5, 0xa0, 0x38, 0xd6, 0x9f, 0xf2, 0x07, + 0xd5, 0xfe, 0x67, 0x01, 0x2a, 0xaa, 0x79, 0xf1, 0x61, 0x69, 0x81, 0x73, 0xca, 0xdf, 0x8f, 0x2c, + 0x51, 0xab, 0xed, 0x3d, 0x3b, 0xc5, 0xbb, 0x76, 0xf8, 0x2d, 0xb3, 0xd4, 0x9b, 0x91, 0x20, 0x4f, + 0x29, 0xce, 0x17, 0x24, 0xc0, 0xc2, 0xeb, 0x9a, 0xd3, 0x62, 0xe9, 0xe5, 0x16, 0xca, 0x4d, 0xe5, + 0x4b, 0x6f, 0x73, 0xa1, 0x65, 0x79, 0x63, 0xf9, 0xd2, 0x59, 0x5d, 0xe9, 0x21, 0x34, 0xd8, 0xb6, + 0x86, 0x7c, 0x61, 0xc0, 0x36, 0x1a, 0xcf, 0x01, 0xe4, 0x18, 0xe7, 0x45, 0x34, 0x15, 0x29, 0x51, + 0x75, 0x6a, 0x12, 0xf9, 0x96, 0xa6, 0xed, 0xff, 0x94, 0xa0, 0xb6, 0x6e, 0x97, 0x3c, 0x86, 0x98, + 0x26, 0x2a, 0x49, 0xf9, 0x92, 0x87, 0xdd, 0x4f, 0x18, 0xf1, 0x72, 0x9c, 0xc5, 0xfe, 0x8d, 0x2a, + 0xaf, 0xc0, 0x21, 0x47, 0x20, 0xbc, 0xa7, 0xc4, 0x69, 0xe0, 0xc7, 0xbc, 0xaf, 0xc9, 0x18, 0x57, + 0xc4, 0xbe, 0x9f, 0x89, 0x74, 0xc2, 0xb3, 0x94, 0x61, 0x2e, 0x93, 0x79, 0x5a, 0x95, 0x80, 0x14, + 0x4a, 0x1e, 0xcd, 0xc8, 0x2a, 0x53, 0x05, 0x30, 0xca, 0x08, 0x77, 0x5a, 0x31, 0xb9, 0x54, 0x26, + 0xaa, 0xb2, 0xc5, 0xc5, 0x67, 0x00, 0x41, 0x7e, 0x93, 0xb1, 0xd4, 0xf3, 0xe3, 0x48, 0x24, 0x6a, + 0xab, 0xf3, 0x89, 0x7c, 0x8d, 0x62, 0x4a, 0x3e, 0x17, 0x42, 0x23, 0x8e, 0x9c, 0x5a, 0xb0, 0x5a, + 0xa2, 0x23, 0xd0, 0xe4, 0x81, 0x8a, 0x7a, 0x8d, 0x6f, 0x44, 0x1a, 0xd7, 0x9c, 0x96, 0xc0, 0x25, + 0xe9, 0x35, 0xbe, 0xe1, 0x3d, 0x5b, 0x9d, 0xbe, 0xa5, 0x0a, 0xb2, 0x67, 0x4b, 0xc1, 0x46, 0xf7, + 0x25, 0xd4, 0x78, 0x05, 0x88, 0x84, 0x27, 0x75, 0xe1, 0xc9, 0xe3, 0x2d, 0x4f, 0x78, 0x05, 0x8d, + 0xb8, 0x23, 0x55, 0xa2, 0x56, 0x7c, 0xe8, 0x55, 0x01, 0x13, 0x3c, 0x6e, 0xbb, 0x21, 0x6c, 0x37, + 0x65, 0xdc, 0x38, 0xca, 0x2d, 0x1f, 0x81, 0xb6, 0x8a, 0xde, 0x5a, 0xb1, 0x29, 0xfd, 0x55, 0x41, + 0xdc, 0xd2, 0x54, 0x57, 0x3c, 0x0f, 0x33, 0x0f, 0x27, 0x81, 0x9f, 0xe9, 0x2d, 0x71, 0x51, 0x2d, + 0x89, 0x8f, 0xc3, 0xcc, 0xe4, 0x68, 0x3b, 0x84, 0xfa, 0xd6, 0x94, 0xc3, 0x2f, 0x57, 0x11, 0x71, + 0x9c, 0x46, 0xea, 0xda, 0x55, 0xba, 0x98, 0x71, 0x1a, 0xf1, 0xcb, 0xcd, 0x97, 0xef, 0x65, 0x6a, + 0xc9, 0x87, 0x55, 0xc9, 0x97, 0xef, 0x45, 0x5e, 0x3d, 0x85, 0x2a, 0x5b, 0x89, 0x64, 0x5e, 0x56, + 0x98, 0x14, 0xb5, 0xff, 0x51, 0x82, 0xea, 0x6a, 0x2c, 0x52, 0x25, 0xae, 0xb0, 0x2e, 0x71, 0xa7, + 0xaa, 0x86, 0xca, 0xae, 0xf3, 0xfc, 0x63, 0xe3, 0xd4, 0xf1, 0x56, 0xf5, 0xfc, 0x1a, 0x8a, 0xf1, + 0x44, 0x1c, 0xd2, 0xba, 0x3f, 0xe4, 0xaf, 0x09, 0x83, 0xd4, 0x0f, 0xbb, 0x7e, 0xec, 0x27, 0x01, + 0x76, 0x8a, 0xf1, 0x04, 0x8d, 0xe1, 0x11, 0x9f, 0xc7, 0x70, 0xe8, 0x6d, 0xb4, 0xf5, 0xc6, 0x61, + 0xe9, 0xa1, 0xe9, 0x7e, 0x6d, 0xa4, 0x2b, 0x18, 0xeb, 0xbe, 0xe7, 0x68, 0x93, 0xdb, 0x00, 0x3d, + 0x88, 0x61, 0xff, 0x8e, 0xd2, 0x83, 0x1f, 0x60, 0xcf, 0x01, 0x08, 0xf5, 0x32, 0x9f, 0x52, 0xb2, + 0xc0, 0x2a, 0xb2, 0x35, 0x42, 0x6d, 0x09, 0xf0, 0x24, 0x20, 0xd4, 0x8b, 0xd3, 0x24, 0xf2, 0x18, + 0x99, 0xe1, 0x74, 0xce, 0xd4, 0xd3, 0x6a, 0x12, 0x3a, 0x48, 0x93, 0xc8, 0x95, 0x60, 0xfb, 0x7b, + 0x28, 0x8b, 0x92, 0x7a, 0x6b, 0xd4, 0xda, 0x87, 0xba, 0x33, 0x1c, 0x5b, 0x3d, 0xcf, 0x19, 0x76, + 0xfb, 0x96, 0x56, 0xe0, 0x93, 0x8c, 0x71, 0xce, 0xa7, 0x2b, 0x8f, 0x0f, 0x2c, 0x63, 0x5b, 0x2b, + 0xf2, 0xe9, 0xe4, 0xdd, 0xd0, 0xd1, 0x4a, 0x7c, 0x3a, 0xe9, 0x3a, 0x43, 0xa3, 0x77, 0x6e, 0x8c, + 0x5c, 0xad, 0xcc, 0xdb, 0xe3, 0xc0, 0x38, 0xb7, 0xb5, 0xdd, 0xf6, 0x57, 0x50, 0xdf, 0x0a, 0x19, + 0x2f, 0xd3, 0x83, 0x8e, 0xb6, 0xc3, 0x89, 0x83, 0xb3, 0xaf, 0xb5, 0x82, 0x58, 0x74, 0xce, 0xb4, + 0x62, 0xf7, 0xbb, 0xbf, 0xff, 0xfb, 0xf3, 0xc2, 0x1f, 0x7b, 0x5b, 0x1f, 0xb0, 0x31, 0x89, 0x7c, + 0x96, 0xf2, 0x8f, 0xd3, 0x17, 0x7e, 0x84, 0x13, 0x76, 0xe2, 0x67, 0xe4, 0xe4, 0xc1, 0xef, 0xe2, + 0xdf, 0x2f, 0xb2, 0x6c, 0x2b, 0xfe, 0x93, 0x3d, 0xf1, 0x01, 0x7b, 0xf6, 0xbf, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x43, 0xf7, 0x1a, 0x56, 0x46, 0x0f, 0x00, 0x00, } diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/interfaces/interface.proto b/vendor/github.com/ligato/vpp-agent/api/models/vpp/interfaces/interface.proto index aee0eb5fa4..677a96e16d 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/interfaces/interface.proto +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/interfaces/interface.proto @@ -134,6 +134,7 @@ message TapLink { VPP-ifplugin needs to be aware of this dependency) */ uint32 rx_ring_size = 4; /* Rx ring buffer size; must be power of 2; default is 256; only for TAP v.2 */ uint32 tx_ring_size = 5; /* Tx ring buffer size; must be power of 2; default is 256; only for TAP v.2 */ + bool enable_gso = 6; /* Enable GSO */ } message IPSecLink { diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/interfaces/state.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/interfaces/state.pb.go index cd5ed4d329..fba7b79d23 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/interfaces/state.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/interfaces/state.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/interfaces/state.proto -package vpp_interfaces // import "github.com/ligato/vpp-agent/api/models/vpp/interfaces" +package vpp_interfaces -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -34,6 +36,7 @@ var InterfaceState_Status_name = map[int32]string{ 2: "DOWN", 3: "DELETED", } + var InterfaceState_Status_value = map[string]int32{ "UNKNOWN_STATUS": 0, "UP": 1, @@ -44,8 +47,9 @@ var InterfaceState_Status_value = map[string]int32{ func (x InterfaceState_Status) String() string { return proto.EnumName(InterfaceState_Status_name, int32(x)) } + func (InterfaceState_Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_state_bb2097df664231a9, []int{0, 0} + return fileDescriptor_b4d8b1bd7c13bf58, []int{0, 0} } type InterfaceState_Duplex int32 @@ -61,6 +65,7 @@ var InterfaceState_Duplex_name = map[int32]string{ 1: "HALF", 2: "FULL", } + var InterfaceState_Duplex_value = map[string]int32{ "UNKNOWN_DUPLEX": 0, "HALF": 1, @@ -70,8 +75,9 @@ var InterfaceState_Duplex_value = map[string]int32{ func (x InterfaceState_Duplex) String() string { return proto.EnumName(InterfaceState_Duplex_name, int32(x)) } + func (InterfaceState_Duplex) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_state_bb2097df664231a9, []int{0, 1} + return fileDescriptor_b4d8b1bd7c13bf58, []int{0, 1} } type InterfaceNotification_NotifType int32 @@ -87,6 +93,7 @@ var InterfaceNotification_NotifType_name = map[int32]string{ 1: "UPDOWN", 2: "COUNTERS", } + var InterfaceNotification_NotifType_value = map[string]int32{ "UNKNOWN": 0, "UPDOWN": 1, @@ -96,8 +103,9 @@ var InterfaceNotification_NotifType_value = map[string]int32{ func (x InterfaceNotification_NotifType) String() string { return proto.EnumName(InterfaceNotification_NotifType_name, int32(x)) } + func (InterfaceNotification_NotifType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_state_bb2097df664231a9, []int{1, 0} + return fileDescriptor_b4d8b1bd7c13bf58, []int{1, 0} } type InterfaceState struct { @@ -122,7 +130,7 @@ func (m *InterfaceState) Reset() { *m = InterfaceState{} } func (m *InterfaceState) String() string { return proto.CompactTextString(m) } func (*InterfaceState) ProtoMessage() {} func (*InterfaceState) Descriptor() ([]byte, []int) { - return fileDescriptor_state_bb2097df664231a9, []int{0} + return fileDescriptor_b4d8b1bd7c13bf58, []int{0} } func (m *InterfaceState) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InterfaceState.Unmarshal(m, b) @@ -130,8 +138,8 @@ func (m *InterfaceState) XXX_Unmarshal(b []byte) error { func (m *InterfaceState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_InterfaceState.Marshal(b, m, deterministic) } -func (dst *InterfaceState) XXX_Merge(src proto.Message) { - xxx_messageInfo_InterfaceState.Merge(dst, src) +func (m *InterfaceState) XXX_Merge(src proto.Message) { + xxx_messageInfo_InterfaceState.Merge(m, src) } func (m *InterfaceState) XXX_Size() int { return xxx_messageInfo_InterfaceState.Size(m) @@ -252,7 +260,7 @@ func (m *InterfaceState_Statistics) Reset() { *m = InterfaceState_Statis func (m *InterfaceState_Statistics) String() string { return proto.CompactTextString(m) } func (*InterfaceState_Statistics) ProtoMessage() {} func (*InterfaceState_Statistics) Descriptor() ([]byte, []int) { - return fileDescriptor_state_bb2097df664231a9, []int{0, 0} + return fileDescriptor_b4d8b1bd7c13bf58, []int{0, 0} } func (m *InterfaceState_Statistics) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InterfaceState_Statistics.Unmarshal(m, b) @@ -260,8 +268,8 @@ func (m *InterfaceState_Statistics) XXX_Unmarshal(b []byte) error { func (m *InterfaceState_Statistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_InterfaceState_Statistics.Marshal(b, m, deterministic) } -func (dst *InterfaceState_Statistics) XXX_Merge(src proto.Message) { - xxx_messageInfo_InterfaceState_Statistics.Merge(dst, src) +func (m *InterfaceState_Statistics) XXX_Merge(src proto.Message) { + xxx_messageInfo_InterfaceState_Statistics.Merge(m, src) } func (m *InterfaceState_Statistics) XXX_Size() int { return xxx_messageInfo_InterfaceState_Statistics.Size(m) @@ -372,7 +380,7 @@ func (m *InterfaceNotification) Reset() { *m = InterfaceNotification{} } func (m *InterfaceNotification) String() string { return proto.CompactTextString(m) } func (*InterfaceNotification) ProtoMessage() {} func (*InterfaceNotification) Descriptor() ([]byte, []int) { - return fileDescriptor_state_bb2097df664231a9, []int{1} + return fileDescriptor_b4d8b1bd7c13bf58, []int{1} } func (m *InterfaceNotification) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InterfaceNotification.Unmarshal(m, b) @@ -380,8 +388,8 @@ func (m *InterfaceNotification) XXX_Unmarshal(b []byte) error { func (m *InterfaceNotification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_InterfaceNotification.Marshal(b, m, deterministic) } -func (dst *InterfaceNotification) XXX_Merge(src proto.Message) { - xxx_messageInfo_InterfaceNotification.Merge(dst, src) +func (m *InterfaceNotification) XXX_Merge(src proto.Message) { + xxx_messageInfo_InterfaceNotification.Merge(m, src) } func (m *InterfaceNotification) XXX_Size() int { return xxx_messageInfo_InterfaceNotification.Size(m) @@ -410,19 +418,17 @@ func (*InterfaceNotification) XXX_MessageName() string { return "vpp.interfaces.InterfaceNotification" } func init() { - proto.RegisterType((*InterfaceState)(nil), "vpp.interfaces.InterfaceState") - proto.RegisterType((*InterfaceState_Statistics)(nil), "vpp.interfaces.InterfaceState.Statistics") - proto.RegisterType((*InterfaceNotification)(nil), "vpp.interfaces.InterfaceNotification") proto.RegisterEnum("vpp.interfaces.InterfaceState_Status", InterfaceState_Status_name, InterfaceState_Status_value) proto.RegisterEnum("vpp.interfaces.InterfaceState_Duplex", InterfaceState_Duplex_name, InterfaceState_Duplex_value) proto.RegisterEnum("vpp.interfaces.InterfaceNotification_NotifType", InterfaceNotification_NotifType_name, InterfaceNotification_NotifType_value) + proto.RegisterType((*InterfaceState)(nil), "vpp.interfaces.InterfaceState") + proto.RegisterType((*InterfaceState_Statistics)(nil), "vpp.interfaces.InterfaceState.Statistics") + proto.RegisterType((*InterfaceNotification)(nil), "vpp.interfaces.InterfaceNotification") } -func init() { - proto.RegisterFile("models/vpp/interfaces/state.proto", fileDescriptor_state_bb2097df664231a9) -} +func init() { proto.RegisterFile("models/vpp/interfaces/state.proto", fileDescriptor_b4d8b1bd7c13bf58) } -var fileDescriptor_state_bb2097df664231a9 = []byte{ +var fileDescriptor_b4d8b1bd7c13bf58 = []byte{ // 749 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xe1, 0x6e, 0xe3, 0x44, 0x10, 0xc7, 0xeb, 0xc4, 0x75, 0x92, 0x71, 0x9a, 0x33, 0x2b, 0x90, 0x4c, 0x11, 0x47, 0x1a, 0x74, diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/ipsec/ipsec.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/ipsec/ipsec.pb.go index bc18818888..e7eb3def5f 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/ipsec/ipsec.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/ipsec/ipsec.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/ipsec/ipsec.proto -package vpp_ipsec // import "github.com/ligato/vpp-agent/api/models/vpp/ipsec" +package vpp_ipsec -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -51,6 +53,7 @@ var CryptoAlg_name = map[int32]string{ 10: "DES_CBC", 11: "DES3_CBC", } + var CryptoAlg_value = map[string]int32{ "NONE_CRYPTO": 0, "AES_CBC_128": 1, @@ -69,8 +72,9 @@ var CryptoAlg_value = map[string]int32{ func (x CryptoAlg) String() string { return proto.EnumName(CryptoAlg_name, int32(x)) } + func (CryptoAlg) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ipsec_de07facc5beafc91, []int{0} + return fileDescriptor_c27f07ec381ccc0c, []int{0} } // Cryptographic algorithm for authentication @@ -95,6 +99,7 @@ var IntegAlg_name = map[int32]string{ 5: "SHA_384_192", 6: "SHA_512_256", } + var IntegAlg_value = map[string]int32{ "NONE_INTEG": 0, "MD5_96": 1, @@ -108,8 +113,9 @@ var IntegAlg_value = map[string]int32{ func (x IntegAlg) String() string { return proto.EnumName(IntegAlg_name, int32(x)) } + func (IntegAlg) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ipsec_de07facc5beafc91, []int{1} + return fileDescriptor_c27f07ec381ccc0c, []int{1} } type SecurityPolicyDatabase_PolicyEntry_Action int32 @@ -127,6 +133,7 @@ var SecurityPolicyDatabase_PolicyEntry_Action_name = map[int32]string{ 2: "RESOLVE", 3: "PROTECT", } + var SecurityPolicyDatabase_PolicyEntry_Action_value = map[string]int32{ "BYPASS": 0, "DISCARD": 1, @@ -137,8 +144,9 @@ var SecurityPolicyDatabase_PolicyEntry_Action_value = map[string]int32{ func (x SecurityPolicyDatabase_PolicyEntry_Action) String() string { return proto.EnumName(SecurityPolicyDatabase_PolicyEntry_Action_name, int32(x)) } + func (SecurityPolicyDatabase_PolicyEntry_Action) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ipsec_de07facc5beafc91, []int{0, 1, 0} + return fileDescriptor_c27f07ec381ccc0c, []int{0, 1, 0} } type SecurityAssociation_IPSecProtocol int32 @@ -152,6 +160,7 @@ var SecurityAssociation_IPSecProtocol_name = map[int32]string{ 0: "AH", 1: "ESP", } + var SecurityAssociation_IPSecProtocol_value = map[string]int32{ "AH": 0, "ESP": 1, @@ -160,8 +169,9 @@ var SecurityAssociation_IPSecProtocol_value = map[string]int32{ func (x SecurityAssociation_IPSecProtocol) String() string { return proto.EnumName(SecurityAssociation_IPSecProtocol_name, int32(x)) } + func (SecurityAssociation_IPSecProtocol) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ipsec_de07facc5beafc91, []int{1, 0} + return fileDescriptor_c27f07ec381ccc0c, []int{1, 0} } // Security Policy Database (SPD) @@ -178,7 +188,7 @@ func (m *SecurityPolicyDatabase) Reset() { *m = SecurityPolicyDatabase{} func (m *SecurityPolicyDatabase) String() string { return proto.CompactTextString(m) } func (*SecurityPolicyDatabase) ProtoMessage() {} func (*SecurityPolicyDatabase) Descriptor() ([]byte, []int) { - return fileDescriptor_ipsec_de07facc5beafc91, []int{0} + return fileDescriptor_c27f07ec381ccc0c, []int{0} } func (m *SecurityPolicyDatabase) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SecurityPolicyDatabase.Unmarshal(m, b) @@ -186,8 +196,8 @@ func (m *SecurityPolicyDatabase) XXX_Unmarshal(b []byte) error { func (m *SecurityPolicyDatabase) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SecurityPolicyDatabase.Marshal(b, m, deterministic) } -func (dst *SecurityPolicyDatabase) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityPolicyDatabase.Merge(dst, src) +func (m *SecurityPolicyDatabase) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecurityPolicyDatabase.Merge(m, src) } func (m *SecurityPolicyDatabase) XXX_Size() int { return xxx_messageInfo_SecurityPolicyDatabase.Size(m) @@ -234,7 +244,7 @@ func (m *SecurityPolicyDatabase_Interface) Reset() { *m = SecurityPolicy func (m *SecurityPolicyDatabase_Interface) String() string { return proto.CompactTextString(m) } func (*SecurityPolicyDatabase_Interface) ProtoMessage() {} func (*SecurityPolicyDatabase_Interface) Descriptor() ([]byte, []int) { - return fileDescriptor_ipsec_de07facc5beafc91, []int{0, 0} + return fileDescriptor_c27f07ec381ccc0c, []int{0, 0} } func (m *SecurityPolicyDatabase_Interface) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SecurityPolicyDatabase_Interface.Unmarshal(m, b) @@ -242,8 +252,8 @@ func (m *SecurityPolicyDatabase_Interface) XXX_Unmarshal(b []byte) error { func (m *SecurityPolicyDatabase_Interface) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SecurityPolicyDatabase_Interface.Marshal(b, m, deterministic) } -func (dst *SecurityPolicyDatabase_Interface) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityPolicyDatabase_Interface.Merge(dst, src) +func (m *SecurityPolicyDatabase_Interface) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecurityPolicyDatabase_Interface.Merge(m, src) } func (m *SecurityPolicyDatabase_Interface) XXX_Size() int { return xxx_messageInfo_SecurityPolicyDatabase_Interface.Size(m) @@ -288,7 +298,7 @@ func (m *SecurityPolicyDatabase_PolicyEntry) Reset() { *m = SecurityPoli func (m *SecurityPolicyDatabase_PolicyEntry) String() string { return proto.CompactTextString(m) } func (*SecurityPolicyDatabase_PolicyEntry) ProtoMessage() {} func (*SecurityPolicyDatabase_PolicyEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_ipsec_de07facc5beafc91, []int{0, 1} + return fileDescriptor_c27f07ec381ccc0c, []int{0, 1} } func (m *SecurityPolicyDatabase_PolicyEntry) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SecurityPolicyDatabase_PolicyEntry.Unmarshal(m, b) @@ -296,8 +306,8 @@ func (m *SecurityPolicyDatabase_PolicyEntry) XXX_Unmarshal(b []byte) error { func (m *SecurityPolicyDatabase_PolicyEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SecurityPolicyDatabase_PolicyEntry.Marshal(b, m, deterministic) } -func (dst *SecurityPolicyDatabase_PolicyEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityPolicyDatabase_PolicyEntry.Merge(dst, src) +func (m *SecurityPolicyDatabase_PolicyEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecurityPolicyDatabase_PolicyEntry.Merge(m, src) } func (m *SecurityPolicyDatabase_PolicyEntry) XXX_Size() int { return xxx_messageInfo_SecurityPolicyDatabase_PolicyEntry.Size(m) @@ -426,7 +436,7 @@ func (m *SecurityAssociation) Reset() { *m = SecurityAssociation{} } func (m *SecurityAssociation) String() string { return proto.CompactTextString(m) } func (*SecurityAssociation) ProtoMessage() {} func (*SecurityAssociation) Descriptor() ([]byte, []int) { - return fileDescriptor_ipsec_de07facc5beafc91, []int{1} + return fileDescriptor_c27f07ec381ccc0c, []int{1} } func (m *SecurityAssociation) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SecurityAssociation.Unmarshal(m, b) @@ -434,8 +444,8 @@ func (m *SecurityAssociation) XXX_Unmarshal(b []byte) error { func (m *SecurityAssociation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SecurityAssociation.Marshal(b, m, deterministic) } -func (dst *SecurityAssociation) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecurityAssociation.Merge(dst, src) +func (m *SecurityAssociation) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecurityAssociation.Merge(m, src) } func (m *SecurityAssociation) XXX_Size() int { return xxx_messageInfo_SecurityAssociation.Size(m) @@ -534,19 +544,19 @@ func (*SecurityAssociation) XXX_MessageName() string { return "vpp.ipsec.SecurityAssociation" } func init() { - proto.RegisterType((*SecurityPolicyDatabase)(nil), "vpp.ipsec.SecurityPolicyDatabase") - proto.RegisterType((*SecurityPolicyDatabase_Interface)(nil), "vpp.ipsec.SecurityPolicyDatabase.Interface") - proto.RegisterType((*SecurityPolicyDatabase_PolicyEntry)(nil), "vpp.ipsec.SecurityPolicyDatabase.PolicyEntry") - proto.RegisterType((*SecurityAssociation)(nil), "vpp.ipsec.SecurityAssociation") proto.RegisterEnum("vpp.ipsec.CryptoAlg", CryptoAlg_name, CryptoAlg_value) proto.RegisterEnum("vpp.ipsec.IntegAlg", IntegAlg_name, IntegAlg_value) proto.RegisterEnum("vpp.ipsec.SecurityPolicyDatabase_PolicyEntry_Action", SecurityPolicyDatabase_PolicyEntry_Action_name, SecurityPolicyDatabase_PolicyEntry_Action_value) proto.RegisterEnum("vpp.ipsec.SecurityAssociation_IPSecProtocol", SecurityAssociation_IPSecProtocol_name, SecurityAssociation_IPSecProtocol_value) + proto.RegisterType((*SecurityPolicyDatabase)(nil), "vpp.ipsec.SecurityPolicyDatabase") + proto.RegisterType((*SecurityPolicyDatabase_Interface)(nil), "vpp.ipsec.SecurityPolicyDatabase.Interface") + proto.RegisterType((*SecurityPolicyDatabase_PolicyEntry)(nil), "vpp.ipsec.SecurityPolicyDatabase.PolicyEntry") + proto.RegisterType((*SecurityAssociation)(nil), "vpp.ipsec.SecurityAssociation") } -func init() { proto.RegisterFile("models/vpp/ipsec/ipsec.proto", fileDescriptor_ipsec_de07facc5beafc91) } +func init() { proto.RegisterFile("models/vpp/ipsec/ipsec.proto", fileDescriptor_c27f07ec381ccc0c) } -var fileDescriptor_ipsec_de07facc5beafc91 = []byte{ +var fileDescriptor_c27f07ec381ccc0c = []byte{ // 919 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x5d, 0x6f, 0xdb, 0x36, 0x14, 0x8d, 0xec, 0x44, 0x96, 0xe9, 0xda, 0xd1, 0xd8, 0x62, 0xd3, 0xb2, 0x8f, 0x1a, 0x79, 0x18, diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l2/bridge-domain.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l2/bridge-domain.pb.go index 5a0894bff4..0f6a235a56 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l2/bridge-domain.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l2/bridge-domain.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/l2/bridge-domain.proto -package vpp_l2 // import "github.com/ligato/vpp-agent/api/models/vpp/l2" +package vpp_l2 -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -38,7 +40,7 @@ func (m *BridgeDomain) Reset() { *m = BridgeDomain{} } func (m *BridgeDomain) String() string { return proto.CompactTextString(m) } func (*BridgeDomain) ProtoMessage() {} func (*BridgeDomain) Descriptor() ([]byte, []int) { - return fileDescriptor_bridge_domain_7168cf77536c0bfe, []int{0} + return fileDescriptor_e6e82d8258425255, []int{0} } func (m *BridgeDomain) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BridgeDomain.Unmarshal(m, b) @@ -46,8 +48,8 @@ func (m *BridgeDomain) XXX_Unmarshal(b []byte) error { func (m *BridgeDomain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_BridgeDomain.Marshal(b, m, deterministic) } -func (dst *BridgeDomain) XXX_Merge(src proto.Message) { - xxx_messageInfo_BridgeDomain.Merge(dst, src) +func (m *BridgeDomain) XXX_Merge(src proto.Message) { + xxx_messageInfo_BridgeDomain.Merge(m, src) } func (m *BridgeDomain) XXX_Size() int { return xxx_messageInfo_BridgeDomain.Size(m) @@ -138,7 +140,7 @@ func (m *BridgeDomain_Interface) Reset() { *m = BridgeDomain_Interface{} func (m *BridgeDomain_Interface) String() string { return proto.CompactTextString(m) } func (*BridgeDomain_Interface) ProtoMessage() {} func (*BridgeDomain_Interface) Descriptor() ([]byte, []int) { - return fileDescriptor_bridge_domain_7168cf77536c0bfe, []int{0, 0} + return fileDescriptor_e6e82d8258425255, []int{0, 0} } func (m *BridgeDomain_Interface) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BridgeDomain_Interface.Unmarshal(m, b) @@ -146,8 +148,8 @@ func (m *BridgeDomain_Interface) XXX_Unmarshal(b []byte) error { func (m *BridgeDomain_Interface) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_BridgeDomain_Interface.Marshal(b, m, deterministic) } -func (dst *BridgeDomain_Interface) XXX_Merge(src proto.Message) { - xxx_messageInfo_BridgeDomain_Interface.Merge(dst, src) +func (m *BridgeDomain_Interface) XXX_Merge(src proto.Message) { + xxx_messageInfo_BridgeDomain_Interface.Merge(m, src) } func (m *BridgeDomain_Interface) XXX_Size() int { return xxx_messageInfo_BridgeDomain_Interface.Size(m) @@ -195,7 +197,7 @@ func (m *BridgeDomain_ArpTerminationEntry) Reset() { *m = BridgeDomain_A func (m *BridgeDomain_ArpTerminationEntry) String() string { return proto.CompactTextString(m) } func (*BridgeDomain_ArpTerminationEntry) ProtoMessage() {} func (*BridgeDomain_ArpTerminationEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_bridge_domain_7168cf77536c0bfe, []int{0, 1} + return fileDescriptor_e6e82d8258425255, []int{0, 1} } func (m *BridgeDomain_ArpTerminationEntry) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BridgeDomain_ArpTerminationEntry.Unmarshal(m, b) @@ -203,8 +205,8 @@ func (m *BridgeDomain_ArpTerminationEntry) XXX_Unmarshal(b []byte) error { func (m *BridgeDomain_ArpTerminationEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_BridgeDomain_ArpTerminationEntry.Marshal(b, m, deterministic) } -func (dst *BridgeDomain_ArpTerminationEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_BridgeDomain_ArpTerminationEntry.Merge(dst, src) +func (m *BridgeDomain_ArpTerminationEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_BridgeDomain_ArpTerminationEntry.Merge(m, src) } func (m *BridgeDomain_ArpTerminationEntry) XXX_Size() int { return xxx_messageInfo_BridgeDomain_ArpTerminationEntry.Size(m) @@ -238,11 +240,9 @@ func init() { proto.RegisterType((*BridgeDomain_ArpTerminationEntry)(nil), "vpp.l2.BridgeDomain.ArpTerminationEntry") } -func init() { - proto.RegisterFile("models/vpp/l2/bridge-domain.proto", fileDescriptor_bridge_domain_7168cf77536c0bfe) -} +func init() { proto.RegisterFile("models/vpp/l2/bridge-domain.proto", fileDescriptor_e6e82d8258425255) } -var fileDescriptor_bridge_domain_7168cf77536c0bfe = []byte{ +var fileDescriptor_e6e82d8258425255 = []byte{ // 455 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0x5d, 0x6f, 0xd3, 0x30, 0x14, 0x55, 0xb6, 0xae, 0xa5, 0xde, 0x06, 0xc2, 0x65, 0x5a, 0xa8, 0xc4, 0xd4, 0xf1, 0x42, 0x5e, diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l2/fib.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l2/fib.pb.go index 2fe1f713f5..eff926e0e2 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l2/fib.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l2/fib.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/l2/fib.proto -package vpp_l2 // import "github.com/ligato/vpp-agent/api/models/vpp/l2" +package vpp_l2 -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -30,6 +32,7 @@ var FIBEntry_Action_name = map[int32]string{ 0: "FORWARD", 1: "DROP", } + var FIBEntry_Action_value = map[string]int32{ "FORWARD": 0, "DROP": 1, @@ -38,8 +41,9 @@ var FIBEntry_Action_value = map[string]int32{ func (x FIBEntry_Action) String() string { return proto.EnumName(FIBEntry_Action_name, int32(x)) } + func (FIBEntry_Action) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_fib_aa3dfca3809353aa, []int{0, 0} + return fileDescriptor_a98c33506306c9f8, []int{0, 0} } type FIBEntry struct { @@ -58,7 +62,7 @@ func (m *FIBEntry) Reset() { *m = FIBEntry{} } func (m *FIBEntry) String() string { return proto.CompactTextString(m) } func (*FIBEntry) ProtoMessage() {} func (*FIBEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_fib_aa3dfca3809353aa, []int{0} + return fileDescriptor_a98c33506306c9f8, []int{0} } func (m *FIBEntry) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FIBEntry.Unmarshal(m, b) @@ -66,8 +70,8 @@ func (m *FIBEntry) XXX_Unmarshal(b []byte) error { func (m *FIBEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FIBEntry.Marshal(b, m, deterministic) } -func (dst *FIBEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_FIBEntry.Merge(dst, src) +func (m *FIBEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_FIBEntry.Merge(m, src) } func (m *FIBEntry) XXX_Size() int { return xxx_messageInfo_FIBEntry.Size(m) @@ -124,13 +128,13 @@ func (*FIBEntry) XXX_MessageName() string { return "vpp.l2.FIBEntry" } func init() { - proto.RegisterType((*FIBEntry)(nil), "vpp.l2.FIBEntry") proto.RegisterEnum("vpp.l2.FIBEntry_Action", FIBEntry_Action_name, FIBEntry_Action_value) + proto.RegisterType((*FIBEntry)(nil), "vpp.l2.FIBEntry") } -func init() { proto.RegisterFile("models/vpp/l2/fib.proto", fileDescriptor_fib_aa3dfca3809353aa) } +func init() { proto.RegisterFile("models/vpp/l2/fib.proto", fileDescriptor_a98c33506306c9f8) } -var fileDescriptor_fib_aa3dfca3809353aa = []byte{ +var fileDescriptor_a98c33506306c9f8 = []byte{ // 334 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xcf, 0x4e, 0x32, 0x31, 0x14, 0xc5, 0xbf, 0xe1, 0xc3, 0x11, 0x0b, 0x1a, 0xec, 0x86, 0xd1, 0x85, 0x22, 0x6e, 0xd8, 0x30, diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l2/xconnect.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l2/xconnect.pb.go index d9fd550dcb..a2ddf3d7a3 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l2/xconnect.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l2/xconnect.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/l2/xconnect.proto -package vpp_l2 // import "github.com/ligato/vpp-agent/api/models/vpp/l2" +package vpp_l2 -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -31,7 +33,7 @@ func (m *XConnectPair) Reset() { *m = XConnectPair{} } func (m *XConnectPair) String() string { return proto.CompactTextString(m) } func (*XConnectPair) ProtoMessage() {} func (*XConnectPair) Descriptor() ([]byte, []int) { - return fileDescriptor_xconnect_8821f5bfda282a42, []int{0} + return fileDescriptor_4ab826090403bbcd, []int{0} } func (m *XConnectPair) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_XConnectPair.Unmarshal(m, b) @@ -39,8 +41,8 @@ func (m *XConnectPair) XXX_Unmarshal(b []byte) error { func (m *XConnectPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_XConnectPair.Marshal(b, m, deterministic) } -func (dst *XConnectPair) XXX_Merge(src proto.Message) { - xxx_messageInfo_XConnectPair.Merge(dst, src) +func (m *XConnectPair) XXX_Merge(src proto.Message) { + xxx_messageInfo_XConnectPair.Merge(m, src) } func (m *XConnectPair) XXX_Size() int { return xxx_messageInfo_XConnectPair.Size(m) @@ -72,11 +74,9 @@ func init() { proto.RegisterType((*XConnectPair)(nil), "vpp.l2.XConnectPair") } -func init() { - proto.RegisterFile("models/vpp/l2/xconnect.proto", fileDescriptor_xconnect_8821f5bfda282a42) -} +func init() { proto.RegisterFile("models/vpp/l2/xconnect.proto", fileDescriptor_4ab826090403bbcd) } -var fileDescriptor_xconnect_8821f5bfda282a42 = []byte{ +var fileDescriptor_4ab826090403bbcd = []byte{ // 205 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc9, 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0xd6, 0x2f, 0x2b, 0x28, 0xd0, 0xcf, 0x31, 0xd2, 0xaf, 0x48, 0xce, 0xcf, 0xcb, 0x4b, diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/arp.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/arp.pb.go index 8e0c5fc6f1..51dbd54131 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/arp.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/arp.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/l3/arp.proto -package vpp_l3 // import "github.com/ligato/vpp-agent/api/models/vpp/l3" +package vpp_l3 -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -33,7 +35,7 @@ func (m *ARPEntry) Reset() { *m = ARPEntry{} } func (m *ARPEntry) String() string { return proto.CompactTextString(m) } func (*ARPEntry) ProtoMessage() {} func (*ARPEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_arp_c5efab006836d39b, []int{0} + return fileDescriptor_3384c7dc1e772a24, []int{0} } func (m *ARPEntry) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ARPEntry.Unmarshal(m, b) @@ -41,8 +43,8 @@ func (m *ARPEntry) XXX_Unmarshal(b []byte) error { func (m *ARPEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ARPEntry.Marshal(b, m, deterministic) } -func (dst *ARPEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_ARPEntry.Merge(dst, src) +func (m *ARPEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_ARPEntry.Merge(m, src) } func (m *ARPEntry) XXX_Size() int { return xxx_messageInfo_ARPEntry.Size(m) @@ -88,9 +90,9 @@ func init() { proto.RegisterType((*ARPEntry)(nil), "vpp.l3.ARPEntry") } -func init() { proto.RegisterFile("models/vpp/l3/arp.proto", fileDescriptor_arp_c5efab006836d39b) } +func init() { proto.RegisterFile("models/vpp/l3/arp.proto", fileDescriptor_3384c7dc1e772a24) } -var fileDescriptor_arp_c5efab006836d39b = []byte{ +var fileDescriptor_3384c7dc1e772a24 = []byte{ // 224 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0xd6, 0x2f, 0x2b, 0x28, 0xd0, 0xcf, 0x31, 0xd6, 0x4f, 0x2c, 0x2a, 0xd0, 0x2b, 0x28, diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/l3.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/l3.pb.go index 06924e0289..703d068cd5 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/l3.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/l3.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/l3/l3.proto -package vpp_l3 // import "github.com/ligato/vpp-agent/api/models/vpp/l3" +package vpp_l3 -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -34,6 +36,7 @@ var IPScanNeighbor_Mode_name = map[int32]string{ 2: "IPv6", 3: "BOTH", } + var IPScanNeighbor_Mode_value = map[string]int32{ "DISABLED": 0, "IPv4": 1, @@ -44,8 +47,9 @@ var IPScanNeighbor_Mode_value = map[string]int32{ func (x IPScanNeighbor_Mode) String() string { return proto.EnumName(IPScanNeighbor_Mode_name, int32(x)) } + func (IPScanNeighbor_Mode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_l3_0d071b38be421a84, []int{1, 0} + return fileDescriptor_81bc8b784b5befd5, []int{1, 0} } type ProxyARP struct { @@ -60,7 +64,7 @@ func (m *ProxyARP) Reset() { *m = ProxyARP{} } func (m *ProxyARP) String() string { return proto.CompactTextString(m) } func (*ProxyARP) ProtoMessage() {} func (*ProxyARP) Descriptor() ([]byte, []int) { - return fileDescriptor_l3_0d071b38be421a84, []int{0} + return fileDescriptor_81bc8b784b5befd5, []int{0} } func (m *ProxyARP) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ProxyARP.Unmarshal(m, b) @@ -68,8 +72,8 @@ func (m *ProxyARP) XXX_Unmarshal(b []byte) error { func (m *ProxyARP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ProxyARP.Marshal(b, m, deterministic) } -func (dst *ProxyARP) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProxyARP.Merge(dst, src) +func (m *ProxyARP) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProxyARP.Merge(m, src) } func (m *ProxyARP) XXX_Size() int { return xxx_messageInfo_ProxyARP.Size(m) @@ -109,7 +113,7 @@ func (m *ProxyARP_Interface) Reset() { *m = ProxyARP_Interface{} } func (m *ProxyARP_Interface) String() string { return proto.CompactTextString(m) } func (*ProxyARP_Interface) ProtoMessage() {} func (*ProxyARP_Interface) Descriptor() ([]byte, []int) { - return fileDescriptor_l3_0d071b38be421a84, []int{0, 0} + return fileDescriptor_81bc8b784b5befd5, []int{0, 0} } func (m *ProxyARP_Interface) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ProxyARP_Interface.Unmarshal(m, b) @@ -117,8 +121,8 @@ func (m *ProxyARP_Interface) XXX_Unmarshal(b []byte) error { func (m *ProxyARP_Interface) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ProxyARP_Interface.Marshal(b, m, deterministic) } -func (dst *ProxyARP_Interface) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProxyARP_Interface.Merge(dst, src) +func (m *ProxyARP_Interface) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProxyARP_Interface.Merge(m, src) } func (m *ProxyARP_Interface) XXX_Size() int { return xxx_messageInfo_ProxyARP_Interface.Size(m) @@ -152,7 +156,7 @@ func (m *ProxyARP_Range) Reset() { *m = ProxyARP_Range{} } func (m *ProxyARP_Range) String() string { return proto.CompactTextString(m) } func (*ProxyARP_Range) ProtoMessage() {} func (*ProxyARP_Range) Descriptor() ([]byte, []int) { - return fileDescriptor_l3_0d071b38be421a84, []int{0, 1} + return fileDescriptor_81bc8b784b5befd5, []int{0, 1} } func (m *ProxyARP_Range) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ProxyARP_Range.Unmarshal(m, b) @@ -160,8 +164,8 @@ func (m *ProxyARP_Range) XXX_Unmarshal(b []byte) error { func (m *ProxyARP_Range) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ProxyARP_Range.Marshal(b, m, deterministic) } -func (dst *ProxyARP_Range) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProxyARP_Range.Merge(dst, src) +func (m *ProxyARP_Range) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProxyARP_Range.Merge(m, src) } func (m *ProxyARP_Range) XXX_Size() int { return xxx_messageInfo_ProxyARP_Range.Size(m) @@ -206,7 +210,7 @@ func (m *IPScanNeighbor) Reset() { *m = IPScanNeighbor{} } func (m *IPScanNeighbor) String() string { return proto.CompactTextString(m) } func (*IPScanNeighbor) ProtoMessage() {} func (*IPScanNeighbor) Descriptor() ([]byte, []int) { - return fileDescriptor_l3_0d071b38be421a84, []int{1} + return fileDescriptor_81bc8b784b5befd5, []int{1} } func (m *IPScanNeighbor) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IPScanNeighbor.Unmarshal(m, b) @@ -214,8 +218,8 @@ func (m *IPScanNeighbor) XXX_Unmarshal(b []byte) error { func (m *IPScanNeighbor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_IPScanNeighbor.Marshal(b, m, deterministic) } -func (dst *IPScanNeighbor) XXX_Merge(src proto.Message) { - xxx_messageInfo_IPScanNeighbor.Merge(dst, src) +func (m *IPScanNeighbor) XXX_Merge(src proto.Message) { + xxx_messageInfo_IPScanNeighbor.Merge(m, src) } func (m *IPScanNeighbor) XXX_Size() int { return xxx_messageInfo_IPScanNeighbor.Size(m) @@ -272,16 +276,16 @@ func (*IPScanNeighbor) XXX_MessageName() string { return "vpp.l3.IPScanNeighbor" } func init() { + proto.RegisterEnum("vpp.l3.IPScanNeighbor_Mode", IPScanNeighbor_Mode_name, IPScanNeighbor_Mode_value) proto.RegisterType((*ProxyARP)(nil), "vpp.l3.ProxyARP") proto.RegisterType((*ProxyARP_Interface)(nil), "vpp.l3.ProxyARP.Interface") proto.RegisterType((*ProxyARP_Range)(nil), "vpp.l3.ProxyARP.Range") proto.RegisterType((*IPScanNeighbor)(nil), "vpp.l3.IPScanNeighbor") - proto.RegisterEnum("vpp.l3.IPScanNeighbor_Mode", IPScanNeighbor_Mode_name, IPScanNeighbor_Mode_value) } -func init() { proto.RegisterFile("models/vpp/l3/l3.proto", fileDescriptor_l3_0d071b38be421a84) } +func init() { proto.RegisterFile("models/vpp/l3/l3.proto", fileDescriptor_81bc8b784b5befd5) } -var fileDescriptor_l3_0d071b38be421a84 = []byte{ +var fileDescriptor_81bc8b784b5befd5 = []byte{ // 449 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0xcd, 0x8a, 0xdb, 0x30, 0x10, 0x80, 0xeb, 0xc4, 0x1b, 0x92, 0xc9, 0x4f, 0x83, 0x0e, 0x8b, 0x49, 0x69, 0x1b, 0xd2, 0x42, diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/route.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/route.pb.go index db9d29cba8..186fc1eb87 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/route.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/route.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/l3/route.proto -package vpp_l3 // import "github.com/ligato/vpp-agent/api/models/vpp/l3" +package vpp_l3 -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -32,6 +34,7 @@ var Route_RouteType_name = map[int32]string{ 1: "INTER_VRF", 2: "DROP", } + var Route_RouteType_value = map[string]int32{ "INTRA_VRF": 0, "INTER_VRF": 1, @@ -41,8 +44,9 @@ var Route_RouteType_value = map[string]int32{ func (x Route_RouteType) String() string { return proto.EnumName(Route_RouteType_name, int32(x)) } + func (Route_RouteType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_route_dcfac60fd0ffdb2f, []int{0, 0} + return fileDescriptor_2da88784f3005a3f, []int{0, 0} } type Route struct { @@ -64,7 +68,7 @@ func (m *Route) Reset() { *m = Route{} } func (m *Route) String() string { return proto.CompactTextString(m) } func (*Route) ProtoMessage() {} func (*Route) Descriptor() ([]byte, []int) { - return fileDescriptor_route_dcfac60fd0ffdb2f, []int{0} + return fileDescriptor_2da88784f3005a3f, []int{0} } func (m *Route) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Route.Unmarshal(m, b) @@ -72,8 +76,8 @@ func (m *Route) XXX_Unmarshal(b []byte) error { func (m *Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Route.Marshal(b, m, deterministic) } -func (dst *Route) XXX_Merge(src proto.Message) { - xxx_messageInfo_Route.Merge(dst, src) +func (m *Route) XXX_Merge(src proto.Message) { + xxx_messageInfo_Route.Merge(m, src) } func (m *Route) XXX_Size() int { return xxx_messageInfo_Route.Size(m) @@ -144,13 +148,13 @@ func (*Route) XXX_MessageName() string { return "vpp.l3.Route" } func init() { - proto.RegisterType((*Route)(nil), "vpp.l3.Route") proto.RegisterEnum("vpp.l3.Route_RouteType", Route_RouteType_name, Route_RouteType_value) + proto.RegisterType((*Route)(nil), "vpp.l3.Route") } -func init() { proto.RegisterFile("models/vpp/l3/route.proto", fileDescriptor_route_dcfac60fd0ffdb2f) } +func init() { proto.RegisterFile("models/vpp/l3/route.proto", fileDescriptor_2da88784f3005a3f) } -var fileDescriptor_route_dcfac60fd0ffdb2f = []byte{ +var fileDescriptor_2da88784f3005a3f = []byte{ // 356 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0x41, 0x4f, 0xfa, 0x30, 0x18, 0xc6, 0xff, 0xe3, 0x0f, 0x13, 0x5e, 0x82, 0xc1, 0x26, 0xea, 0x34, 0x06, 0x09, 0x27, 0x12, diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/vrf.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/vrf.pb.go index a757ca7d7a..dee5e8e12c 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/vrf.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/l3/vrf.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/l3/vrf.proto -package vpp_l3 // import "github.com/ligato/vpp-agent/api/models/vpp/l3" +package vpp_l3 -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -30,6 +32,7 @@ var VrfTable_Protocol_name = map[int32]string{ 0: "IPV4", 1: "IPV6", } + var VrfTable_Protocol_value = map[string]int32{ "IPV4": 0, "IPV6": 1, @@ -38,8 +41,9 @@ var VrfTable_Protocol_value = map[string]int32{ func (x VrfTable_Protocol) String() string { return proto.EnumName(VrfTable_Protocol_name, int32(x)) } + func (VrfTable_Protocol) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_vrf_e04bcc05f3e1cd73, []int{0, 0} + return fileDescriptor_1f737b4f5eb6705c, []int{0, 0} } type VrfTable struct { @@ -55,7 +59,7 @@ func (m *VrfTable) Reset() { *m = VrfTable{} } func (m *VrfTable) String() string { return proto.CompactTextString(m) } func (*VrfTable) ProtoMessage() {} func (*VrfTable) Descriptor() ([]byte, []int) { - return fileDescriptor_vrf_e04bcc05f3e1cd73, []int{0} + return fileDescriptor_1f737b4f5eb6705c, []int{0} } func (m *VrfTable) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_VrfTable.Unmarshal(m, b) @@ -63,8 +67,8 @@ func (m *VrfTable) XXX_Unmarshal(b []byte) error { func (m *VrfTable) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_VrfTable.Marshal(b, m, deterministic) } -func (dst *VrfTable) XXX_Merge(src proto.Message) { - xxx_messageInfo_VrfTable.Merge(dst, src) +func (m *VrfTable) XXX_Merge(src proto.Message) { + xxx_messageInfo_VrfTable.Merge(m, src) } func (m *VrfTable) XXX_Size() int { return xxx_messageInfo_VrfTable.Size(m) @@ -100,13 +104,13 @@ func (*VrfTable) XXX_MessageName() string { return "vpp.l3.VrfTable" } func init() { - proto.RegisterType((*VrfTable)(nil), "vpp.l3.VrfTable") proto.RegisterEnum("vpp.l3.VrfTable_Protocol", VrfTable_Protocol_name, VrfTable_Protocol_value) + proto.RegisterType((*VrfTable)(nil), "vpp.l3.VrfTable") } -func init() { proto.RegisterFile("models/vpp/l3/vrf.proto", fileDescriptor_vrf_e04bcc05f3e1cd73) } +func init() { proto.RegisterFile("models/vpp/l3/vrf.proto", fileDescriptor_1f737b4f5eb6705c) } -var fileDescriptor_vrf_e04bcc05f3e1cd73 = []byte{ +var fileDescriptor_1f737b4f5eb6705c = []byte{ // 229 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0xd6, 0x2f, 0x2b, 0x28, 0xd0, 0xcf, 0x31, 0xd6, 0x2f, 0x2b, 0x4a, 0xd3, 0x2b, 0x28, diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/nat/nat.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/nat/nat.pb.go index 572a90c625..b74df8f53a 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/nat/nat.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/nat/nat.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/nat/nat.proto -package vpp_nat // import "github.com/ligato/vpp-agent/api/models/vpp/nat" +package vpp_nat -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -32,6 +34,7 @@ var DNat44_Protocol_name = map[int32]string{ 1: "UDP", 2: "ICMP", } + var DNat44_Protocol_value = map[string]int32{ "TCP": 0, "UDP": 1, @@ -41,8 +44,9 @@ var DNat44_Protocol_value = map[string]int32{ func (x DNat44_Protocol) String() string { return proto.EnumName(DNat44_Protocol_name, int32(x)) } + func (DNat44_Protocol) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_nat_f475b98be573ded8, []int{1, 0} + return fileDescriptor_74abe0ababd815c7, []int{1, 0} } type DNat44_StaticMapping_TwiceNatMode int32 @@ -58,6 +62,7 @@ var DNat44_StaticMapping_TwiceNatMode_name = map[int32]string{ 1: "ENABLED", 2: "SELF", } + var DNat44_StaticMapping_TwiceNatMode_value = map[string]int32{ "DISABLED": 0, "ENABLED": 1, @@ -67,8 +72,9 @@ var DNat44_StaticMapping_TwiceNatMode_value = map[string]int32{ func (x DNat44_StaticMapping_TwiceNatMode) String() string { return proto.EnumName(DNat44_StaticMapping_TwiceNatMode_name, int32(x)) } + func (DNat44_StaticMapping_TwiceNatMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_nat_f475b98be573ded8, []int{1, 0, 0} + return fileDescriptor_74abe0ababd815c7, []int{1, 0, 0} } type Nat44Global struct { @@ -85,7 +91,7 @@ func (m *Nat44Global) Reset() { *m = Nat44Global{} } func (m *Nat44Global) String() string { return proto.CompactTextString(m) } func (*Nat44Global) ProtoMessage() {} func (*Nat44Global) Descriptor() ([]byte, []int) { - return fileDescriptor_nat_f475b98be573ded8, []int{0} + return fileDescriptor_74abe0ababd815c7, []int{0} } func (m *Nat44Global) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Nat44Global.Unmarshal(m, b) @@ -93,8 +99,8 @@ func (m *Nat44Global) XXX_Unmarshal(b []byte) error { func (m *Nat44Global) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Nat44Global.Marshal(b, m, deterministic) } -func (dst *Nat44Global) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nat44Global.Merge(dst, src) +func (m *Nat44Global) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nat44Global.Merge(m, src) } func (m *Nat44Global) XXX_Size() int { return xxx_messageInfo_Nat44Global.Size(m) @@ -150,7 +156,7 @@ func (m *Nat44Global_Interface) Reset() { *m = Nat44Global_Interface{} } func (m *Nat44Global_Interface) String() string { return proto.CompactTextString(m) } func (*Nat44Global_Interface) ProtoMessage() {} func (*Nat44Global_Interface) Descriptor() ([]byte, []int) { - return fileDescriptor_nat_f475b98be573ded8, []int{0, 0} + return fileDescriptor_74abe0ababd815c7, []int{0, 0} } func (m *Nat44Global_Interface) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Nat44Global_Interface.Unmarshal(m, b) @@ -158,8 +164,8 @@ func (m *Nat44Global_Interface) XXX_Unmarshal(b []byte) error { func (m *Nat44Global_Interface) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Nat44Global_Interface.Marshal(b, m, deterministic) } -func (dst *Nat44Global_Interface) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nat44Global_Interface.Merge(dst, src) +func (m *Nat44Global_Interface) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nat44Global_Interface.Merge(m, src) } func (m *Nat44Global_Interface) XXX_Size() int { return xxx_messageInfo_Nat44Global_Interface.Size(m) @@ -208,7 +214,7 @@ func (m *Nat44Global_Address) Reset() { *m = Nat44Global_Address{} } func (m *Nat44Global_Address) String() string { return proto.CompactTextString(m) } func (*Nat44Global_Address) ProtoMessage() {} func (*Nat44Global_Address) Descriptor() ([]byte, []int) { - return fileDescriptor_nat_f475b98be573ded8, []int{0, 1} + return fileDescriptor_74abe0ababd815c7, []int{0, 1} } func (m *Nat44Global_Address) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Nat44Global_Address.Unmarshal(m, b) @@ -216,8 +222,8 @@ func (m *Nat44Global_Address) XXX_Unmarshal(b []byte) error { func (m *Nat44Global_Address) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Nat44Global_Address.Marshal(b, m, deterministic) } -func (dst *Nat44Global_Address) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nat44Global_Address.Merge(dst, src) +func (m *Nat44Global_Address) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nat44Global_Address.Merge(m, src) } func (m *Nat44Global_Address) XXX_Size() int { return xxx_messageInfo_Nat44Global_Address.Size(m) @@ -266,7 +272,7 @@ func (m *DNat44) Reset() { *m = DNat44{} } func (m *DNat44) String() string { return proto.CompactTextString(m) } func (*DNat44) ProtoMessage() {} func (*DNat44) Descriptor() ([]byte, []int) { - return fileDescriptor_nat_f475b98be573ded8, []int{1} + return fileDescriptor_74abe0ababd815c7, []int{1} } func (m *DNat44) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DNat44.Unmarshal(m, b) @@ -274,8 +280,8 @@ func (m *DNat44) XXX_Unmarshal(b []byte) error { func (m *DNat44) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DNat44.Marshal(b, m, deterministic) } -func (dst *DNat44) XXX_Merge(src proto.Message) { - xxx_messageInfo_DNat44.Merge(dst, src) +func (m *DNat44) XXX_Merge(src proto.Message) { + xxx_messageInfo_DNat44.Merge(m, src) } func (m *DNat44) XXX_Size() int { return xxx_messageInfo_DNat44.Size(m) @@ -328,7 +334,7 @@ func (m *DNat44_StaticMapping) Reset() { *m = DNat44_StaticMapping{} } func (m *DNat44_StaticMapping) String() string { return proto.CompactTextString(m) } func (*DNat44_StaticMapping) ProtoMessage() {} func (*DNat44_StaticMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_nat_f475b98be573ded8, []int{1, 0} + return fileDescriptor_74abe0ababd815c7, []int{1, 0} } func (m *DNat44_StaticMapping) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DNat44_StaticMapping.Unmarshal(m, b) @@ -336,8 +342,8 @@ func (m *DNat44_StaticMapping) XXX_Unmarshal(b []byte) error { func (m *DNat44_StaticMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DNat44_StaticMapping.Marshal(b, m, deterministic) } -func (dst *DNat44_StaticMapping) XXX_Merge(src proto.Message) { - xxx_messageInfo_DNat44_StaticMapping.Merge(dst, src) +func (m *DNat44_StaticMapping) XXX_Merge(src proto.Message) { + xxx_messageInfo_DNat44_StaticMapping.Merge(m, src) } func (m *DNat44_StaticMapping) XXX_Size() int { return xxx_messageInfo_DNat44_StaticMapping.Size(m) @@ -415,7 +421,7 @@ func (m *DNat44_StaticMapping_LocalIP) Reset() { *m = DNat44_StaticMappi func (m *DNat44_StaticMapping_LocalIP) String() string { return proto.CompactTextString(m) } func (*DNat44_StaticMapping_LocalIP) ProtoMessage() {} func (*DNat44_StaticMapping_LocalIP) Descriptor() ([]byte, []int) { - return fileDescriptor_nat_f475b98be573ded8, []int{1, 0, 0} + return fileDescriptor_74abe0ababd815c7, []int{1, 0, 0} } func (m *DNat44_StaticMapping_LocalIP) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DNat44_StaticMapping_LocalIP.Unmarshal(m, b) @@ -423,8 +429,8 @@ func (m *DNat44_StaticMapping_LocalIP) XXX_Unmarshal(b []byte) error { func (m *DNat44_StaticMapping_LocalIP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DNat44_StaticMapping_LocalIP.Marshal(b, m, deterministic) } -func (dst *DNat44_StaticMapping_LocalIP) XXX_Merge(src proto.Message) { - xxx_messageInfo_DNat44_StaticMapping_LocalIP.Merge(dst, src) +func (m *DNat44_StaticMapping_LocalIP) XXX_Merge(src proto.Message) { + xxx_messageInfo_DNat44_StaticMapping_LocalIP.Merge(m, src) } func (m *DNat44_StaticMapping_LocalIP) XXX_Size() int { return xxx_messageInfo_DNat44_StaticMapping_LocalIP.Size(m) @@ -482,7 +488,7 @@ func (m *DNat44_IdentityMapping) Reset() { *m = DNat44_IdentityMapping{} func (m *DNat44_IdentityMapping) String() string { return proto.CompactTextString(m) } func (*DNat44_IdentityMapping) ProtoMessage() {} func (*DNat44_IdentityMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_nat_f475b98be573ded8, []int{1, 1} + return fileDescriptor_74abe0ababd815c7, []int{1, 1} } func (m *DNat44_IdentityMapping) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DNat44_IdentityMapping.Unmarshal(m, b) @@ -490,8 +496,8 @@ func (m *DNat44_IdentityMapping) XXX_Unmarshal(b []byte) error { func (m *DNat44_IdentityMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DNat44_IdentityMapping.Marshal(b, m, deterministic) } -func (dst *DNat44_IdentityMapping) XXX_Merge(src proto.Message) { - xxx_messageInfo_DNat44_IdentityMapping.Merge(dst, src) +func (m *DNat44_IdentityMapping) XXX_Merge(src proto.Message) { + xxx_messageInfo_DNat44_IdentityMapping.Merge(m, src) } func (m *DNat44_IdentityMapping) XXX_Size() int { return xxx_messageInfo_DNat44_IdentityMapping.Size(m) @@ -555,7 +561,7 @@ func (m *VirtualReassembly) Reset() { *m = VirtualReassembly{} } func (m *VirtualReassembly) String() string { return proto.CompactTextString(m) } func (*VirtualReassembly) ProtoMessage() {} func (*VirtualReassembly) Descriptor() ([]byte, []int) { - return fileDescriptor_nat_f475b98be573ded8, []int{2} + return fileDescriptor_74abe0ababd815c7, []int{2} } func (m *VirtualReassembly) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_VirtualReassembly.Unmarshal(m, b) @@ -563,8 +569,8 @@ func (m *VirtualReassembly) XXX_Unmarshal(b []byte) error { func (m *VirtualReassembly) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_VirtualReassembly.Marshal(b, m, deterministic) } -func (dst *VirtualReassembly) XXX_Merge(src proto.Message) { - xxx_messageInfo_VirtualReassembly.Merge(dst, src) +func (m *VirtualReassembly) XXX_Merge(src proto.Message) { + xxx_messageInfo_VirtualReassembly.Merge(m, src) } func (m *VirtualReassembly) XXX_Size() int { return xxx_messageInfo_VirtualReassembly.Size(m) @@ -607,6 +613,8 @@ func (*VirtualReassembly) XXX_MessageName() string { return "vpp.nat.VirtualReassembly" } func init() { + proto.RegisterEnum("vpp.nat.DNat44_Protocol", DNat44_Protocol_name, DNat44_Protocol_value) + proto.RegisterEnum("vpp.nat.DNat44_StaticMapping_TwiceNatMode", DNat44_StaticMapping_TwiceNatMode_name, DNat44_StaticMapping_TwiceNatMode_value) proto.RegisterType((*Nat44Global)(nil), "vpp.nat.Nat44Global") proto.RegisterType((*Nat44Global_Interface)(nil), "vpp.nat.Nat44Global.Interface") proto.RegisterType((*Nat44Global_Address)(nil), "vpp.nat.Nat44Global.Address") @@ -615,13 +623,11 @@ func init() { proto.RegisterType((*DNat44_StaticMapping_LocalIP)(nil), "vpp.nat.DNat44.StaticMapping.LocalIP") proto.RegisterType((*DNat44_IdentityMapping)(nil), "vpp.nat.DNat44.IdentityMapping") proto.RegisterType((*VirtualReassembly)(nil), "vpp.nat.VirtualReassembly") - proto.RegisterEnum("vpp.nat.DNat44_Protocol", DNat44_Protocol_name, DNat44_Protocol_value) - proto.RegisterEnum("vpp.nat.DNat44_StaticMapping_TwiceNatMode", DNat44_StaticMapping_TwiceNatMode_name, DNat44_StaticMapping_TwiceNatMode_value) } -func init() { proto.RegisterFile("models/vpp/nat/nat.proto", fileDescriptor_nat_f475b98be573ded8) } +func init() { proto.RegisterFile("models/vpp/nat/nat.proto", fileDescriptor_74abe0ababd815c7) } -var fileDescriptor_nat_f475b98be573ded8 = []byte{ +var fileDescriptor_74abe0ababd815c7 = []byte{ // 831 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x51, 0x6f, 0xe4, 0x34, 0x10, 0xbe, 0x74, 0xb7, 0x4d, 0x76, 0xd2, 0xed, 0x6d, 0x2d, 0x90, 0xc2, 0x72, 0xd7, 0x5b, 0x2d, diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/punt/punt.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/punt/punt.pb.go index a6c6e684fd..8322099ffb 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/punt/punt.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/punt/punt.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/punt/punt.proto -package vpp_punt // import "github.com/ligato/vpp-agent/api/models/vpp/punt" +package vpp_punt -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -34,6 +36,7 @@ var L3Protocol_name = map[int32]string{ 6: "IPv6", 10: "ALL", } + var L3Protocol_value = map[string]int32{ "UNDEFINED_L3": 0, "IPv4": 4, @@ -44,8 +47,9 @@ var L3Protocol_value = map[string]int32{ func (x L3Protocol) String() string { return proto.EnumName(L3Protocol_name, int32(x)) } + func (L3Protocol) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_punt_2718300ec8712d86, []int{0} + return fileDescriptor_c6553556423e0b80, []int{0} } type L4Protocol int32 @@ -61,6 +65,7 @@ var L4Protocol_name = map[int32]string{ 6: "TCP", 17: "UDP", } + var L4Protocol_value = map[string]int32{ "UNDEFINED_L4": 0, "TCP": 6, @@ -70,12 +75,13 @@ var L4Protocol_value = map[string]int32{ func (x L4Protocol) String() string { return proto.EnumName(L4Protocol_name, int32(x)) } + func (L4Protocol) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_punt_2718300ec8712d86, []int{1} + return fileDescriptor_c6553556423e0b80, []int{1} } // IPRedirect allows otherwise dropped packet which destination IP address matching some of the VPP addresses -// to redirect to the defined next hop address via the TX interface +//to redirect to the defined next hop address via the TX interface type IPRedirect struct { L3Protocol L3Protocol `protobuf:"varint,1,opt,name=l3_protocol,json=l3Protocol,proto3,enum=vpp.punt.L3Protocol" json:"l3_protocol,omitempty"` RxInterface string `protobuf:"bytes,2,opt,name=rx_interface,json=rxInterface,proto3" json:"rx_interface,omitempty"` @@ -90,7 +96,7 @@ func (m *IPRedirect) Reset() { *m = IPRedirect{} } func (m *IPRedirect) String() string { return proto.CompactTextString(m) } func (*IPRedirect) ProtoMessage() {} func (*IPRedirect) Descriptor() ([]byte, []int) { - return fileDescriptor_punt_2718300ec8712d86, []int{0} + return fileDescriptor_c6553556423e0b80, []int{0} } func (m *IPRedirect) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IPRedirect.Unmarshal(m, b) @@ -98,8 +104,8 @@ func (m *IPRedirect) XXX_Unmarshal(b []byte) error { func (m *IPRedirect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_IPRedirect.Marshal(b, m, deterministic) } -func (dst *IPRedirect) XXX_Merge(src proto.Message) { - xxx_messageInfo_IPRedirect.Merge(dst, src) +func (m *IPRedirect) XXX_Merge(src proto.Message) { + xxx_messageInfo_IPRedirect.Merge(m, src) } func (m *IPRedirect) XXX_Size() int { return xxx_messageInfo_IPRedirect.Size(m) @@ -143,7 +149,7 @@ func (*IPRedirect) XXX_MessageName() string { } // allows otherwise dropped packet which destination IP address matching some of the VPP interface IP addresses to be -// punted to the host. L3 and L4 protocols can be used for filtering +//punted to the host. L3 and L4 protocols can be used for filtering type ToHost struct { L3Protocol L3Protocol `protobuf:"varint,2,opt,name=l3_protocol,json=l3Protocol,proto3,enum=vpp.punt.L3Protocol" json:"l3_protocol,omitempty"` L4Protocol L4Protocol `protobuf:"varint,3,opt,name=l4_protocol,json=l4Protocol,proto3,enum=vpp.punt.L4Protocol" json:"l4_protocol,omitempty"` @@ -158,7 +164,7 @@ func (m *ToHost) Reset() { *m = ToHost{} } func (m *ToHost) String() string { return proto.CompactTextString(m) } func (*ToHost) ProtoMessage() {} func (*ToHost) Descriptor() ([]byte, []int) { - return fileDescriptor_punt_2718300ec8712d86, []int{1} + return fileDescriptor_c6553556423e0b80, []int{1} } func (m *ToHost) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ToHost.Unmarshal(m, b) @@ -166,8 +172,8 @@ func (m *ToHost) XXX_Unmarshal(b []byte) error { func (m *ToHost) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ToHost.Marshal(b, m, deterministic) } -func (dst *ToHost) XXX_Merge(src proto.Message) { - xxx_messageInfo_ToHost.Merge(dst, src) +func (m *ToHost) XXX_Merge(src proto.Message) { + xxx_messageInfo_ToHost.Merge(m, src) } func (m *ToHost) XXX_Size() int { return xxx_messageInfo_ToHost.Size(m) @@ -210,15 +216,15 @@ func (*ToHost) XXX_MessageName() string { return "vpp.punt.ToHost" } func init() { - proto.RegisterType((*IPRedirect)(nil), "vpp.punt.IPRedirect") - proto.RegisterType((*ToHost)(nil), "vpp.punt.ToHost") proto.RegisterEnum("vpp.punt.L3Protocol", L3Protocol_name, L3Protocol_value) proto.RegisterEnum("vpp.punt.L4Protocol", L4Protocol_name, L4Protocol_value) + proto.RegisterType((*IPRedirect)(nil), "vpp.punt.IPRedirect") + proto.RegisterType((*ToHost)(nil), "vpp.punt.ToHost") } -func init() { proto.RegisterFile("models/vpp/punt/punt.proto", fileDescriptor_punt_2718300ec8712d86) } +func init() { proto.RegisterFile("models/vpp/punt/punt.proto", fileDescriptor_c6553556423e0b80) } -var fileDescriptor_punt_2718300ec8712d86 = []byte{ +var fileDescriptor_c6553556423e0b80 = []byte{ // 372 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x6e, 0xa2, 0x50, 0x14, 0xc6, 0x45, 0x19, 0x75, 0x8e, 0xce, 0x84, 0xb9, 0x99, 0x05, 0xe3, 0x62, 0x6a, 0x5d, 0x19, diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/srv6/srv6.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/srv6/srv6.pb.go index 4ca72844f6..62420308cd 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/srv6/srv6.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/srv6/srv6.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/srv6/srv6.proto -package vpp_srv6 // import "github.com/ligato/vpp-agent/api/models/vpp/srv6" +package vpp_srv6 -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -44,7 +46,7 @@ func (m *LocalSID) Reset() { *m = LocalSID{} } func (m *LocalSID) String() string { return proto.CompactTextString(m) } func (*LocalSID) ProtoMessage() {} func (*LocalSID) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{0} + return fileDescriptor_dde832767c55fe4f, []int{0} } func (m *LocalSID) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LocalSID.Unmarshal(m, b) @@ -52,8 +54,8 @@ func (m *LocalSID) XXX_Unmarshal(b []byte) error { func (m *LocalSID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LocalSID.Marshal(b, m, deterministic) } -func (dst *LocalSID) XXX_Merge(src proto.Message) { - xxx_messageInfo_LocalSID.Merge(dst, src) +func (m *LocalSID) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalSID.Merge(m, src) } func (m *LocalSID) XXX_Size() int { return xxx_messageInfo_LocalSID.Size(m) @@ -413,7 +415,7 @@ func (m *LocalSID_End) Reset() { *m = LocalSID_End{} } func (m *LocalSID_End) String() string { return proto.CompactTextString(m) } func (*LocalSID_End) ProtoMessage() {} func (*LocalSID_End) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{0, 0} + return fileDescriptor_dde832767c55fe4f, []int{0, 0} } func (m *LocalSID_End) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LocalSID_End.Unmarshal(m, b) @@ -421,8 +423,8 @@ func (m *LocalSID_End) XXX_Unmarshal(b []byte) error { func (m *LocalSID_End) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LocalSID_End.Marshal(b, m, deterministic) } -func (dst *LocalSID_End) XXX_Merge(src proto.Message) { - xxx_messageInfo_LocalSID_End.Merge(dst, src) +func (m *LocalSID_End) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalSID_End.Merge(m, src) } func (m *LocalSID_End) XXX_Size() int { return xxx_messageInfo_LocalSID_End.Size(m) @@ -458,7 +460,7 @@ func (m *LocalSID_EndX) Reset() { *m = LocalSID_EndX{} } func (m *LocalSID_EndX) String() string { return proto.CompactTextString(m) } func (*LocalSID_EndX) ProtoMessage() {} func (*LocalSID_EndX) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{0, 1} + return fileDescriptor_dde832767c55fe4f, []int{0, 1} } func (m *LocalSID_EndX) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LocalSID_EndX.Unmarshal(m, b) @@ -466,8 +468,8 @@ func (m *LocalSID_EndX) XXX_Unmarshal(b []byte) error { func (m *LocalSID_EndX) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LocalSID_EndX.Marshal(b, m, deterministic) } -func (dst *LocalSID_EndX) XXX_Merge(src proto.Message) { - xxx_messageInfo_LocalSID_EndX.Merge(dst, src) +func (m *LocalSID_EndX) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalSID_EndX.Merge(m, src) } func (m *LocalSID_EndX) XXX_Size() int { return xxx_messageInfo_LocalSID_EndX.Size(m) @@ -516,7 +518,7 @@ func (m *LocalSID_EndT) Reset() { *m = LocalSID_EndT{} } func (m *LocalSID_EndT) String() string { return proto.CompactTextString(m) } func (*LocalSID_EndT) ProtoMessage() {} func (*LocalSID_EndT) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{0, 2} + return fileDescriptor_dde832767c55fe4f, []int{0, 2} } func (m *LocalSID_EndT) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LocalSID_EndT.Unmarshal(m, b) @@ -524,8 +526,8 @@ func (m *LocalSID_EndT) XXX_Unmarshal(b []byte) error { func (m *LocalSID_EndT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LocalSID_EndT.Marshal(b, m, deterministic) } -func (dst *LocalSID_EndT) XXX_Merge(src proto.Message) { - xxx_messageInfo_LocalSID_EndT.Merge(dst, src) +func (m *LocalSID_EndT) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalSID_EndT.Merge(m, src) } func (m *LocalSID_EndT) XXX_Size() int { return xxx_messageInfo_LocalSID_EndT.Size(m) @@ -567,7 +569,7 @@ func (m *LocalSID_EndDX2) Reset() { *m = LocalSID_EndDX2{} } func (m *LocalSID_EndDX2) String() string { return proto.CompactTextString(m) } func (*LocalSID_EndDX2) ProtoMessage() {} func (*LocalSID_EndDX2) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{0, 3} + return fileDescriptor_dde832767c55fe4f, []int{0, 3} } func (m *LocalSID_EndDX2) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LocalSID_EndDX2.Unmarshal(m, b) @@ -575,8 +577,8 @@ func (m *LocalSID_EndDX2) XXX_Unmarshal(b []byte) error { func (m *LocalSID_EndDX2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LocalSID_EndDX2.Marshal(b, m, deterministic) } -func (dst *LocalSID_EndDX2) XXX_Merge(src proto.Message) { - xxx_messageInfo_LocalSID_EndDX2.Merge(dst, src) +func (m *LocalSID_EndDX2) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalSID_EndDX2.Merge(m, src) } func (m *LocalSID_EndDX2) XXX_Size() int { return xxx_messageInfo_LocalSID_EndDX2.Size(m) @@ -618,7 +620,7 @@ func (m *LocalSID_EndDX4) Reset() { *m = LocalSID_EndDX4{} } func (m *LocalSID_EndDX4) String() string { return proto.CompactTextString(m) } func (*LocalSID_EndDX4) ProtoMessage() {} func (*LocalSID_EndDX4) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{0, 4} + return fileDescriptor_dde832767c55fe4f, []int{0, 4} } func (m *LocalSID_EndDX4) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LocalSID_EndDX4.Unmarshal(m, b) @@ -626,8 +628,8 @@ func (m *LocalSID_EndDX4) XXX_Unmarshal(b []byte) error { func (m *LocalSID_EndDX4) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LocalSID_EndDX4.Marshal(b, m, deterministic) } -func (dst *LocalSID_EndDX4) XXX_Merge(src proto.Message) { - xxx_messageInfo_LocalSID_EndDX4.Merge(dst, src) +func (m *LocalSID_EndDX4) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalSID_EndDX4.Merge(m, src) } func (m *LocalSID_EndDX4) XXX_Size() int { return xxx_messageInfo_LocalSID_EndDX4.Size(m) @@ -669,7 +671,7 @@ func (m *LocalSID_EndDX6) Reset() { *m = LocalSID_EndDX6{} } func (m *LocalSID_EndDX6) String() string { return proto.CompactTextString(m) } func (*LocalSID_EndDX6) ProtoMessage() {} func (*LocalSID_EndDX6) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{0, 5} + return fileDescriptor_dde832767c55fe4f, []int{0, 5} } func (m *LocalSID_EndDX6) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LocalSID_EndDX6.Unmarshal(m, b) @@ -677,8 +679,8 @@ func (m *LocalSID_EndDX6) XXX_Unmarshal(b []byte) error { func (m *LocalSID_EndDX6) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LocalSID_EndDX6.Marshal(b, m, deterministic) } -func (dst *LocalSID_EndDX6) XXX_Merge(src proto.Message) { - xxx_messageInfo_LocalSID_EndDX6.Merge(dst, src) +func (m *LocalSID_EndDX6) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalSID_EndDX6.Merge(m, src) } func (m *LocalSID_EndDX6) XXX_Size() int { return xxx_messageInfo_LocalSID_EndDX6.Size(m) @@ -719,7 +721,7 @@ func (m *LocalSID_EndDT4) Reset() { *m = LocalSID_EndDT4{} } func (m *LocalSID_EndDT4) String() string { return proto.CompactTextString(m) } func (*LocalSID_EndDT4) ProtoMessage() {} func (*LocalSID_EndDT4) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{0, 6} + return fileDescriptor_dde832767c55fe4f, []int{0, 6} } func (m *LocalSID_EndDT4) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LocalSID_EndDT4.Unmarshal(m, b) @@ -727,8 +729,8 @@ func (m *LocalSID_EndDT4) XXX_Unmarshal(b []byte) error { func (m *LocalSID_EndDT4) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LocalSID_EndDT4.Marshal(b, m, deterministic) } -func (dst *LocalSID_EndDT4) XXX_Merge(src proto.Message) { - xxx_messageInfo_LocalSID_EndDT4.Merge(dst, src) +func (m *LocalSID_EndDT4) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalSID_EndDT4.Merge(m, src) } func (m *LocalSID_EndDT4) XXX_Size() int { return xxx_messageInfo_LocalSID_EndDT4.Size(m) @@ -762,7 +764,7 @@ func (m *LocalSID_EndDT6) Reset() { *m = LocalSID_EndDT6{} } func (m *LocalSID_EndDT6) String() string { return proto.CompactTextString(m) } func (*LocalSID_EndDT6) ProtoMessage() {} func (*LocalSID_EndDT6) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{0, 7} + return fileDescriptor_dde832767c55fe4f, []int{0, 7} } func (m *LocalSID_EndDT6) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LocalSID_EndDT6.Unmarshal(m, b) @@ -770,8 +772,8 @@ func (m *LocalSID_EndDT6) XXX_Unmarshal(b []byte) error { func (m *LocalSID_EndDT6) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LocalSID_EndDT6.Marshal(b, m, deterministic) } -func (dst *LocalSID_EndDT6) XXX_Merge(src proto.Message) { - xxx_messageInfo_LocalSID_EndDT6.Merge(dst, src) +func (m *LocalSID_EndDT6) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalSID_EndDT6.Merge(m, src) } func (m *LocalSID_EndDT6) XXX_Size() int { return xxx_messageInfo_LocalSID_EndDT6.Size(m) @@ -807,7 +809,7 @@ func (m *LocalSID_EndAD) Reset() { *m = LocalSID_EndAD{} } func (m *LocalSID_EndAD) String() string { return proto.CompactTextString(m) } func (*LocalSID_EndAD) ProtoMessage() {} func (*LocalSID_EndAD) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{0, 8} + return fileDescriptor_dde832767c55fe4f, []int{0, 8} } func (m *LocalSID_EndAD) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LocalSID_EndAD.Unmarshal(m, b) @@ -815,8 +817,8 @@ func (m *LocalSID_EndAD) XXX_Unmarshal(b []byte) error { func (m *LocalSID_EndAD) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_LocalSID_EndAD.Marshal(b, m, deterministic) } -func (dst *LocalSID_EndAD) XXX_Merge(src proto.Message) { - xxx_messageInfo_LocalSID_EndAD.Merge(dst, src) +func (m *LocalSID_EndAD) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalSID_EndAD.Merge(m, src) } func (m *LocalSID_EndAD) XXX_Size() int { return xxx_messageInfo_LocalSID_EndAD.Size(m) @@ -868,7 +870,7 @@ func (m *Policy) Reset() { *m = Policy{} } func (m *Policy) String() string { return proto.CompactTextString(m) } func (*Policy) ProtoMessage() {} func (*Policy) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{1} + return fileDescriptor_dde832767c55fe4f, []int{1} } func (m *Policy) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Policy.Unmarshal(m, b) @@ -876,8 +878,8 @@ func (m *Policy) XXX_Unmarshal(b []byte) error { func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Policy.Marshal(b, m, deterministic) } -func (dst *Policy) XXX_Merge(src proto.Message) { - xxx_messageInfo_Policy.Merge(dst, src) +func (m *Policy) XXX_Merge(src proto.Message) { + xxx_messageInfo_Policy.Merge(m, src) } func (m *Policy) XXX_Size() int { return xxx_messageInfo_Policy.Size(m) @@ -940,7 +942,7 @@ func (m *Policy_SegmentList) Reset() { *m = Policy_SegmentList{} } func (m *Policy_SegmentList) String() string { return proto.CompactTextString(m) } func (*Policy_SegmentList) ProtoMessage() {} func (*Policy_SegmentList) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{1, 0} + return fileDescriptor_dde832767c55fe4f, []int{1, 0} } func (m *Policy_SegmentList) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Policy_SegmentList.Unmarshal(m, b) @@ -948,8 +950,8 @@ func (m *Policy_SegmentList) XXX_Unmarshal(b []byte) error { func (m *Policy_SegmentList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Policy_SegmentList.Marshal(b, m, deterministic) } -func (dst *Policy_SegmentList) XXX_Merge(src proto.Message) { - xxx_messageInfo_Policy_SegmentList.Merge(dst, src) +func (m *Policy_SegmentList) XXX_Merge(src proto.Message) { + xxx_messageInfo_Policy_SegmentList.Merge(m, src) } func (m *Policy_SegmentList) XXX_Size() int { return xxx_messageInfo_Policy_SegmentList.Size(m) @@ -1002,7 +1004,7 @@ func (m *Steering) Reset() { *m = Steering{} } func (m *Steering) String() string { return proto.CompactTextString(m) } func (*Steering) ProtoMessage() {} func (*Steering) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{2} + return fileDescriptor_dde832767c55fe4f, []int{2} } func (m *Steering) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Steering.Unmarshal(m, b) @@ -1010,8 +1012,8 @@ func (m *Steering) XXX_Unmarshal(b []byte) error { func (m *Steering) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Steering.Marshal(b, m, deterministic) } -func (dst *Steering) XXX_Merge(src proto.Message) { - xxx_messageInfo_Steering.Merge(dst, src) +func (m *Steering) XXX_Merge(src proto.Message) { + xxx_messageInfo_Steering.Merge(m, src) } func (m *Steering) XXX_Size() int { return xxx_messageInfo_Steering.Size(m) @@ -1225,7 +1227,7 @@ func (m *Steering_L2Traffic) Reset() { *m = Steering_L2Traffic{} } func (m *Steering_L2Traffic) String() string { return proto.CompactTextString(m) } func (*Steering_L2Traffic) ProtoMessage() {} func (*Steering_L2Traffic) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{2, 0} + return fileDescriptor_dde832767c55fe4f, []int{2, 0} } func (m *Steering_L2Traffic) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Steering_L2Traffic.Unmarshal(m, b) @@ -1233,8 +1235,8 @@ func (m *Steering_L2Traffic) XXX_Unmarshal(b []byte) error { func (m *Steering_L2Traffic) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Steering_L2Traffic.Marshal(b, m, deterministic) } -func (dst *Steering_L2Traffic) XXX_Merge(src proto.Message) { - xxx_messageInfo_Steering_L2Traffic.Merge(dst, src) +func (m *Steering_L2Traffic) XXX_Merge(src proto.Message) { + xxx_messageInfo_Steering_L2Traffic.Merge(m, src) } func (m *Steering_L2Traffic) XXX_Size() int { return xxx_messageInfo_Steering_L2Traffic.Size(m) @@ -1268,7 +1270,7 @@ func (m *Steering_L3Traffic) Reset() { *m = Steering_L3Traffic{} } func (m *Steering_L3Traffic) String() string { return proto.CompactTextString(m) } func (*Steering_L3Traffic) ProtoMessage() {} func (*Steering_L3Traffic) Descriptor() ([]byte, []int) { - return fileDescriptor_srv6_f12bcb35b7c14b74, []int{2, 1} + return fileDescriptor_dde832767c55fe4f, []int{2, 1} } func (m *Steering_L3Traffic) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Steering_L3Traffic.Unmarshal(m, b) @@ -1276,8 +1278,8 @@ func (m *Steering_L3Traffic) XXX_Unmarshal(b []byte) error { func (m *Steering_L3Traffic) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Steering_L3Traffic.Marshal(b, m, deterministic) } -func (dst *Steering_L3Traffic) XXX_Merge(src proto.Message) { - xxx_messageInfo_Steering_L3Traffic.Merge(dst, src) +func (m *Steering_L3Traffic) XXX_Merge(src proto.Message) { + xxx_messageInfo_Steering_L3Traffic.Merge(m, src) } func (m *Steering_L3Traffic) XXX_Size() int { return xxx_messageInfo_Steering_L3Traffic.Size(m) @@ -1323,9 +1325,9 @@ func init() { proto.RegisterType((*Steering_L3Traffic)(nil), "vpp.srv6.Steering.L3Traffic") } -func init() { proto.RegisterFile("models/vpp/srv6/srv6.proto", fileDescriptor_srv6_f12bcb35b7c14b74) } +func init() { proto.RegisterFile("models/vpp/srv6/srv6.proto", fileDescriptor_dde832767c55fe4f) } -var fileDescriptor_srv6_f12bcb35b7c14b74 = []byte{ +var fileDescriptor_dde832767c55fe4f = []byte{ // 874 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xed, 0x8a, 0xea, 0x46, 0x18, 0xc7, 0xcd, 0xba, 0xeb, 0x9a, 0xc7, 0x97, 0x5d, 0xa7, 0xf4, 0x9c, 0x9c, 0x50, 0x5a, 0xbb, diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/stn/stn.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/stn/stn.pb.go index 07a682a063..a1d872c9aa 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/stn/stn.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/stn/stn.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/stn/stn.proto -package vpp_stn // import "github.com/ligato/vpp-agent/api/models/vpp/stn" +package vpp_stn -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -31,7 +33,7 @@ func (m *Rule) Reset() { *m = Rule{} } func (m *Rule) String() string { return proto.CompactTextString(m) } func (*Rule) ProtoMessage() {} func (*Rule) Descriptor() ([]byte, []int) { - return fileDescriptor_stn_c27ff3c5a845be7c, []int{0} + return fileDescriptor_4386ef0f5c42cc0c, []int{0} } func (m *Rule) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Rule.Unmarshal(m, b) @@ -39,8 +41,8 @@ func (m *Rule) XXX_Unmarshal(b []byte) error { func (m *Rule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Rule.Marshal(b, m, deterministic) } -func (dst *Rule) XXX_Merge(src proto.Message) { - xxx_messageInfo_Rule.Merge(dst, src) +func (m *Rule) XXX_Merge(src proto.Message) { + xxx_messageInfo_Rule.Merge(m, src) } func (m *Rule) XXX_Size() int { return xxx_messageInfo_Rule.Size(m) @@ -72,9 +74,9 @@ func init() { proto.RegisterType((*Rule)(nil), "vpp.stn.Rule") } -func init() { proto.RegisterFile("models/vpp/stn/stn.proto", fileDescriptor_stn_c27ff3c5a845be7c) } +func init() { proto.RegisterFile("models/vpp/stn/stn.proto", fileDescriptor_4386ef0f5c42cc0c) } -var fileDescriptor_stn_c27ff3c5a845be7c = []byte{ +var fileDescriptor_4386ef0f5c42cc0c = []byte{ // 186 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc8, 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0xd6, 0x2f, 0x2b, 0x28, 0xd0, 0x2f, 0x2e, 0xc9, 0x03, 0x61, 0xbd, 0x82, 0xa2, 0xfc, diff --git a/vendor/github.com/ligato/vpp-agent/api/models/vpp/vpp.pb.go b/vendor/github.com/ligato/vpp-agent/api/models/vpp/vpp.pb.go index 3794b25ddd..5c42aba29a 100644 --- a/vendor/github.com/ligato/vpp-agent/api/models/vpp/vpp.pb.go +++ b/vendor/github.com/ligato/vpp-agent/api/models/vpp/vpp.pb.go @@ -1,18 +1,20 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: models/vpp/vpp.proto -package vpp // import "github.com/ligato/vpp-agent/api/models/vpp" +package vpp -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import acl "github.com/ligato/vpp-agent/api/models/vpp/acl" -import interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" -import ipsec "github.com/ligato/vpp-agent/api/models/vpp/ipsec" -import l2 "github.com/ligato/vpp-agent/api/models/vpp/l2" -import l3 "github.com/ligato/vpp-agent/api/models/vpp/l3" -import nat "github.com/ligato/vpp-agent/api/models/vpp/nat" -import punt "github.com/ligato/vpp-agent/api/models/vpp/punt" +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + acl "github.com/ligato/vpp-agent/api/models/vpp/acl" + interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" + ipsec "github.com/ligato/vpp-agent/api/models/vpp/ipsec" + l2 "github.com/ligato/vpp-agent/api/models/vpp/l2" + l3 "github.com/ligato/vpp-agent/api/models/vpp/l3" + nat "github.com/ligato/vpp-agent/api/models/vpp/nat" + punt "github.com/ligato/vpp-agent/api/models/vpp/punt" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -50,7 +52,7 @@ func (m *ConfigData) Reset() { *m = ConfigData{} } func (m *ConfigData) String() string { return proto.CompactTextString(m) } func (*ConfigData) ProtoMessage() {} func (*ConfigData) Descriptor() ([]byte, []int) { - return fileDescriptor_vpp_fc4bcc4ffdd9fa6c, []int{0} + return fileDescriptor_60d3c66428a08eaa, []int{0} } func (m *ConfigData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ConfigData.Unmarshal(m, b) @@ -58,8 +60,8 @@ func (m *ConfigData) XXX_Unmarshal(b []byte) error { func (m *ConfigData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ConfigData.Marshal(b, m, deterministic) } -func (dst *ConfigData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigData.Merge(dst, src) +func (m *ConfigData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigData.Merge(m, src) } func (m *ConfigData) XXX_Size() int { return xxx_messageInfo_ConfigData.Size(m) @@ -186,7 +188,7 @@ func (m *Notification) Reset() { *m = Notification{} } func (m *Notification) String() string { return proto.CompactTextString(m) } func (*Notification) ProtoMessage() {} func (*Notification) Descriptor() ([]byte, []int) { - return fileDescriptor_vpp_fc4bcc4ffdd9fa6c, []int{1} + return fileDescriptor_60d3c66428a08eaa, []int{1} } func (m *Notification) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Notification.Unmarshal(m, b) @@ -194,8 +196,8 @@ func (m *Notification) XXX_Unmarshal(b []byte) error { func (m *Notification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Notification.Marshal(b, m, deterministic) } -func (dst *Notification) XXX_Merge(src proto.Message) { - xxx_messageInfo_Notification.Merge(dst, src) +func (m *Notification) XXX_Merge(src proto.Message) { + xxx_messageInfo_Notification.Merge(m, src) } func (m *Notification) XXX_Size() int { return xxx_messageInfo_Notification.Size(m) @@ -218,9 +220,9 @@ func init() { proto.RegisterType((*Notification)(nil), "vpp.Notification") } -func init() { proto.RegisterFile("models/vpp/vpp.proto", fileDescriptor_vpp_fc4bcc4ffdd9fa6c) } +func init() { proto.RegisterFile("models/vpp/vpp.proto", fileDescriptor_60d3c66428a08eaa) } -var fileDescriptor_vpp_fc4bcc4ffdd9fa6c = []byte{ +var fileDescriptor_60d3c66428a08eaa = []byte{ // 646 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0x5f, 0x6b, 0xdb, 0x3c, 0x14, 0xc6, 0x29, 0x2d, 0x7d, 0x1b, 0x35, 0xfd, 0x83, 0x28, 0x7d, 0xd5, 0x30, 0xba, 0xb4, 0xac, diff --git a/vendor/github.com/ligato/vpp-agent/pkg/util/proto.go b/vendor/github.com/ligato/vpp-agent/pkg/util/proto.go new file mode 100644 index 0000000000..12368b5217 --- /dev/null +++ b/vendor/github.com/ligato/vpp-agent/pkg/util/proto.go @@ -0,0 +1,76 @@ +// Copyright (c) 2019 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package util + +import ( + "reflect" + + "github.com/gogo/protobuf/proto" +) + +func ExtractProtos(from ...interface{}) (protos []proto.Message) { + for _, v := range from { + if reflect.ValueOf(v).IsNil() { + continue + } + val := reflect.ValueOf(v).Elem() + typ := val.Type() + if typ.Kind() != reflect.Struct { + return + } + for i := 0; i < typ.NumField(); i++ { + field := val.Field(i) + if field.Kind() == reflect.Slice { + for idx := 0; idx < field.Len(); idx++ { + elem := field.Index(idx) + if msg, ok := elem.Interface().(proto.Message); ok { + protos = append(protos, msg) + } + } + } else if field.Kind() == reflect.Ptr && !field.IsNil() { + if msg, ok := field.Interface().(proto.Message); ok && !field.IsNil() { + protos = append(protos, msg) + } + } + } + } + return +} + +func PlaceProtos(protos map[string]proto.Message, dsts ...interface{}) { + for _, prot := range protos { + protTyp := reflect.TypeOf(prot) + for _, dst := range dsts { + dstVal := reflect.ValueOf(dst).Elem() + dstTyp := dstVal.Type() + if dstTyp.Kind() != reflect.Struct { + return + } + for i := 0; i < dstTyp.NumField(); i++ { + field := dstVal.Field(i) + if field.Kind() == reflect.Slice { + if protTyp.AssignableTo(field.Type().Elem()) { + field.Set(reflect.Append(field, reflect.ValueOf(prot))) + } + } else { + if field.Type() == protTyp { + field.Set(reflect.ValueOf(prot)) + } + } + } + } + } + return +} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/configurator/configurator.go b/vendor/github.com/ligato/vpp-agent/plugins/configurator/configurator.go new file mode 100644 index 0000000000..6eca6d6c85 --- /dev/null +++ b/vendor/github.com/ligato/vpp-agent/plugins/configurator/configurator.go @@ -0,0 +1,109 @@ +package configurator + +import ( + "runtime/trace" + + "github.com/gogo/status" + "github.com/ligato/cn-infra/logging" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + + rpc "github.com/ligato/vpp-agent/api/configurator" + "github.com/ligato/vpp-agent/api/models/linux" + "github.com/ligato/vpp-agent/api/models/vpp" + "github.com/ligato/vpp-agent/pkg/models" + "github.com/ligato/vpp-agent/pkg/util" + kvs "github.com/ligato/vpp-agent/plugins/kvscheduler/api" + "github.com/ligato/vpp-agent/plugins/orchestrator" +) + +// configuratorServer implements DataSyncer service. +type configuratorServer struct { + dumpService + notifyService + + log logging.Logger + dispatch orchestrator.Dispatcher +} + +// Get retrieves actual configuration data. +func (svc *configuratorServer) Get(context.Context, *rpc.GetRequest) (*rpc.GetResponse, error) { + defer trackOperation("Get")() + + config := newConfig() + + util.PlaceProtos(svc.dispatch.ListData(), config.LinuxConfig, config.VppConfig) + + return &rpc.GetResponse{Config: config}, nil +} + +// Update adds configuration data present in data request to the VPP/Linux +func (svc *configuratorServer) Update(ctx context.Context, req *rpc.UpdateRequest) (*rpc.UpdateResponse, error) { + ctx, task := trace.NewTask(ctx, "grpc.Update") + defer task.End() + trace.Logf(ctx, "updateData", "%+v", req) + + defer trackOperation("Update")() + + protos := util.ExtractProtos(req.Update.VppConfig, req.Update.LinuxConfig) + + var kvPairs []orchestrator.KeyVal + for _, p := range protos { + key, err := models.GetKey(p) + if err != nil { + svc.log.Debug("models.GetKey failed: %s", err) + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + kvPairs = append(kvPairs, orchestrator.KeyVal{ + Key: key, + Val: p, + }) + } + + if req.FullResync { + ctx = kvs.WithResync(ctx, kvs.FullResync, true) + } + + ctx = orchestrator.DataSrcContext(ctx, "grpc") + if _, err := svc.dispatch.PushData(ctx, kvPairs); err != nil { + st := status.New(codes.FailedPrecondition, err.Error()) + return nil, st.Err() + } + + return &rpc.UpdateResponse{}, nil +} + +// Delete removes configuration data present in data request from the VPP/linux +func (svc *configuratorServer) Delete(ctx context.Context, req *rpc.DeleteRequest) (*rpc.DeleteResponse, error) { + defer trackOperation("Delete")() + + protos := util.ExtractProtos(req.Delete.VppConfig, req.Delete.LinuxConfig) + + var kvPairs []orchestrator.KeyVal + for _, p := range protos { + key, err := models.GetKey(p) + if err != nil { + svc.log.Debug("models.GetKey failed: %s", err) + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + kvPairs = append(kvPairs, orchestrator.KeyVal{ + Key: key, + Val: nil, + }) + } + + ctx = orchestrator.DataSrcContext(ctx, "grpc") + if _, err := svc.dispatch.PushData(ctx, kvPairs); err != nil { + st := status.New(codes.FailedPrecondition, err.Error()) + return nil, st.Err() + } + + return &rpc.DeleteResponse{}, nil +} + +func newConfig() *rpc.Config { + return &rpc.Config{ + LinuxConfig: &linux.ConfigData{}, + VppConfig: &vpp.ConfigData{}, + } +} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/configurator/dump.go b/vendor/github.com/ligato/vpp-agent/plugins/configurator/dump.go new file mode 100644 index 0000000000..380aaf3454 --- /dev/null +++ b/vendor/github.com/ligato/vpp-agent/plugins/configurator/dump.go @@ -0,0 +1,334 @@ +package configurator + +import ( + "github.com/go-errors/errors" + "github.com/ligato/cn-infra/logging" + "golang.org/x/net/context" + + rpc "github.com/ligato/vpp-agent/api/configurator" + vpp_acl "github.com/ligato/vpp-agent/api/models/vpp/acl" + vpp_interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" + vpp_ipsec "github.com/ligato/vpp-agent/api/models/vpp/ipsec" + vpp_l2 "github.com/ligato/vpp-agent/api/models/vpp/l2" + vpp_l3 "github.com/ligato/vpp-agent/api/models/vpp/l3" + vpp_punt "github.com/ligato/vpp-agent/api/models/vpp/punt" + iflinuxcalls "github.com/ligato/vpp-agent/plugins/linux/ifplugin/linuxcalls" + l3linuxcalls "github.com/ligato/vpp-agent/plugins/linux/l3plugin/linuxcalls" + aclvppcalls "github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls" + ifvppcalls "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls" + ipsecvppcalls "github.com/ligato/vpp-agent/plugins/vpp/ipsecplugin/vppcalls" + l2vppcalls "github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls" + l3vppcalls "github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls" + natvppcalls "github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls" + "github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls" +) + +type dumpService struct { + log logging.Logger + + // VPP Handlers + aclHandler aclvppcalls.ACLVppRead + ifHandler ifvppcalls.InterfaceVppRead + natHandler natvppcalls.NatVppRead + l2Handler l2vppcalls.L2VppAPI + l3Handler l3vppcalls.L3VppAPI + ipsecHandler ipsecvppcalls.IPSecVPPRead + puntHandler vppcalls.PuntVPPRead + // Linux handlers + linuxIfHandler iflinuxcalls.NetlinkAPIRead + linuxL3Handler l3linuxcalls.NetlinkAPIRead +} + +func (svc *dumpService) Dump(context.Context, *rpc.DumpRequest) (*rpc.DumpResponse, error) { + defer trackOperation("Dump")() + + svc.log.Debugf("Received Dump request..") + + dump := newConfig() + + var err error + + dump.VppConfig.Interfaces, err = svc.DumpInterfaces() + if err != nil { + svc.log.Errorf("DumpInterfaces failed: %v", err) + return nil, err + } + dump.VppConfig.Acls, err = svc.DumpAcls() + if err != nil { + svc.log.Errorf("DumpAcls failed: %v", err) + return nil, err + } + dump.VppConfig.IpsecSpds, err = svc.DumpIPSecSPDs() + if err != nil { + svc.log.Errorf("DumpIPSecSPDs failed: %v", err) + return nil, err + } + dump.VppConfig.IpsecSas, err = svc.DumpIPSecSAs() + if err != nil { + svc.log.Errorf("DumpIPSecSAs failed: %v", err) + return nil, err + } + dump.VppConfig.BridgeDomains, err = svc.DumpBDs() + if err != nil { + svc.log.Errorf("DumpBDs failed: %v", err) + return nil, err + } + dump.VppConfig.Routes, err = svc.DumpRoutes() + if err != nil { + svc.log.Errorf("DumpRoutes failed: %v", err) + return nil, err + } + dump.VppConfig.Arps, err = svc.DumpARPs() + if err != nil { + svc.log.Errorf("DumpARPs failed: %v", err) + return nil, err + } + dump.VppConfig.Fibs, err = svc.DumpFIBs() + if err != nil { + svc.log.Errorf("DumpFIBs failed: %v", err) + return nil, err + } + dump.VppConfig.XconnectPairs, err = svc.DumpXConnects() + if err != nil { + svc.log.Errorf("DumpXConnects failed: %v", err) + return nil, err + } + dump.VppConfig.PuntTohosts, err = svc.DumpPunt() + if err != nil { + svc.log.Errorf("DumpPunt failed: %v", err) + return nil, err + } + + // FIXME: linux interface handler should return known proto instead of netlink + // state.LinuxData.Interfaces, _ = svc.DumpLinuxInterfaces() + + return &rpc.DumpResponse{Dump: dump}, nil +} + +// DumpAcls reads IP/MACIP access lists and returns them as an *AclResponse. If reading ends up with error, +// only error is send back in response +func (svc *dumpService) DumpAcls() ([]*vpp_acl.ACL, error) { + var acls []*vpp_acl.ACL + if svc.aclHandler == nil { + return nil, errors.New("aclHandler is not available") + } + ipACLs, err := svc.aclHandler.DumpACL() + if err != nil { + return nil, err + } + macIPACLs, err := svc.aclHandler.DumpMACIPACL() + if err != nil { + return nil, err + } + for _, aclDetails := range ipACLs { + acls = append(acls, aclDetails.ACL) + } + for _, aclDetails := range macIPACLs { + acls = append(acls, aclDetails.ACL) + } + + return acls, nil +} + +// DumpInterfaces reads interfaces and returns them as an *InterfaceResponse. If reading ends up with error, +// only error is send back in response +func (svc *dumpService) DumpInterfaces() ([]*vpp_interfaces.Interface, error) { + var ifs []*vpp_interfaces.Interface + ifDetails, err := svc.ifHandler.DumpInterfaces() + if err != nil { + return nil, err + } + for _, iface := range ifDetails { + ifs = append(ifs, iface.Interface) + } + + return ifs, nil +} + +// DumpIPSecSPDs reads IPSec SPD and returns them as an *IPSecSPDResponse. If reading ends up with error, +// only error is send back in response +func (svc *dumpService) DumpIPSecSPDs() ([]*vpp_ipsec.SecurityPolicyDatabase, error) { + var spds []*vpp_ipsec.SecurityPolicyDatabase + if svc.ipsecHandler == nil { + return nil, errors.New("ipsecHandler is not available") + } + spdDetails, err := svc.ipsecHandler.DumpIPSecSPD() + if err != nil { + return nil, err + } + for _, spd := range spdDetails { + spds = append(spds, spd.Spd) + } + + return spds, nil +} + +// DumpIPSecSAs reads IPSec SA and returns them as an *IPSecSAResponse. If reading ends up with error, +// only error is send back in response +func (svc *dumpService) DumpIPSecSAs() ([]*vpp_ipsec.SecurityAssociation, error) { + var sas []*vpp_ipsec.SecurityAssociation + if svc.ipsecHandler == nil { + return nil, errors.New("ipsecHandler is not available") + } + saDetails, err := svc.ipsecHandler.DumpIPSecSA() + if err != nil { + return nil, err + } + for _, sa := range saDetails { + sas = append(sas, sa.Sa) + } + + return sas, nil +} + +// DumpIPSecTunnels reads IPSec tunnels and returns them as an *IPSecTunnelResponse. If reading ends up with error, +// only error is send back in response +/*func (svc *dumpService) DumpIPSecTunnels() (*rpc.IPSecTunnelResponse, error) { + var tuns []*vpp_ipsec. + tunDetails, err := svc.ipSecHandler.DumpIPSecTunnelInterfaces() + if err != nil { + return nil, err + } + for _, tun := range tunDetails { + tuns = append(tuns, tun.Tunnel) + } + + return &rpc.IPSecTunnelResponse{Tunnels: tuns}, nil +}*/ + +// DumpBDs reads bridge domains and returns them as an *BDResponse. If reading ends up with error, +// only error is send back in response +func (svc *dumpService) DumpBDs() ([]*vpp_l2.BridgeDomain, error) { + var bds []*vpp_l2.BridgeDomain + bdDetails, err := svc.l2Handler.DumpBridgeDomains() + if err != nil { + return nil, err + } + for _, bd := range bdDetails { + bds = append(bds, bd.Bd) + } + + return bds, nil +} + +// DumpFIBs reads FIBs and returns them as an *FibResponse. If reading ends up with error, +// only error is send back in response +func (svc *dumpService) DumpFIBs() ([]*vpp_l2.FIBEntry, error) { + var fibs []*vpp_l2.FIBEntry + fibDetails, err := svc.l2Handler.DumpL2FIBs() + if err != nil { + return nil, err + } + for _, fib := range fibDetails { + fibs = append(fibs, fib.Fib) + } + + return fibs, nil +} + +// DumpXConnects reads cross connects and returns them as an *XcResponse. If reading ends up with error, +// only error is send back in response +func (svc *dumpService) DumpXConnects() ([]*vpp_l2.XConnectPair, error) { + var xcs []*vpp_l2.XConnectPair + xcDetails, err := svc.l2Handler.DumpXConnectPairs() + if err != nil { + return nil, err + } + for _, xc := range xcDetails { + xcs = append(xcs, xc.Xc) + } + + return xcs, nil +} + +// DumpRoutes reads VPP routes and returns them as an *RoutesResponse. If reading ends up with error, +// only error is send back in response +func (svc *dumpService) DumpRoutes() ([]*vpp_l3.Route, error) { + var routes []*vpp_l3.Route + rtDetails, err := svc.l3Handler.DumpRoutes() + if err != nil { + return nil, err + } + for _, rt := range rtDetails { + routes = append(routes, rt.Route) + } + + return routes, nil +} + +// DumpARPs reads VPP ARPs and returns them as an *ARPsResponse. If reading ends up with error, +// only error is send back in response +func (svc *dumpService) DumpARPs() ([]*vpp_l3.ARPEntry, error) { + var arps []*vpp_l3.ARPEntry + arpDetails, err := svc.l3Handler.DumpArpEntries() + if err != nil { + return nil, err + } + for _, arp := range arpDetails { + arps = append(arps, arp.Arp) + } + + return arps, nil +} + +// DumpPunt reads VPP Punt socket registrations and returns them as an *PuntResponse. +func (svc *dumpService) DumpPunt() (punts []*vpp_punt.ToHost, err error) { + if svc.puntHandler == nil { + return nil, errors.New("puntHandler is not available") + } + dump, err := svc.puntHandler.DumpRegisteredPuntSockets() + if err != nil { + return nil, err + } + for _, puntDetails := range dump { + punts = append(punts, puntDetails.PuntData) + } + + return punts, nil +} + +// DumpLinuxInterfaces reads linux interfaces and returns them as an *LinuxInterfaceResponse. If reading ends up with error, +// only error is send back in response +/*func (svc *dumpService) DumpLinuxInterfaces() ([]*linux_interfaces.Interface, error) { + var linuxIfs []*linux_interfaces.Interface + ifDetails, err := svc.linuxIfHandler.GetLinkList() + if err != nil { + return nil, err + } + for _, iface := range ifDetails { + linuxIfs = append(linuxIfs, ) + } + + return linuxIfs, nil +} + +// DumpLinuxARPs reads linux ARPs and returns them as an *LinuxARPsResponse. If reading ends up with error, +// only error is send back in response +func (svc *dumpService) DumpLinuxARPs(ctx context.Context, request *rpc.DumpRequest) (*rpc.LinuxARPsResponse, error) { + var linuxArps []*linuxL3.LinuxStaticArpEntries_ArpEntry + arpDetails, err := svc.linuxL3Handler.DumpArpEntries() + if err != nil { + return nil, err + } + for _, arp := range arpDetails { + linuxArps = append(linuxArps, arp.Arp) + } + + return &rpc.LinuxARPsResponse{LinuxArpEntries: linuxArps}, nil +} + +// DumpLinuxRoutes reads linux routes and returns them as an *LinuxRoutesResponse. If reading ends up with error, +// only error is send back in response +func (svc *dumpService) DumpLinuxRoutes(ctx context.Context, request *rpc.DumpRequest) (*rpc.LinuxRoutesResponse, error) { + var linuxRoutes []*linuxL3.LinuxStaticRoutes_Route + rtDetails, err := svc.linuxL3Handler.DumpRoutes() + if err != nil { + return nil, err + } + for _, rt := range rtDetails { + linuxRoutes = append(linuxRoutes, rt.Route) + } + + return &rpc.LinuxRoutesResponse{LinuxRoutes: linuxRoutes}, nil +} +*/ diff --git a/vendor/github.com/ligato/vpp-agent/plugins/configurator/notify.go b/vendor/github.com/ligato/vpp-agent/plugins/configurator/notify.go new file mode 100644 index 0000000000..d24fbd974f --- /dev/null +++ b/vendor/github.com/ligato/vpp-agent/plugins/configurator/notify.go @@ -0,0 +1,79 @@ +// Copyright (c) 2019 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package configurator + +import ( + "sync" + + "github.com/gogo/protobuf/proto" + "github.com/ligato/cn-infra/logging" + rpc "github.com/ligato/vpp-agent/api/configurator" +) + +// Maximum number of messages stored in the buffer. Buffer is always filled from left +// to right (it means that if the buffer is full, a new entry is written to the index 0) +const bufferSize = 1000 + +// notifyService forwards GRPC messages to external servers. +type notifyService struct { + log logging.Logger + + // VPP notifications available for clients + mx sync.RWMutex + buffer [bufferSize]rpc.NotificationResponse + curIdx uint32 +} + +// Notify returns all required VPP notifications (or those available in the buffer) in the same order as they were received +func (svc *notifyService) Notify(from *rpc.NotificationRequest, server rpc.Configurator_NotifyServer) error { + svc.mx.RLock() + defer svc.mx.RUnlock() + + // Copy requested index locally + fromIdx := from.Idx + + // Check if requested index overflows buffer length + if svc.curIdx-from.Idx > bufferSize { + fromIdx = svc.curIdx - bufferSize + } + + // Start from requested index until the most recent entry + for i := fromIdx; i < svc.curIdx; i++ { + entry := svc.buffer[i%bufferSize] + if err := server.Send(&entry); err != nil { + svc.log.Error("Send notification error: %v", err) + return err + } + } + + return nil +} + +// Pushes new notification to the buffer. The order of notifications is preserved. +func (svc *notifyService) pushNotification(notification *rpc.Notification) { + // notification is cloned to ensure it does not get changed after storing + notifCopy := proto.Clone(notification).(*rpc.Notification) + + svc.mx.Lock() + defer svc.mx.Unlock() + + // Notification index starts with 1 + notif := rpc.NotificationResponse{ + NextIdx: svc.curIdx + 1, + Notification: notifCopy, + } + svc.buffer[svc.curIdx%bufferSize] = notif + svc.curIdx++ +} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/configurator/options.go b/vendor/github.com/ligato/vpp-agent/plugins/configurator/options.go new file mode 100644 index 0000000000..4b2ed3d451 --- /dev/null +++ b/vendor/github.com/ligato/vpp-agent/plugins/configurator/options.go @@ -0,0 +1,56 @@ +// Copyright (c) 2019 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package configurator + +import ( + "github.com/ligato/cn-infra/rpc/grpc" + "github.com/ligato/vpp-agent/plugins/govppmux" + "github.com/ligato/vpp-agent/plugins/orchestrator" + "github.com/ligato/vpp-agent/plugins/vpp/ifplugin" + "github.com/ligato/vpp-agent/plugins/vpp/l2plugin" +) + +// DefaultPlugin is default instance of Plugin +var DefaultPlugin = *NewPlugin() + +// NewPlugin creates a new Plugin with the provides Options +func NewPlugin(opts ...Option) *Plugin { + p := &Plugin{} + + p.PluginName = "configurator" + p.GRPCServer = &grpc.DefaultPlugin + p.Dispatch = &orchestrator.DefaultPlugin + p.GoVppmux = &govppmux.DefaultPlugin + p.VPPIfPlugin = &ifplugin.DefaultPlugin + p.VPPL2Plugin = &l2plugin.DefaultPlugin + + for _, o := range opts { + o(p) + } + + p.PluginDeps.Setup() + + return p +} + +// Option is a function that acts on a Plugin to inject Dependencies or configuration +type Option func(*Plugin) + +// UseDeps returns Option that can inject custom dependencies. +func UseDeps(cb func(*Deps)) Option { + return func(p *Plugin) { + cb(&p.Deps) + } +} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/configurator/plugin.go b/vendor/github.com/ligato/vpp-agent/plugins/configurator/plugin.go new file mode 100644 index 0000000000..ec5e41d090 --- /dev/null +++ b/vendor/github.com/ligato/vpp-agent/plugins/configurator/plugin.go @@ -0,0 +1,124 @@ +// Copyright (c) 2019 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package configurator + +import ( + "git.fd.io/govpp.git/api" + "github.com/ligato/vpp-agent/api/models/vpp" + "github.com/ligato/vpp-agent/plugins/orchestrator" + ipsecvppcalls "github.com/ligato/vpp-agent/plugins/vpp/ipsecplugin/vppcalls" + puntvppcalls "github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls" + + "github.com/ligato/cn-infra/infra" + "github.com/ligato/cn-infra/rpc/grpc" + + rpc "github.com/ligato/vpp-agent/api/configurator" + "github.com/ligato/vpp-agent/plugins/govppmux" + iflinuxcalls "github.com/ligato/vpp-agent/plugins/linux/ifplugin/linuxcalls" + l3linuxcalls "github.com/ligato/vpp-agent/plugins/linux/l3plugin/linuxcalls" + aclvppcalls "github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls" + "github.com/ligato/vpp-agent/plugins/vpp/ifplugin" + ifvppcalls "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls" + "github.com/ligato/vpp-agent/plugins/vpp/l2plugin" + l2vppcalls "github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls" + l3vppcalls "github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls" + natvppcalls "github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls" +) + +// Plugin registers VPP GRPC services in *grpc.Server. +type Plugin struct { + Deps + + configurator configuratorServer + + // Channels + vppChan api.Channel + dumpChan api.Channel +} + +// Deps - dependencies of Plugin +type Deps struct { + infra.PluginDeps + GRPCServer grpc.Server + Dispatch orchestrator.Dispatcher + GoVppmux govppmux.StatsAPI + VPPIfPlugin ifplugin.API + VPPL2Plugin *l2plugin.L2Plugin +} + +// Init sets plugin child loggers +func (p *Plugin) Init() error { + p.configurator.log = p.Log.NewLogger("configurator") + p.configurator.dumpService.log = p.Log.NewLogger("dump") + p.configurator.notifyService.log = p.Log.NewLogger("notify") + p.configurator.dispatch = p.Dispatch + + if err := p.initHandlers(); err != nil { + return err + } + + grpcServer := p.GRPCServer.GetServer() + if grpcServer != nil { + rpc.RegisterConfiguratorServer(grpcServer, &p.configurator) + } + + if p.VPPIfPlugin != nil { + p.VPPIfPlugin.SetNotifyService(func(vppNotification *vpp.Notification) { + p.configurator.notifyService.pushNotification(&rpc.Notification{ + Notification: &rpc.Notification_VppNotification{ + VppNotification: vppNotification, + }, + }) + }) + } + + return nil +} + +// Close does nothing. +func (p *Plugin) Close() error { + return nil +} + +// helper method initializes all VPP/Linux plugin handlers +func (p *Plugin) initHandlers() (err error) { + // VPP channels + if p.vppChan, err = p.GoVppmux.NewAPIChannel(); err != nil { + return err + } + if p.dumpChan, err = p.GoVppmux.NewAPIChannel(); err != nil { + return err + } + + // VPP Indexes + ifIndexes := p.VPPIfPlugin.GetInterfaceIndex() + bdIndexes := p.VPPL2Plugin.GetBDIndex() + dhcpIndexes := p.VPPIfPlugin.GetDHCPIndex() + + // Initialize VPP handlers + p.configurator.aclHandler = aclvppcalls.CompatibleACLVppHandler(p.vppChan, p.dumpChan, ifIndexes, p.Log) + p.configurator.ifHandler = ifvppcalls.CompatibleInterfaceVppHandler(p.vppChan, p.Log) + p.configurator.natHandler = natvppcalls.CompatibleNatVppHandler(p.vppChan, ifIndexes, dhcpIndexes, p.Log) + p.configurator.l2Handler = l2vppcalls.CompatibleL2VppHandler(p.vppChan, ifIndexes, bdIndexes, p.Log) + p.configurator.l3Handler = l3vppcalls.CompatibleL3VppHandler(p.vppChan, ifIndexes, p.Log) + p.configurator.ipsecHandler = ipsecvppcalls.CompatibleIPSecVppHandler(p.vppChan, ifIndexes, p.Log) + p.configurator.puntHandler = puntvppcalls.CompatiblePuntVppHandler(p.vppChan, ifIndexes, p.Log) + + // Linux indexes and handlers + p.configurator.linuxIfHandler = iflinuxcalls.NewNetLinkHandler() + p.configurator.linuxL3Handler = l3linuxcalls.NewNetLinkHandler() + + return nil +} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/configurator/stats.go b/vendor/github.com/ligato/vpp-agent/plugins/configurator/stats.go new file mode 100644 index 0000000000..447e55c8db --- /dev/null +++ b/vendor/github.com/ligato/vpp-agent/plugins/configurator/stats.go @@ -0,0 +1,76 @@ +// Copyright (c) 2019 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package configurator + +import ( + "expvar" + "sync" + "time" + + "github.com/ligato/vpp-agent/pkg/metrics" +) + +var ( + stats Stats + statsMu sync.RWMutex +) + +func init() { + stats.Operations = make(metrics.Calls) +} + +func GetStats() *Stats { + s := new(Stats) + statsMu.RLock() + *s = stats + statsMu.RUnlock() + return s +} + +type Stats struct { + AllOperations metrics.CallStats + Operations metrics.Calls +} + +func (s *Stats) getOrCreateOperation(msg string) *metrics.CallStats { + statsMu.RLock() + ms, ok := s.Operations[msg] + statsMu.RUnlock() + if !ok { + ms = &metrics.CallStats{Name: msg} + statsMu.Lock() + s.Operations[msg] = ms + statsMu.Unlock() + } + return ms +} + +func trackOperation(m string) func() { + t := time.Now() + ms := stats.getOrCreateOperation(m) + return func() { + took := time.Since(t) + statsMu.Lock() + ms.Increment(took) + stats.AllOperations.Increment(took) + statsMu.Unlock() + } +} + +func init() { + expvar.Publish("configurator-stats", expvar.Func(func() interface{} { + return GetStats() + })) +} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/govppmux/README.md b/vendor/github.com/ligato/vpp-agent/plugins/govppmux/README.md deleted file mode 100644 index 883808f455..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/govppmux/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# GoVPP Mux - -The `govppmux` is a Core Agent Plugin which allows other plugins to access VPP -independently on each other by means of connection multiplexing. - -Any plugin (core or external) that interacts with VPP can ask `govppmux` -to get its own, potentially customized, communication channel to running VPP instance. -Behind the scenes, all channels share the same connection created during the plugin -initialization using govpp core. - -## API - -### Connection - -By default, GoVPP connects to that instance of VPP which uses the default shared memory segment prefix. -This is because it is assumed that there is only a single VPP running in a sand-boxed environment -together with the agent (e.g. through containerization). In case VPP runs with customized SHM prefix, -or there are several VPP instances running, GoVPP needs to know the prefix in order to connect to the -correct VPP instance - the prefix has to be put in the govppmux configuration file (govpp.conf) with -key `shm-prefix` and value matching VPP shared memory prefix. - -### Multiplexing - -`NewAPIChannel` returns a new API channel for communication with VPP via govpp core. -It uses default buffer sizes for the request and reply Go channels (by default both are 100 messages long). - -If it is expected that the VPP may get overloaded at peak loads, for example if the user plugin -sends configuration requests in bulks, then it is recommended to use `NewAPIChannelBuffered` -and increase the buffer size for requests appropriately. Similarly, `NewAPIChannelBuffered` allows -to configure the size of the buffer for responses. This is also useful since the buffer for responses -is also used to carry VPP notifications and statistics which may temporarily rapidly grow in size -and frequency. By increasing the reply channel size, the probability of dropping messages from VPP -decreases at the cost of increased memory footprint. - -### Example - -The following example shows how to dump VPP interfaces using a multi-response request: -``` -// Create a new VPP channel with the default configuration. -plugin.vppCh, err = govppmux.NewAPIChannel() -if err != nil { - // Handle error condition... -} -// Close VPP channel. -defer safeclose.Close(plugin.vppCh) - -req := &interfaces.SwInterfaceDump{} -reqCtx := plugin.vppCh.SendMultiRequest(req) - -for { - msg := &interfaces.SwInterfaceDetails{} - stop, err := reqCtx.ReceiveReply(msg) - if err != nil { - // Handle error condition... - } - - // Break out of the loop in case there are no more messages. - if stop { - break - } - - log.Info("Found interface with sw_if_index=", msg.SwIfIndex) - // Process the message... -} - -``` - -## Configuration - -The plugin allows to configure parameters of vpp health-check probe. -The items that can be configured are: -- *health check probe interval* - time between health check probes -- *health check reply timeout* - if the reply doesn't arrive until timeout -elapses probe is considered failed -- *health check threshold* - number of consequent failed health checks -until an error is reported -- *reply timeout* - if the reply from channel doesn't arrive until timeout -elapses, the request fails -- *shm-prefix* - used for connection to a VPP instance which is not using -default shared memory prefix -- *resync-after-reconnect* - allows to run resync after recoonection - -## Trace - -Duration of the VPP binary api call can be measured using trace feature. These data are logged after -every event(any resync, interfaces, bridge domains, fib entries etc.). Enable trace in govpp.conf: - -`trace-enabled: true` or `trace-enabled: false` - -Trace is disabled by default (if there is no config available). \ No newline at end of file diff --git a/vendor/github.com/ligato/vpp-agent/plugins/govppmux/plugin_impl_govppmux.go b/vendor/github.com/ligato/vpp-agent/plugins/govppmux/plugin_impl_govppmux.go index d55ecbb3d8..c21c7957cc 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/govppmux/plugin_impl_govppmux.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/govppmux/plugin_impl_govppmux.go @@ -32,7 +32,6 @@ import ( "github.com/ligato/vpp-agent/plugins/govppmux/vppcalls" - _ "github.com/ligato/vpp-agent/plugins/govppmux/vppcalls/vpp1810" _ "github.com/ligato/vpp-agent/plugins/govppmux/vppcalls/vpp1901" _ "github.com/ligato/vpp-agent/plugins/govppmux/vppcalls/vpp1904" ) diff --git a/vendor/github.com/ligato/vpp-agent/plugins/govppmux/vppcalls/vpp1810/vpe_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/govppmux/vppcalls/vpp1810/vpe_vppcalls.go deleted file mode 100644 index 1f9d05fa64..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/govppmux/vppcalls/vpp1810/vpe_vppcalls.go +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "bytes" - "strings" - - govppapi "git.fd.io/govpp.git/api" - - "github.com/ligato/vpp-agent/plugins/govppmux/vppcalls" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/memclnt" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vpe" -) - -func init() { - var msgs []govppapi.Message - msgs = append(msgs, vpe.Messages...) - msgs = append(msgs, memclnt.Messages...) - - vppcalls.Versions["vpp1810"] = vppcalls.HandlerVersion{ - Msgs: msgs, - New: func(ch govppapi.Channel) vppcalls.VpeVppAPI { - return NewVpeHandler(ch) - }, - } -} - -type VpeHandler struct { - ch govppapi.Channel -} - -func NewVpeHandler(ch govppapi.Channel) *VpeHandler { - return &VpeHandler{ch} -} - -// Ping pings the VPP. -func (h *VpeHandler) Ping() error { - req := &vpe.ControlPing{} - reply := &vpe.ControlPingReply{} - - return h.ch.SendRequest(req).ReceiveReply(reply) -} - -func (h *VpeHandler) GetVersionInfo() (*vppcalls.VersionInfo, error) { - req := &vpe.ShowVersion{} - reply := &vpe.ShowVersionReply{} - - if err := h.ch.SendRequest(req).ReceiveReply(reply); err != nil { - return nil, err - } - - info := &vppcalls.VersionInfo{ - Program: string(cleanBytes(reply.Program)), - Version: string(cleanBytes(reply.Version)), - BuildDate: string(cleanBytes(reply.BuildDate)), - BuildDirectory: string(cleanBytes(reply.BuildDirectory)), - } - - return info, nil -} - -// GetVpeInfo retrieves vpe information. -func (h *VpeHandler) GetVpeInfo() (*vppcalls.VpeInfo, error) { - req := &vpe.ControlPing{} - reply := &vpe.ControlPingReply{} - - if err := h.ch.SendRequest(req).ReceiveReply(reply); err != nil { - return nil, err - } - - info := &vppcalls.VpeInfo{ - PID: reply.VpePID, - ClientIdx: reply.ClientIndex, - } - - { - req := &memclnt.APIVersions{} - reply := &memclnt.APIVersionsReply{} - - if err := h.ch.SendRequest(req).ReceiveReply(reply); err != nil { - return nil, err - } - - for _, v := range reply.APIVersions { - name := string(cleanBytes(v.Name)) - name = strings.TrimSuffix(name, ".api") - info.ModuleVersions = append(info.ModuleVersions, vppcalls.ModuleVersion{ - Name: name, - Major: v.Major, - Minor: v.Minor, - Patch: v.Patch, - }) - } - } - - return info, nil -} - -func (h *VpeHandler) RunCli(cmd string) (string, error) { - req := &vpe.CliInband{ - Cmd: []byte(cmd), - Length: uint32(len(cmd)), - } - reply := &vpe.CliInbandReply{} - - if err := h.ch.SendRequest(req).ReceiveReply(reply); err != nil { - return "", err - } - - return string(cleanBytes(reply.Reply)), nil -} - -func cleanBytes(b []byte) []byte { - return bytes.SplitN(b, []byte{0x00}, 2)[0] -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/internal/graph/edge_lookup.go b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/internal/graph/edge_lookup.go index 0146c09605..78ce9d7cb1 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/internal/graph/edge_lookup.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/internal/graph/edge_lookup.go @@ -32,24 +32,30 @@ const ( // edgeLookup is a helper tool used internally by kvgraph for **efficient** lookups // over the set of graph edges, defined using keys or key prefixes. type edgeLookup struct { - nodeKeys []nodeKey // for O(log(n)) lookups against key prefixes - nodeKeysMap map[string]bool // for O(1) lookups against full keys - removedNodes int + nodeKeyData []nodeKey + nodeKeyOffset []int // for O(log(n)) lookups against key prefixes + nodeKeyMap map[string]bool // for O(1) lookups against full keys + removedNodes int - edges []edge + edgeData []edge // unordered + edgeOffset []int // ordered first by directory depth, then lexicographically by edge data removedEdges int // edges are first sorted (split) by the number of target key components (directories) - // -> dirDepthBounds[dirCount] = index of the first edge in whose + // -> dirDepthBounds[dirCount] = index of the first edge in whose // targetKey consists of directories (incl. the last suffix) dirDepthBounds []int overlay *edgeLookup underlay *edgeLookup + + methodTracker MethodTracker } type nodeKey struct { key string removed bool + + decOffset int // used internally in gcNodeKeys() } type edge struct { @@ -62,22 +68,29 @@ type edge struct { label string removed bool + + decOffset int // used internally in gcEdges() } -func newEdgeLookup() *edgeLookup { +func newEdgeLookup(mt MethodTracker) *edgeLookup { return &edgeLookup{ - nodeKeys: make([]nodeKey, 0, initNodeKeysCap), - nodeKeysMap: make(map[string]bool), - edges: make([]edge, 0, initEdgesCap), + nodeKeyData: make([]nodeKey, 0, initNodeKeysCap), + nodeKeyOffset: make([]int, 0, initNodeKeysCap), + nodeKeyMap: make(map[string]bool), + edgeData: make([]edge, 0, initEdgesCap), + edgeOffset: make([]int, 0, initEdgesCap), dirDepthBounds: make([]int, 0, initDirDepthBoundsCap), + methodTracker: mt, } } func (el *edgeLookup) reset() { - el.nodeKeysMap = make(map[string]bool) - el.nodeKeys = el.nodeKeys[:0] + el.nodeKeyMap = make(map[string]bool) + el.nodeKeyData = el.nodeKeyData[:0] + el.nodeKeyOffset = el.nodeKeyOffset[:0] el.removedNodes = 0 - el.edges = el.edges[:0] + el.edgeData = el.edgeData[:0] + el.edgeOffset = el.edgeOffset[:0] el.dirDepthBounds = el.dirDepthBounds[:0] el.removedEdges = 0 } @@ -86,20 +99,24 @@ func (el *edgeLookup) makeOverlay() *edgeLookup { if el.overlay == nil { // create overlay for the first time el.overlay = &edgeLookup{ - nodeKeys: make([]nodeKey, 0, max(len(el.nodeKeys), initNodeKeysCap)), - edges: make([]edge, 0, max(len(el.edges), initEdgesCap)), + nodeKeyData: make([]nodeKey, 0, max(len(el.nodeKeyData), initNodeKeysCap)), + nodeKeyOffset: make([]int, 0, max(len(el.nodeKeyOffset), initNodeKeysCap)), + edgeData: make([]edge, 0, max(len(el.edgeData), initEdgesCap)), + edgeOffset: make([]int, 0, max(len(el.edgeOffset), initEdgesCap)), dirDepthBounds: make([]int, 0, max(len(el.dirDepthBounds), initDirDepthBoundsCap)), underlay: el, } } // re-use previously allocated memory - el.overlay.resizeNodeKeys(len(el.nodeKeys)) - el.overlay.resizeEdges(len(el.edges)) + el.overlay.resizeNodeKeys(len(el.nodeKeyOffset)) + el.overlay.resizeEdges(len(el.edgeOffset)) el.overlay.resizeDirDepthBounds(len(el.dirDepthBounds)) - copy(el.overlay.nodeKeys, el.nodeKeys) - copy(el.overlay.edges, el.edges) + copy(el.overlay.nodeKeyData, el.nodeKeyData) + copy(el.overlay.nodeKeyOffset, el.nodeKeyOffset) + copy(el.overlay.edgeData, el.edgeData) + copy(el.overlay.edgeOffset, el.edgeOffset) copy(el.overlay.dirDepthBounds, el.dirDepthBounds) - el.overlay.nodeKeysMap = make(map[string]bool) + el.overlay.nodeKeyMap = make(map[string]bool) el.overlay.removedEdges = el.removedEdges el.overlay.removedNodes = el.removedNodes return el.overlay @@ -111,108 +128,148 @@ func (el *edgeLookup) saveOverlay() { } el.underlay.removedNodes = el.removedNodes el.underlay.removedEdges = el.removedEdges - for key, add := range el.nodeKeysMap { + for key, add := range el.nodeKeyMap { if add { - el.underlay.nodeKeysMap[key] = true + el.underlay.nodeKeyMap[key] = true } else { - delete(el.underlay.nodeKeysMap, key) + delete(el.underlay.nodeKeyMap, key) } } - el.nodeKeysMap = make(map[string]bool) // clear - el.underlay.resizeNodeKeys(len(el.nodeKeys)) - el.underlay.resizeEdges(len(el.edges)) + el.nodeKeyMap = make(map[string]bool) // clear + el.underlay.resizeNodeKeys(len(el.nodeKeyOffset)) + el.underlay.resizeEdges(len(el.edgeOffset)) el.underlay.resizeDirDepthBounds(len(el.dirDepthBounds)) - copy(el.underlay.nodeKeys, el.nodeKeys) - copy(el.underlay.edges, el.edges) + copy(el.underlay.nodeKeyData, el.nodeKeyData) + copy(el.underlay.nodeKeyOffset, el.nodeKeyOffset) + copy(el.underlay.edgeData, el.edgeData) + copy(el.underlay.edgeOffset, el.edgeOffset) copy(el.underlay.dirDepthBounds, el.dirDepthBounds) } // O(log(n)) func (el *edgeLookup) addNodeKey(key string) { - el.nodeKeysMap[key] = true + if el.methodTracker != nil { + defer el.methodTracker("edgeLookup.addNodeKey")() + } + + el.nodeKeyMap[key] = true + + // find the corresponding index in nodeKeyOffset idx := el.nodeKeyIdx(key) - if idx < len(el.nodeKeys) && el.nodeKeys[idx].key == key { - if el.nodeKeys[idx].removed { - el.nodeKeys[idx].removed = false - el.removedNodes-- + if idx < len(el.nodeKeyOffset) { + offset := el.nodeKeyOffset[idx] + if el.nodeKeyData[offset].key == key { + if el.nodeKeyData[offset].removed { + el.nodeKeyData[offset].removed = false + el.removedNodes-- + } + return } - return } - el.nodeKeys = append(el.nodeKeys, nodeKey{}) - if idx < len(el.nodeKeys)-1 { - copy(el.nodeKeys[idx+1:], el.nodeKeys[idx:]) + + // add to both nodeKeyOffset and nodeKeyData + el.nodeKeyData = append(el.nodeKeyData, nodeKey{}) + offset := len(el.nodeKeyData) - 1 + el.nodeKeyData[offset].key = key + el.nodeKeyData[offset].removed = false + el.nodeKeyOffset = append(el.nodeKeyOffset, -1) + if idx < len(el.nodeKeyOffset)-1 { + copy(el.nodeKeyOffset[idx+1:], el.nodeKeyOffset[idx:]) } - el.nodeKeys[idx].key = key - el.nodeKeys[idx].removed = false + el.nodeKeyOffset[idx] = offset } // O(log(n)) amortized func (el *edgeLookup) delNodeKey(key string) { + if el.methodTracker != nil { + defer el.methodTracker("edgeLookup.delNodeKey")() + } + if el.underlay != nil { // this is overlay, remember operation - el.nodeKeysMap[key] = false + el.nodeKeyMap[key] = false } else { // do not store false, otherwise memory usage will grow - delete(el.nodeKeysMap, key) + delete(el.nodeKeyMap, key) } idx := el.nodeKeyIdx(key) - if idx < len(el.nodeKeys) && el.nodeKeys[idx].key == key && !el.nodeKeys[idx].removed { - el.nodeKeys[idx].removed = true - el.removedNodes++ - if el.removedNodes > len(el.nodeKeys)/2 { - el.gcNodeKeys() + if idx < len(el.nodeKeyOffset) { + offset := el.nodeKeyOffset[idx] + if el.nodeKeyData[offset].key == key && !el.nodeKeyData[offset].removed { + el.nodeKeyData[offset].removed = true + el.removedNodes++ + if el.removedNodes > len(el.nodeKeyData)/2 { + el.gcNodeKeys() + } } } } // O(log(n)) func (el *edgeLookup) nodeKeyIdx(key string) int { - return sort.Search(len(el.nodeKeys), + return sort.Search(len(el.nodeKeyOffset), func(i int) bool { - return key <= el.nodeKeys[i].key + return key <= el.nodeKeyData[el.nodeKeyOffset[i]].key }) } // O(log(m)) func (el *edgeLookup) addEdge(e edge) { + if el.methodTracker != nil { + defer el.methodTracker("edgeLookup.addEdge")() + } + + // find the corresponding index in edgeOffset e.targetKey = trimTrailingDirSep(e.targetKey) dirDepth := getDirDepth(e.targetKey) idx := el.edgeIdx(e, dirDepth) - if idx < len(el.edges) { - equal, _ := e.compare(el.edges[idx]) + if idx < len(el.edgeOffset) { + offset := el.edgeOffset[idx] + equal, _ := e.compare(el.edgeData[offset]) if equal { - if el.edges[idx].removed { - el.edges[idx].removed = false + if el.edgeData[offset].removed { + el.edgeData[offset].removed = false el.removedEdges-- } return } } - el.edges = append(el.edges, edge{}) - if idx < len(el.edges)-1 { - copy(el.edges[idx+1:], el.edges[idx:]) + + // add to both edgeOffset and edgeData + el.edgeData = append(el.edgeData, e) + offset := len(el.edgeData) - 1 + el.edgeData[offset].removed = false + el.edgeOffset = append(el.edgeOffset, -1) + if idx < len(el.edgeOffset)-1 { + copy(el.edgeOffset[idx+1:], el.edgeOffset[idx:]) } - el.edges[idx] = e - el.edges[idx].removed = false + el.edgeOffset[idx] = offset + + // update directory boundaries for i := dirDepth + 1; i < len(el.dirDepthBounds); i++ { el.dirDepthBounds[i]++ } for i := len(el.dirDepthBounds); i <= dirDepth; i++ { - el.dirDepthBounds = append(el.dirDepthBounds, len(el.edges)-1) + el.dirDepthBounds = append(el.dirDepthBounds, len(el.edgeOffset)-1) } } // O(log(m)) amortized func (el *edgeLookup) delEdge(e edge) { + if el.methodTracker != nil { + defer el.methodTracker("edgeLookup.delEdge")() + } + e.targetKey = trimTrailingDirSep(e.targetKey) dirDepth := getDirDepth(e.targetKey) idx := el.edgeIdx(e, dirDepth) - if idx <= len(el.edges) { - equal, _ := e.compare(el.edges[idx]) - if equal && !el.edges[idx].removed { - el.edges[idx].removed = true + if idx < len(el.edgeOffset) { + offset := el.edgeOffset[idx] + equal, _ := e.compare(el.edgeData[offset]) + if equal && !el.edgeData[offset].removed { + el.edgeData[offset].removed = true el.removedEdges++ - if el.removedEdges > len(el.edges)/2 { + if el.removedEdges > len(el.edgeData)/2 { el.gcEdges() } } @@ -227,7 +284,8 @@ func (el *edgeLookup) edgeIdx(e edge, dirDepth int) int { } return begin + sort.Search(end-begin, func(i int) bool { - _, order := e.compare(el.edges[begin+i]) + e2 := el.edgeData[el.edgeOffset[begin+i]] + _, order := e.compare(e2) return order <= 0 }) } @@ -236,12 +294,12 @@ func (el *edgeLookup) getDirDepthBounds(dirDepth int) (begin, end int) { if dirDepth < len(el.dirDepthBounds) { begin = el.dirDepthBounds[dirDepth] } else { - begin = len(el.edges) + begin = len(el.edgeOffset) } if dirDepth < len(el.dirDepthBounds)-1 { end = el.dirDepthBounds[dirDepth+1] } else { - end = len(el.edges) + end = len(el.edgeOffset) } return } @@ -249,23 +307,27 @@ func (el *edgeLookup) getDirDepthBounds(dirDepth int) (begin, end int) { // for prefix: O(log(n)) (assuming O(1) matched keys) // for full key: O(1) average, O(n) worst-case func (el *edgeLookup) iterTargets(key string, isPrefix bool, cb func(targetNode string)) { + if el.methodTracker != nil { + defer el.methodTracker("edgeLookup.iterTargets")() + } + if key == "" && isPrefix { // iterate all - for i := range el.nodeKeys { - if el.nodeKeys[i].removed { + for i := range el.nodeKeyData { + if el.nodeKeyData[i].removed { continue } - cb(el.nodeKeys[i].key) + cb(el.nodeKeyData[i].key) } return } if !isPrefix { - added, known := el.nodeKeysMap[key] + added, known := el.nodeKeyMap[key] if (known && !added) || (!known && el.underlay == nil) { return } if !known && el.underlay != nil { - _, added = el.underlay.nodeKeysMap[key] + _, added = el.underlay.nodeKeyMap[key] if !added { return } @@ -275,19 +337,23 @@ func (el *edgeLookup) iterTargets(key string, isPrefix bool, cb func(targetNode } // prefix: idx := el.nodeKeyIdx(key) - for i := idx; i < len(el.nodeKeys); i++ { - if el.nodeKeys[i].removed { + for i := idx; i < len(el.nodeKeyOffset); i++ { + offset := el.nodeKeyOffset[i] + if el.nodeKeyData[offset].removed { continue } - if !strings.HasPrefix(el.nodeKeys[i].key, key) { + if !strings.HasPrefix(el.nodeKeyData[offset].key, key) { break } - cb(el.nodeKeys[i].key) + cb(el.nodeKeyData[offset].key) } } // O(log(m)) (assuming O(1) matched sources) func (el *edgeLookup) iterSources(targetKey string, cb func(sourceNode, relation, label string)) { + if el.methodTracker != nil { + defer el.methodTracker("edgeLookup.iterSources")() + } targetKey = trimTrailingDirSep(targetKey) var dirDepth int @@ -297,16 +363,17 @@ func (el *edgeLookup) iterSources(targetKey string, cb func(sourceNode, relation idx := el.edgeIdx(edge{targetKey: targetKey[:i]}, dirDepth) _, end := el.getDirDepthBounds(dirDepth) for j := idx; j < end; j++ { - if el.edges[j].targetKey != targetKey[:i] { + offset := el.edgeOffset[j] + if el.edgeData[offset].targetKey != targetKey[:i] { break } - if prefix && !el.edges[j].isPrefix { + if prefix && !el.edgeData[offset].isPrefix { continue } - if el.edges[j].removed { + if el.edgeData[offset].removed { continue } - cb(el.edges[j].sourceNode, el.edges[j].relation, el.edges[j].label) + cb(el.edgeData[offset].sourceNode, el.edgeData[offset].relation, el.edgeData[offset].label) } dirDepth++ } @@ -315,63 +382,126 @@ func (el *edgeLookup) iterSources(targetKey string, cb func(sourceNode, relation // O(n) func (el *edgeLookup) gcNodeKeys() { + // for each offset determine how much it will decrease + var decOffset int + for i := 0; i < len(el.nodeKeyData); i++ { + if el.nodeKeyData[i].removed { + decOffset++ + } else { + el.nodeKeyData[i].decOffset = decOffset + } + } + + // GC node-key offsets var next int - for i := range el.nodeKeys { - if !el.nodeKeys[i].removed { + for i := range el.nodeKeyOffset { + offset := el.nodeKeyOffset[i] + if !el.nodeKeyData[offset].removed { + if next < i { + el.nodeKeyOffset[next] = el.nodeKeyOffset[i] + } + el.nodeKeyOffset[next] -= el.nodeKeyData[offset].decOffset + next++ + } + } + el.nodeKeyOffset = el.nodeKeyOffset[:next] + + // GC node-key data + next = 0 + for i := 0; i < len(el.nodeKeyData); i++ { + if !el.nodeKeyData[i].removed { if next < i { - el.nodeKeys[next] = el.nodeKeys[i] + el.nodeKeyData[next] = el.nodeKeyData[i] } next++ } } - el.nodeKeys = el.nodeKeys[:next] + el.nodeKeyData = el.nodeKeyData[:next] + el.removedNodes = 0 + if len(el.nodeKeyOffset) != len(el.nodeKeyData) { + panic("len(el.nodeKeyOffset) != len(el.nodeKeyData)") + } } // O(m) func (el *edgeLookup) gcEdges() { + // for each offset determine how much it will decrease + var decOffset int + for i := 0; i < len(el.edgeData); i++ { + if el.edgeData[i].removed { + decOffset++ + } else { + el.edgeData[i].decOffset = decOffset + } + } + + // GC edge offsets var next int for dIdx, curBound := range el.dirDepthBounds { newBound := next - nextBound := len(el.edges) + nextBound := len(el.edgeOffset) if dIdx < len(el.dirDepthBounds)-1 { nextBound = el.dirDepthBounds[dIdx+1] } for i := curBound; i < nextBound; i++ { - if !el.edges[i].removed { + offset := el.edgeOffset[i] + if !el.edgeData[offset].removed { if next < i { - el.edges[next] = el.edges[i] + el.edgeOffset[next] = el.edgeOffset[i] } + // update offset to reflect the post-GC situation + el.edgeOffset[next] -= el.edgeData[offset].decOffset next++ } } el.dirDepthBounds[dIdx] = newBound } + el.edgeOffset = el.edgeOffset[:next] - el.edges = el.edges[:next] - el.removedEdges = 0 + // GC edge data + next = 0 + for i := 0; i < len(el.edgeData); i++ { + if !el.edgeData[i].removed { + if next < i { + el.edgeData[next] = el.edgeData[i] + } + next++ + } + } + el.edgeData = el.edgeData[:next] + // GC directory boundaries dIdx := len(el.dirDepthBounds) - 1 for ; dIdx >= 0; dIdx-- { - if el.dirDepthBounds[dIdx] < len(el.edges) { + if el.dirDepthBounds[dIdx] < len(el.edgeOffset) { break } } el.dirDepthBounds = el.dirDepthBounds[:dIdx+1] + + el.removedEdges = 0 + if len(el.edgeOffset) != len(el.edgeData) { + panic("len(el.edgeOffset) != len(el.edgeData)") + } } func (el *edgeLookup) resizeNodeKeys(size int) { - if cap(el.nodeKeys) < size { - el.nodeKeys = make([]nodeKey, size) + if cap(el.nodeKeyData) < size { + el.nodeKeyData = make([]nodeKey, size) + el.nodeKeyOffset = make([]int, size) } - el.nodeKeys = el.nodeKeys[0:size] + el.nodeKeyData = el.nodeKeyData[0:size] + el.nodeKeyOffset = el.nodeKeyOffset[0:size] } func (el *edgeLookup) resizeEdges(size int) { - if cap(el.edges) < size { - el.edges = make([]edge, size) + if cap(el.edgeData) < size { + el.edgeData = make([]edge, size) + el.edgeOffset = make([]int, size) } - el.edges = el.edges[0:size] + el.edgeData = el.edgeData[0:size] + el.edgeOffset = el.edgeOffset[0:size] } func (el *edgeLookup) resizeDirDepthBounds(size int) { @@ -383,10 +513,54 @@ func (el *edgeLookup) resizeDirDepthBounds(size int) { // for UTs func (el *edgeLookup) verifyDirDepthBounds() error { + if len(el.edgeData) != len(el.edgeOffset) { + return fmt.Errorf("len(edgeData) != len(edgeOffset) (%d != %d)", + len(el.edgeData), len(el.edgeOffset)) + } + if cap(el.edgeData) != cap(el.edgeOffset) { + return fmt.Errorf("cap(edgeData) != cap(edgeOffset) (%d != %d)", + cap(el.edgeData), cap(el.edgeOffset)) + } + for i := 0; i < len(el.edgeOffset); i++ { + found := false + for j := 0; j < len(el.edgeOffset); j++ { + if el.edgeOffset[j] == i { + found = true + break + } + } + if !found { + return fmt.Errorf("missing entry for edge offset %d (offsets=%+v)", + i, el.edgeOffset) + } + } + + if len(el.nodeKeyData) != len(el.nodeKeyOffset) { + return fmt.Errorf("len(nodeKeyData) != len(nodeKeyOffset) (%d != %d)", + len(el.nodeKeyData), len(el.nodeKeyOffset)) + } + if cap(el.nodeKeyData) != cap(el.nodeKeyOffset) { + return fmt.Errorf("cap(nodeKeyData) != cap(nodeKeyOffset) (%d != %d)", + cap(el.nodeKeyData), cap(el.nodeKeyOffset)) + } + for i := 0; i < len(el.nodeKeyOffset); i++ { + found := false + for j := 0; j < len(el.nodeKeyOffset); j++ { + if el.nodeKeyOffset[j] == i { + found = true + break + } + } + if !found { + return fmt.Errorf("missing entry for node-key offset %d (offsets=%+v)", + i, el.nodeKeyOffset) + } + } + expBounds := []int{} dirDepth := -1 - for i := range el.edges { - tk := el.edges[i].targetKey + for i := range el.edgeOffset { + tk := el.edgeData[el.edgeOffset[i]].targetKey if len(tk) > 0 && tk[len(tk)-1] == dirSeparator[0] { return fmt.Errorf("edge with targetKey ending with dir separator: %s", tk) } @@ -406,8 +580,9 @@ func (el *edgeLookup) verifyDirDepthBounds() error { } // bad performance of this is OK, the method is used only in unit tests if !reflect.DeepEqual(el.dirDepthBounds, expBounds) { - return fmt.Errorf("unexpected dir-depth bounds: expected=%v, actual=%v (edges=%+v)", - expBounds, el.dirDepthBounds, el.edges) + return fmt.Errorf("unexpected dir-depth bounds: expected=%v, actual=%v "+ + "(offsets=%+v, data=%+v)", + expBounds, el.dirDepthBounds, el.edgeOffset, el.edgeData) } return nil } @@ -470,4 +645,4 @@ func getDirDepth(s string) int { } depth += strings.Count(s, dirSeparator) return depth -} \ No newline at end of file +} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/internal/graph/graph_impl.go b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/internal/graph/graph_impl.go index 5bee405c63..f715b15c7e 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/internal/graph/graph_impl.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/internal/graph/graph_impl.go @@ -68,7 +68,7 @@ func NewGraph(opts Opts) Graph { permanentInitPeriod: time.Duration(opts.PermanentInitPeriod) * time.Minute, methodTracker: opts.MethodTracker, } - kvgraph.graph = newGraphR() + kvgraph.graph = newGraphR(opts.MethodTracker) kvgraph.graph.parent = kvgraph return kvgraph } diff --git a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/internal/graph/graph_read.go b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/internal/graph/graph_read.go index 009d7807aa..df07d7d55d 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/internal/graph/graph_read.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/internal/graph/graph_read.go @@ -47,14 +47,14 @@ type graphR struct { } // newGraphR creates and initializes a new instance of graphR. -func newGraphR() *graphR { +func newGraphR(mt MethodTracker) *graphR { var el *edgeLookup if benchEl != nil { // this is a benchmark el = benchEl el.reset() } else { - el = newEdgeLookup() + el = newEdgeLookup(mt) } return &graphR{ edgeLookup: el, diff --git a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/stats.go b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/stats.go index 6fe4f7f1eb..d7acd288d6 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/stats.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/stats.go @@ -21,6 +21,7 @@ import ( "time" "github.com/ligato/vpp-agent/pkg/metrics" + kvs "github.com/ligato/vpp-agent/plugins/kvscheduler/api" ) var ( @@ -32,30 +33,20 @@ func init() { stats.GraphMethods.Methods = make(metrics.Calls) stats.AllDescriptors.Methods = make(metrics.Calls) stats.Descriptors = make(map[string]*StructStats) -} - -/*func GetDescriptorStats() map[string]metrics.Calls { - ss := make(map[string]metrics.Calls, len(stats.Descriptors)) - statsMu.RLock() - for d, ds := range stats.Descriptors { - cc := make(metrics.Calls, len(ds)) - for c, cs := range ds { - css := *cs - cc[c] = &css + stats.TxnStats.Methods = make(metrics.Calls) + stats.TxnStats.OperationCount = make(map[string]uint64) + stats.TxnStats.ValueStateCount = make(map[string]uint64) + for state := range kvs.ValueState_value { + stats.TxnStats.ValueStateCount[state] = 0 + } + for op, opVal := range kvs.TxnOperation_name { + if op == int32(kvs.TxnOperation_UNDEFINED) || + op == int32(kvs.TxnOperation_VALIDATE) { + continue } - ss[d] = cc + stats.TxnStats.OperationCount[opVal] = 0 } - statsMu.RUnlock() - return ss -}*/ - -/*func GetGraphStats() *metrics.CallStats { - s := make(metrics.Calls, len(stats.Descriptors)) - statsMu.RLock() - *s = stats.Graph - statsMu.RUnlock() - return s -}*/ +} func GetStats() *Stats { s := new(Stats) @@ -66,8 +57,7 @@ func GetStats() *Stats { } type Stats struct { - TransactionsProcessed uint64 - + TxnStats TxnStats GraphMethods StructStats AllDescriptors StructStats Descriptors map[string]*StructStats @@ -79,16 +69,19 @@ func (s *Stats) addDescriptor(name string) { } } +type TxnStats struct { + TotalProcessed uint64 + OperationCount map[string]uint64 + ValueStateCount map[string]uint64 + ErrorCount uint64 + Methods metrics.Calls +} + type StructStats struct { Methods metrics.Calls `json:"-,omitempty"` } func (s *StructStats) MarshalJSON() ([]byte, error) { - /*d := make(map[string]*metrics.CallStats, len(s.Methods)) - for _, ms := range s.Methods { - m := fmt.Sprintf("%s()", ms.Name) - d[m] = ms - }*/ return json.Marshal(s.Methods) } @@ -129,6 +122,35 @@ func trackGraphMethod(m string) func() { } } +func trackTransactionMethod(m string) func() { + t := time.Now() + s := stats.TxnStats + return func() { + took := time.Since(t) + statsMu.Lock() + ms, tracked := s.Methods[m] + if !tracked { + ms = &metrics.CallStats{Name: m} + s.Methods[m] = ms + } + ms.Increment(took) + statsMu.Unlock() + } +} + +func updateTransactionStats(execOps kvs.RecordedTxnOps) { + statsMu.Lock() + defer statsMu.Unlock() + stats.TxnStats.TotalProcessed++ + for _, op := range execOps { + if op.NewErr != nil { + stats.TxnStats.ErrorCount++ + } + stats.TxnStats.OperationCount[op.Operation.String()]++ + stats.TxnStats.ValueStateCount[op.NewState.String()]++ + } +} + func init() { expvar.Publish("kvscheduler", expvar.Func(func() interface{} { return GetStats() diff --git a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/txn_exec.go b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/txn_exec.go index 4f0d8f0780..b7d666a466 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/txn_exec.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/txn_exec.go @@ -60,6 +60,11 @@ func (s *Scheduler) executeTransaction(txn *transaction, graphW graph.RWAccess, op = "simulate transaction" } defer trace.StartRegion(txn.ctx, op).End() + if dryRun { + defer trackTransactionMethod("simulateTransaction")() + } else { + defer trackTransactionMethod("executeTransaction")() + } if s.logGraphWalk { msg := fmt.Sprintf("%s (seqNum=%d)", op, txn.seqNum) diff --git a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/txn_process.go b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/txn_process.go index 3cee315d4e..747f78cab5 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/txn_process.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/txn_process.go @@ -17,7 +17,6 @@ package kvscheduler import ( "context" "runtime/trace" - "sync/atomic" "time" "github.com/gogo/protobuf/proto" @@ -93,25 +92,28 @@ func (s *Scheduler) consumeTransactions() { return } s.processTransaction(txn) - atomic.AddUint64(&stats.TransactionsProcessed, 1) } } // processTransaction processes transaction in 6 steps: // 1. Pre-processing: transaction parameters are initialized, retry operations // are filtered from the obsolete ones and for the resync the graph is refreshed -// 2. Simulation: simulating transaction without actually executing any of the +// 2. Ordering: pre-order operations using a heuristic to get the shortest graph +// walk in average +// 3. Simulation: simulating transaction without actually executing any of the // Create/Delete/Update operations in order to obtain the "execution plan" -// 3. Pre-recording: logging transaction arguments + plan before execution to +// 4. Pre-recording: logging transaction arguments + plan before execution to // persist some information in case there is a crash during execution -// 4. Execution: executing the transaction, collecting errors -// 5. Recording: recording the finalized transaction (log + in-memory) -// 6. Post-processing: scheduling retry for failed operations, propagating value +// 5. Execution: executing the transaction, collecting errors +// 6. Recording: recording the finalized transaction (log + in-memory) +// 7. Post-processing: scheduling retry for failed operations, propagating value // state updates to the subscribers and returning error/nil to the caller // of blocking commit +// 8. Update of transaction statistics func (s *Scheduler) processTransaction(txn *transaction) { s.txnLock.Lock() defer s.txnLock.Unlock() + defer trackTransactionMethod("processTransaction")() startTime := time.Now() @@ -154,12 +156,16 @@ func (s *Scheduler) processTransaction(txn *transaction) { // 7. Post-processing: s.postProcessTransaction(txn, executedOps) + + // 8. Statistics: + updateTransactionStats(executedOps) } // preProcessTransaction initializes transaction parameters, filters obsolete retry // operations and refreshes the graph for resync. func (s *Scheduler) preProcessTransaction(txn *transaction) (skipExec, skipSimulation, record bool) { defer trace.StartRegion(txn.ctx, "preProcessTransaction").End() + defer trackTransactionMethod("preProcessTransaction")() // allocate new transaction sequence number txn.seqNum = s.txnSeqNumber @@ -299,6 +305,7 @@ func (s *Scheduler) preProcessRetryTxn(txn *transaction) (skip bool) { // commit. func (s *Scheduler) postProcessTransaction(txn *transaction, executed kvs.RecordedTxnOps) { defer trace.StartRegion(txn.ctx, "postProcessTransaction").End() + defer trackTransactionMethod("postProcessTransaction")() // collect new failures (combining derived with base) toRetry := utils.NewSliceBasedKeySet() diff --git a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/txn_record.go b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/txn_record.go index 128fa3d485..e7e2e81745 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/txn_record.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/kvscheduler/txn_record.go @@ -101,6 +101,7 @@ func (s *Scheduler) preRecordTxnOp(args *applyValueArgs, node graph.Node) *kvs.R func (s *Scheduler) preRecordTransaction(txn *transaction, planned kvs.RecordedTxnOps, skippedSimulation bool) *kvs.RecordedTxn { defer trace.StartRegion(txn.ctx, "preRecordTransaction").End() + defer trackTransactionMethod("preRecordTransaction")() // allocate new transaction record record := &kvs.RecordedTxn{ @@ -163,6 +164,7 @@ func (s *Scheduler) preRecordTransaction(txn *transaction, planned kvs.RecordedT // recordTransaction records the finalized transaction (log + in-memory). func (s *Scheduler) recordTransaction(txn *transaction, txnRecord *kvs.RecordedTxn, executed kvs.RecordedTxnOps, start, stop time.Time) { defer trace.StartRegion(txn.ctx, "recordTransaction").End() + defer trackTransactionMethod("recordTransaction")() txnRecord.PreRecord = false txnRecord.Start = start diff --git a/vendor/github.com/ligato/vpp-agent/plugins/linux/ifplugin/descriptor/interface.go b/vendor/github.com/ligato/vpp-agent/plugins/linux/ifplugin/descriptor/interface.go index 366cee4fcd..14e060605d 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/linux/ifplugin/descriptor/interface.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/linux/ifplugin/descriptor/interface.go @@ -15,7 +15,10 @@ package descriptor import ( + "fmt" + "io/ioutil" "net" + "path/filepath" "reflect" "strconv" "strings" @@ -352,7 +355,38 @@ func (d *InterfaceDescriptor) Create(key string, linuxIf *interfaces.Interface) d.log.Error(err) return nil, err } + + const ( + DisableIPv6SysctlTemplate = "net.ipv6.conf.%s.disable_ipv6" + ) + var hasEnabledIPv6 bool for _, ipAddress := range ipAddresses { + // Make sure sysctl "disable_ipv6" is 0 if we are about to add + // an IPv6 address to the interface + if !hasEnabledIPv6 && ipAddress.IP.To16() != nil { + // Enabled IPv6 for loopback "lo" and the interface + // being configured + for _, iface := range [2]string{"lo", hostName} { + ipv6SysctlValueName := fmt.Sprintf(DisableIPv6SysctlTemplate, iface) + + // Read current sysctl value + value, err := getSysctl(ipv6SysctlValueName) + if err != nil || value == "0" { + if err != nil { + d.log.Warnf("could not read sysctl value for %v: %v", hostName, err) + } + continue + } + + // Write sysctl to enable IPv6 + _, err = setSysctl(ipv6SysctlValueName, "0") + if err != nil { + return nil, fmt.Errorf("failed to enable IPv6 for interface %q (%s=%s): %v", iface, ipv6SysctlValueName, value, err) + } + } + hasEnabledIPv6 = true + } + err = d.ifHandler.AddInterfaceIP(hostName, ipAddress) // an attempt to add already assign IP is not considered as error if err != nil && syscall.EEXIST != err { @@ -1060,3 +1094,24 @@ func isChksmOffloadingOn(offloading interfaces.VethLink_ChecksumOffloading) bool } return true } + +func getSysctl(name string) (string, error) { + fullName := filepath.Join("/proc/sys", strings.Replace(name, ".", "/", -1)) + fullName = filepath.Clean(fullName) + data, err := ioutil.ReadFile(fullName) + if err != nil { + return "", err + } + + return string(data[:len(data)-1]), nil +} + +func setSysctl(name, value string) (string, error) { + fullName := filepath.Join("/proc/sys", strings.Replace(name, ".", "/", -1)) + fullName = filepath.Clean(fullName) + if err := ioutil.WriteFile(fullName, []byte(value), 0644); err != nil { + return "", err + } + + return getSysctl(name) +} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/linux/nsplugin/README.md b/vendor/github.com/ligato/vpp-agent/plugins/linux/nsplugin/README.md deleted file mode 100644 index 0dc98f94e5..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/linux/nsplugin/README.md +++ /dev/null @@ -1,41 +0,0 @@ -## Linux namespace plugin - -Auxiliary plugin used mainly by other plugins to handle namespaces and -microservices. - -### Namespaces - -Agent has full support for Linux network namespaces. It is possible to attach -Linux interface/ARP/route into a new, existing or even yet-to-be-created network -namespace via the `Namespace` configuration section inside data model. - -Namespace can be referenced in multiple ways. The most low-level link -to a namespace is a file descriptor associated with the symbolic link -automatically created in the `proc` filesystem, pointing to the definition -of the namespace used by a given process (`/proc//ns/net`) or by a task -of a given process (`/proc//task//ns/net`). -A more common approach to reference namespace is to use just the PID -of the process whose namespace we want to attach to, or to create a bind-mount -of the symbolic link into `/var/run/netns` directory and use the filename of that -mount. The latter is called `named` namespace and it is created and managed for -example by the `ip netns` command line tool from the `iproute2` package. -The advantage of `named` namespace is that it can outlive the process it was -originally created by. - -`namespace` configuration section should be seen as a union of values. First, -set the type and then store the reference into the appropriate field (`pid` vs. -`name` vs `microservice`). Agent supports both PID-based references as well as -`named` namespaces. - -### Microservices - -Additionally, we provide a non-standard namespace reference, denoted -as `MICROSERVICE_REF_NS`, which is specific to ecosystems with microservices. -It is possible to attach interface/ARP/route into the namespace of a container -that runs microservice with a given label. To make it even simpler, it is not -required to start the microservice before the configured item is pushed. -The agent will postpone interface (re)configuration until the referenced -microservice gets launched. Behind the scenes, the agent communicates with -the docker daemon to construct and maintain an up-to-date map of microservice -labels to PIDs and IDs of their corresponding containers. Whenever a new -microservice is detected, all pending interfaces are moved to its namespace. diff --git a/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/dispatcher.go b/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/dispatcher.go new file mode 100644 index 0000000000..1cf1683cbc --- /dev/null +++ b/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/dispatcher.go @@ -0,0 +1,144 @@ +// Copyright (c) 2019 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package orchestrator + +import ( + "fmt" + "runtime/trace" + "sync" + "time" + + "github.com/ligato/cn-infra/logging" + "golang.org/x/net/context" + + "github.com/gogo/protobuf/proto" + kvs "github.com/ligato/vpp-agent/plugins/kvscheduler/api" +) + +// KeyVal associates value with its key. +type KeyVal struct { + Key string + Val proto.Message +} + +// KVPairs represents key-value pairs. +type KVPairs map[string]proto.Message + +type Dispatcher interface { + ListData() KVPairs + PushData(context.Context, []KeyVal) ([]kvs.KeyWithError, error) +} + +type dispatcher struct { + log logging.Logger + kvs kvs.KVScheduler + mu sync.Mutex + store *memStore +} + +// ListData retrieves actual data. +func (p *dispatcher) ListData() KVPairs { + p.mu.Lock() + defer p.mu.Unlock() + + return p.store.ListAll() +} + +// PushData updates actual data. +func (p *dispatcher) PushData(ctx context.Context, kvPairs []KeyVal) (kvErrs []kvs.KeyWithError, err error) { + p.mu.Lock() + defer p.mu.Unlock() + + trace.Logf(ctx, "kvPairs", "%d", len(kvPairs)) + + pr := trace.StartRegion(ctx, "prepare kv data") + + dataSrc, ok := DataSrcFromContext(ctx) + if !ok { + dataSrc = "global" + } + + p.log.Debugf("Pushing data with %d KV pairs (source: %s)", len(kvPairs), dataSrc) + + txn := p.kvs.StartNBTransaction() + + if typ, _ := kvs.IsResync(ctx); typ == kvs.FullResync { + trace.Log(ctx, "resyncType", typ.String()) + p.store.Reset(dataSrc) + for _, kv := range kvPairs { + if kv.Val == nil { + p.log.Debugf(" - PUT: %q (skipped nil value)", kv.Key) + continue + } + p.log.Debugf(" - PUT: %q ", kv.Key) + p.store.Update(dataSrc, kv.Key, kv.Val) + } + allPairs := p.store.ListAll() + p.log.Debugf("will resync %d pairs", len(allPairs)) + for k, v := range allPairs { + txn.SetValue(k, v) + } + } else { + for _, kv := range kvPairs { + if kv.Val == nil { + p.log.Debugf(" - DELETE: %q", kv.Key) + txn.SetValue(kv.Key, nil) + p.store.Delete(dataSrc, kv.Key) + } else { + p.log.Debugf(" - UPDATE: %q ", kv.Key) + txn.SetValue(kv.Key, kv.Val) + p.store.Update(dataSrc, kv.Key, kv.Val) + } + } + } + + pr.End() + + t := time.Now() + + seqID, err := txn.Commit(ctx) + if err != nil { + if txErr, ok := err.(*kvs.TransactionError); ok && len(txErr.GetKVErrors()) > 0 { + kvErrs = txErr.GetKVErrors() + var errInfo = "" + for i, kvErr := range kvErrs { + errInfo += fmt.Sprintf(" - %3d. error (%s) %s - %v\n", i+1, kvErr.TxnOperation, kvErr.Key, kvErr.Error) + } + p.log.Errorf("Transaction #%d finished with %d errors", seqID, len(kvErrs)) + fmt.Println(errInfo) + } else { + p.log.Errorf("Transaction failed: %v", err) + } + return kvErrs, err + } + + took := time.Since(t).Round(time.Microsecond * 100) + p.log.Infof("Transaction #%d successful! (took %v)", seqID, took) + + return nil, nil +} + +type dataSrcKeyT string + +var dataSrcKey = dataSrcKeyT("dataSrc") + +func DataSrcContext(ctx context.Context, dataSrc string) context.Context { + return context.WithValue(ctx, dataSrcKey, dataSrc) +} + +func DataSrcFromContext(ctx context.Context) (dataSrc string, ok bool) { + dataSrc, ok = ctx.Value(dataSrcKey).(string) + return +} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/genericmanager.go b/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/genericmanager.go new file mode 100644 index 0000000000..74aeb8329c --- /dev/null +++ b/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/genericmanager.go @@ -0,0 +1,152 @@ +// Copyright (c) 2019 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package orchestrator + +import ( + "github.com/gogo/protobuf/proto" + "github.com/gogo/status" + "github.com/ligato/cn-infra/logging" + "golang.org/x/net/context" + "google.golang.org/grpc/codes" + + api "github.com/ligato/vpp-agent/api/genericmanager" + "github.com/ligato/vpp-agent/pkg/models" + kvs "github.com/ligato/vpp-agent/plugins/kvscheduler/api" +) + +type genericManagerSvc struct { + log logging.Logger + dispatch Dispatcher +} + +func (s *genericManagerSvc) Capabilities(ctx context.Context, req *api.CapabilitiesRequest) (*api.CapabilitiesResponse, error) { + resp := &api.CapabilitiesResponse{ + KnownModels: models.RegisteredModels(), + } + return resp, nil +} + +func (s *genericManagerSvc) SetConfig(ctx context.Context, req *api.SetConfigRequest) (*api.SetConfigResponse, error) { + s.log.Debug("------------------------------") + s.log.Debugf("=> Configurator.SetConfig: %d items", len(req.Updates)) + s.log.Debug("------------------------------") + for _, item := range req.Updates { + s.log.Debugf(" - %v", item) + } + s.log.Debug("------------------------------") + + if req.OverwriteAll { + ctx = kvs.WithResync(ctx, kvs.FullResync, true) + } + + var ops = make(map[string]api.UpdateResult_Operation) + var kvPairs []KeyVal + + for _, update := range req.Updates { + item := update.Item + /*if item == nil { + return nil, status.Error(codes.InvalidArgument, "change item is nil") + }*/ + var ( + key string + val proto.Message + ) + + var err error + if item.Data != nil { + val, err = models.UnmarshalItem(item) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + key, err = models.GetKey(val) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + ops[key] = api.UpdateResult_UPDATE + } else if item.Id != nil { + model, err := models.ModelForItem(item) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + key := model.KeyPrefix() + item.Id.Name + ops[key] = api.UpdateResult_DELETE + } else { + return nil, status.Error(codes.InvalidArgument, "ProtoItem has no key or val defined.") + } + kvPairs = append(kvPairs, KeyVal{ + Key: key, + Val: val, + }) + } + + ctx = DataSrcContext(ctx, "grpc") + kvErrs, err := s.dispatch.PushData(ctx, kvPairs) + if err != nil { + st := status.New(codes.FailedPrecondition, err.Error()) + return nil, st.Err() + } + + results := []*api.UpdateResult{} + for _, kvErr := range kvErrs { + results = append(results, &api.UpdateResult{ + Key: kvErr.Key, + Status: &api.ItemStatus{ + //State: api.ItemStatus_FAILURE, + Message: kvErr.Error.Error(), + }, + Op: ops[kvErr.Key], + }) + } + + /* + // commit the transaction + if err := txn.Commit(); err != nil { + st := status.New(codes.FailedPrecondition, err.Error()) + return nil, st.Err() + // TODO: use the WithDetails to return extra info to clients. + //ds, err := st.WithDetails(&rpc.DebugInfo{Detail: "Local transaction failed!"}) + //if err != nil { + // return nil, st.Err() + //} + //return nil, ds.Err() + } + */ + + return &api.SetConfigResponse{Results: results}, nil +} + +func (s *genericManagerSvc) GetConfig(context.Context, *api.GetConfigRequest) (*api.GetConfigResponse, error) { + var items []*api.GetConfigResponse_ConfigItem + + for _, data := range s.dispatch.ListData() { + item, err := models.MarshalItem(data) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + items = append(items, &api.GetConfigResponse_ConfigItem{ + Item: item, + }) + } + + return &api.GetConfigResponse{Items: items}, nil +} + +func (s *genericManagerSvc) DumpState(context.Context, *api.DumpStateRequest) (*api.DumpStateResponse, error) { + return nil, status.Error(codes.Unimplemented, "Not implemented yet") +} + +func (s *genericManagerSvc) Subscribe(req *api.SubscribeRequest, server api.GenericManager_SubscribeServer) error { + return status.Error(codes.Unimplemented, "Not implemented yet") +} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/options.go b/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/options.go new file mode 100644 index 0000000000..ddf8a44c8b --- /dev/null +++ b/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/options.go @@ -0,0 +1,44 @@ +// Copyright (c) 2019 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package orchestrator + +import ( + "github.com/ligato/cn-infra/datasync/kvdbsync/local" + "github.com/ligato/cn-infra/rpc/grpc" + "github.com/ligato/vpp-agent/plugins/kvscheduler" +) + +// DefaultPlugin is default instance of Plugin +var DefaultPlugin = *NewPlugin() + +// NewPlugin creates a new Plugin with the provides Options +func NewPlugin(opts ...Option) *Plugin { + p := &Plugin{} + + p.PluginName = "orchestrator" + p.GRPC = &grpc.DefaultPlugin + p.KVScheduler = &kvscheduler.DefaultPlugin + p.Watcher = local.DefaultRegistry + + for _, o := range opts { + o(p) + } + p.PluginDeps.Setup() + + return p +} + +// Option is a function that acts on a Plugin to inject Dependencies or configuration +type Option func(*Plugin) diff --git a/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/orchestrator.go b/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/orchestrator.go new file mode 100644 index 0000000000..937c1cde92 --- /dev/null +++ b/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/orchestrator.go @@ -0,0 +1,212 @@ +// Copyright (c) 2019 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package orchestrator + +import ( + "github.com/ligato/cn-infra/datasync" + "github.com/ligato/cn-infra/infra" + "github.com/ligato/cn-infra/rpc/grpc" + "golang.org/x/net/context" + + api "github.com/ligato/vpp-agent/api/genericmanager" + "github.com/ligato/vpp-agent/pkg/models" + kvs "github.com/ligato/vpp-agent/plugins/kvscheduler/api" +) + +// Plugin implements sync service for GRPC. +type Plugin struct { + Deps + + manager *genericManagerSvc + + // datasync channels + changeChan chan datasync.ChangeEvent + resyncChan chan datasync.ResyncEvent + watchDataReg datasync.WatchRegistration + + *dispatcher +} + +// Deps represents dependencies for the plugin. +type Deps struct { + infra.PluginDeps + + GRPC grpc.Server + KVScheduler kvs.KVScheduler + Watcher datasync.KeyValProtoWatcher +} + +// Init registers the service to GRPC server. +func (p *Plugin) Init() (err error) { + p.dispatcher = &dispatcher{ + log: p.Log.NewLogger("dispatcher"), + store: newMemStore(), + kvs: p.KVScheduler, + } + + // register grpc service + p.manager = &genericManagerSvc{ + log: p.log, + dispatch: p.dispatcher, + } + + if grpcServer := p.GRPC.GetServer(); grpcServer != nil { + api.RegisterGenericManagerServer(grpcServer, p.manager) + } else { + p.log.Infof("grpc server not available") + } + + nbPrefixes := p.kvs.GetRegisteredNBKeyPrefixes() + if len(nbPrefixes) > 0 { + p.log.Infof("Watch starting for %d registered NB prefixes", len(nbPrefixes)) + } else { + p.log.Warnf("No registered NB prefixes found in KVScheduler (ensure that all KVDescriptors are registered before this)") + } + + var prefixes []string + for _, prefix := range nbPrefixes { + //prefix = path.Join("config", prefix) + p.log.Debugf("- watching NB prefix: %s", prefix) + prefixes = append(prefixes, prefix) + } + + // initialize datasync channels + p.resyncChan = make(chan datasync.ResyncEvent) + p.changeChan = make(chan datasync.ChangeEvent) + + p.watchDataReg, err = p.Watcher.Watch(p.PluginName.String(), + p.changeChan, p.resyncChan, prefixes...) + if err != nil { + return err + } + + return nil +} + +// AfterInit subscribes to known NB prefixes. +func (p *Plugin) AfterInit() (err error) { + go p.watchEvents() + + return nil +} + +// InitialSync will start initial synchronization with downstream. +func (p *Plugin) InitialSync() { + // FIXME: KVScheduler needs to have some type of sync that only refreshes state from SB + p.Log.Debugf("starting initial sync") + txn := p.KVScheduler.StartNBTransaction() + ctx := kvs.WithResync(context.Background(), kvs.DownstreamResync, true) + if _, err := txn.Commit(ctx); err != nil { + p.Log.Warnf("initial sync failed: %v", err) + } else { + p.Log.Infof("initial sync complete") + } +} + +func (p *Plugin) watchEvents() { + for { + select { + case e := <-p.changeChan: + p.log.Debugf("=> received CHANGE event (%v changes)", len(e.GetChanges())) + + var err error + var kvPairs []KeyVal + + for _, x := range e.GetChanges() { + kv := KeyVal{Key: x.GetKey()} + if x.GetChangeType() != datasync.Delete { + kv.Val, err = models.UnmarshalLazyValue(kv.Key, x) + if err != nil { + p.log.Errorf("unmarshal value for key %s failed: %v", kv.Key, err) + continue + } + if k := models.Key(kv.Val); k != kv.Key { + p.log.Errorf("value for key %s does not match generated model key: %v", kv.Key, k) + continue + } + } + kvPairs = append(kvPairs, kv) + } + + if len(kvPairs) == 0 { + p.log.Warn("no valid kv pairs received in change event") + e.Done(nil) + continue + } + + p.log.Debugf("Change with %d items", len(kvPairs)) + + ctx := e.GetContext() + if ctx == nil { + ctx = context.Background() + } + ctx = DataSrcContext(ctx, "watcher") + ctx = kvs.WithRetryDefault(ctx) + + _, err = p.PushData(ctx, kvPairs) + + e.Done(err) + + case e := <-p.resyncChan: + p.log.Debugf("=> received RESYNC event (%v prefixes)", len(e.GetValues())) + + var kvPairs []KeyVal + + for prefix, iter := range e.GetValues() { + var keyVals []datasync.KeyVal + for x, done := iter.GetNext(); !done; x, done = iter.GetNext() { + key := x.GetKey() + val, err := models.UnmarshalLazyValue(key, x) + if err != nil { + p.log.Errorf("unmarshal value for key %s failed: %v", key, err) + continue + } + if k := models.Key(val); k != key { + p.log.Errorf("value for key %s does not match generated model key: %v", key, k) + continue + } + kvPairs = append(kvPairs, KeyVal{ + Key: key, + Val: val, + }) + p.log.Debugf(" -- key: %s", x.GetKey()) + keyVals = append(keyVals, x) + } + if len(keyVals) > 0 { + p.log.Debugf("- %q (%v items)", prefix, len(keyVals)) + } else { + p.log.Debugf("- %q (no items)", prefix) + } + for _, x := range keyVals { + p.log.Debugf("\t - %q: (rev: %v)", x.GetKey(), x.GetRevision()) + } + } + + p.log.Debugf("Resync with %d items", len(kvPairs)) + + ctx := e.GetContext() + if ctx == nil { + ctx = context.Background() + } + ctx = DataSrcContext(ctx, "watcher") + ctx = kvs.WithResync(ctx, kvs.FullResync, true) + ctx = kvs.WithRetryDefault(ctx) + + _, err := p.PushData(ctx, kvPairs) + + e.Done(err) + } + } +} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/store.go b/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/store.go new file mode 100644 index 0000000000..f7f4d402e9 --- /dev/null +++ b/vendor/github.com/ligato/vpp-agent/plugins/orchestrator/store.go @@ -0,0 +1,83 @@ +// Copyright (c) 2019 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package orchestrator + +import ( + "sort" + + "github.com/gogo/protobuf/proto" +) + +// KVDB describes interface for key-value store. +/*type KVDB interface { + Reset(dataSrc string) + ListAll() KVPairs + List(dataSrc string) KVPairs + Update(dataSrc, key string, val proto.Message) + Delete(dataSrc, key string) +}*/ + +type memStore struct { + db map[string]KVPairs +} + +func newMemStore() *memStore { + return &memStore{ + db: make(map[string]KVPairs), + } +} + +// Reset clears all key-value data. +func (s *memStore) Reset(dataSrc string) { + delete(s.db, dataSrc) +} + +// List lists actual key-value pairs. +func (s *memStore) ListAll() KVPairs { + var dataSrcs []string + for dataSrc := range s.db { + dataSrcs = append(dataSrcs, dataSrc) + } + sort.Strings(dataSrcs) + pairs := make(KVPairs) + for _, dataSrc := range dataSrcs { + for k, v := range s.List(dataSrc) { + pairs[k] = v + } + } + return pairs +} + +// List lists actual key-value pairs. +func (s *memStore) List(dataSrc string) KVPairs { + pairs := make(KVPairs, len(s.db[dataSrc])) + for k, v := range s.db[dataSrc] { + pairs[k] = v + } + return pairs +} + +// Delete deletes value stored under given key. +func (s *memStore) Delete(dataSrc, key string) { + delete(s.db[dataSrc], key) +} + +// Update updates value stored under key with given value. +func (s *memStore) Update(dataSrc, key string, val proto.Message) { + if _, ok := s.db[dataSrc]; !ok { + s.db[dataSrc] = make(KVPairs) + } + s.db[dataSrc][key] = val +} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/restapi/README.md b/vendor/github.com/ligato/vpp-agent/plugins/restapi/README.md deleted file mode 100644 index e3e63d250f..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/restapi/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# REST API Plugin - -The `restplugin` is a core Agent Plugin used to expose REST API for the following: -* Run VPP CLI commands -* Exposes existing Northbound objects -* Provides logging mechanism so that the VPPCLI command and response can be searched in elastic search - -## VPP CLI commands -``` -curl -H "Content-Type: application/json" -X POST -d '{"vppclicommand":"show interface"}' http://0.0.0.0:9191/vpp/command -``` - -## Exposing existing Northbound objects - -Here is the list of supported REST URLs. If configuration dump URL is used, the output is based on proto model -structure for given data type together with VPP-specific data which are not a part of the model (indexes for -interfaces or ACLs, internal names, etc.). Those data are in separate section labeled as `Meta`. - -**Access lists** - -URLs to obtain ACL IP/MACIP configuration are as follows. - -``` -curl GET http://0.0.0.0:9191/vpp/dump/v2/acl/ip -curl GET http://0.0.0.0:9191/vpp/dump/v2/acl/macip -``` - -**VPP Interfaces** - -REST plugin exposes configured VPP interfaces, which can be show all together, or only interfaces -of specific type. - -``` -curl GET http://0.0.0.0:9191/vpp/dump/v2/interfaces -curl GET http://0.0.0.0:9191/vpp/dump/v2/interfaces/loopback -curl GET http://0.0.0.0:9191/vpp/dump/v2/interfaces/ethernet -curl GET http://0.0.0.0:9191/vpp/dump/v2/interfaces/memif -curl GET http://0.0.0.0:9191/vpp/dump/v2/interfaces/tap -curl GET http://0.0.0.0:9191/vpp/dump/v2/interfaces/vxlan -curl GET http://0.0.0.0:9191/vpp/dump/v2/interfaces/afpacket -``` - -**Linux Interfaces** - -REST plugin exposes configured Linux interfaces. All configured interfaces are dumped, together -with all interfaces in default namespace - -``` -curl GET https://0.0.0.0:9191/linux/dump/v2/interfaces -``` - -**BFD** - -REST plugin allows to dump bidirectional forwarding detection sessions, authentication keys, -or the whole configuration. - -``` -curl GET http://0.0.0.0:9191/vpp/dump/v2/bfd -curl GET http://0.0.0.0:9191/vpp/dump/v2/bfd/sessions -curl GET http://0.0.0.0:9191/vpp/dump/v2/bfd/authkeys -``` - -**NAT** - -REST plugin allows to dump NAT44 global configuration, DNAT configuration or both of them together. -SNAT is currently not supported in the model, so REST dump is not available as well. - -``` -curl GET http://0.0.0.0:9191/vpp/dump/v2/nat -curl GET http://0.0.0.0:9191/vpp/dump/v2/nat/global -curl GET http://0.0.0.0:9191/vpp/dump/v2/nat/dnat -``` - -**STN** - -Steal the NIC feature REST API contains one uri returning the list of STN rules. - -``` -curl GET http://0.0.0.0:9191/vpp/dump/v2/stn -``` - -**L2 plugin** - -Support for bridge domains, FIBs and cross connects. It is also possible to get all -the bridge domain IDs. - -``` -curl GET http://0.0.0.0:9191/vpp/dump/v2/bdid -curl GET http://0.0.0.0:9191/vpp/dump/v2/bd -curl GET http://0.0.0.0:9191/vpp/dump/v2/fib -curl GET http://0.0.0.0:9191/vpp/dump/v2/xc -``` - -**L3 plugin** - -ARPs, proxy ARP interfaces/ranges and static routes exposed via REST: - -``` -curl GET http://0.0.0.0:9191/vpp/dump/v2/arps -curl GET http://0.0.0.0:9191/vpp/dump/v2/proxyarp/interfaces -curl GET http://0.0.0.0:9191/vpp/dump/v2/proxyarp/ranges -curl GET http://0.0.0.0:9191/vpp/dump/v2/routes -``` - -**Linux L3 plugin** - -Linux ARP and linux routes exposed via REST: - -``` -curl GET http://0.0.0.0:9191/linux/dump/v1/arps -curl GET http://0.0.0.0:9191/linux/dump/v1/routes -``` - -**L4 plugin** - -L4 plugin exposes session configuration: - -``` -curl GET http://0.0.0.0:9191/vpp/dump/v2/sessions -``` - -**Telemetry** - -REST allows to get all the telemetry data, or selective using specific key: - -``` -curl GET http://0.0.0.0:9191/vpp/dump/v2/telemetry -curl GET http://0.0.0.0:9191/vpp/dump/v2/telemetry/memory -curl GET http://0.0.0.0:9191/vpp/dump/v2/telemetry/runtime -curl GET http://0.0.0.0:9191/vpp/dump/v2/telemetry/nodecount -``` - -**CLI command** - -Allows to use VPP CLI command via REST. Commands are defined as a map as following: - -``` -curl POST http://0.0.0.0:9191/vpp/command -d '{"vppclicommand":""}' -``` - -**Index** - -REST to get index page. Configuration items are sorted by type (ifplugin, telemetry, etc.) - -``` -curl GET http://0.0.0.0:9191/ -``` - -## Logging mechanism -The REST API request is logged to stdout. The log contains VPPCLI command and VPPCLI response. It is searchable in elastic search using "VPPCLI". diff --git a/vendor/github.com/ligato/vpp-agent/plugins/restapi/handlers.go b/vendor/github.com/ligato/vpp-agent/plugins/restapi/handlers.go index 8a35556fa6..55e3aa8e06 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/restapi/handlers.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/restapi/handlers.go @@ -27,6 +27,7 @@ import ( "github.com/unrolled/render" interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" + "github.com/ligato/vpp-agent/plugins/configurator" "github.com/ligato/vpp-agent/plugins/govppmux" "github.com/ligato/vpp-agent/plugins/restapi/resturl" ) @@ -189,8 +190,9 @@ func (p *Plugin) registerTelemetryHandlers() { } // Registers Tracer handler -func (p *Plugin) registerTracerHandler() { +func (p *Plugin) registerStatsHandler() { p.HTTPHandlers.RegisterHTTPHandler(resturl.Tracer, p.tracerHandler, GET) + p.HTTPHandlers.RegisterHTTPHandler(resturl.ConfiguratorStats, p.configuratorStatsHandler, GET) } // Registers command handler @@ -373,6 +375,19 @@ func (p *Plugin) tracerHandler(formatter *render.Render) http.HandlerFunc { } } +// configuratorStatsHandler - returns stats for Configurator +func (p *Plugin) configuratorStatsHandler(formatter *render.Render) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + stats := configurator.GetStats() + if stats == nil { + p.logError(formatter.JSON(w, http.StatusOK, "Configurator stats not available")) + return + } + + p.logError(formatter.JSON(w, http.StatusOK, stats)) + } +} + // logError logs non-nil errors from JSON formatter func (p *Plugin) logError(err error) { if err != nil { diff --git a/vendor/github.com/ligato/vpp-agent/plugins/restapi/plugin_restapi.go b/vendor/github.com/ligato/vpp-agent/plugins/restapi/plugin_restapi.go index 1792d4c165..1f667a5bde 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/restapi/plugin_restapi.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/restapi/plugin_restapi.go @@ -165,11 +165,12 @@ func (p *Plugin) AfterInit() (err error) { //} // Telemetry, command, index, tracer - p.registerTracerHandler() p.registerTelemetryHandlers() p.registerCommandHandler() p.registerIndexHandlers() + p.registerStatsHandler() + return nil } @@ -211,8 +212,9 @@ func getIndexPageItems() map[string][]indexItem { {Name: "Runtime", Path: resturl.TRuntime}, {Name: "Node count", Path: resturl.TNodeCount}, }, - "Tracer": { + "Stats": { {Name: "VPP Binary API", Path: resturl.Tracer}, + {Name: "Configurator Stats", Path: resturl.ConfiguratorStats}, }, } return idxMap @@ -222,10 +224,11 @@ func getIndexPageItems() map[string][]indexItem { // REST security is enabled in plugin func getPermissionsGroups() []*access.PermissionGroup { tracerPg := &access.PermissionGroup{ - Name: "tracer", + Name: "stats", Permissions: []*access.PermissionGroup_Permissions{ newPermission(resturl.Index, GET), newPermission(resturl.Tracer, GET), + newPermission(resturl.ConfiguratorStats, GET), }, } telemetryPg := &access.PermissionGroup{ diff --git a/vendor/github.com/ligato/vpp-agent/plugins/restapi/resturl/urls.go b/vendor/github.com/ligato/vpp-agent/plugins/restapi/resturl/urls.go index 3e62c647c0..72d15e3c33 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/restapi/resturl/urls.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/restapi/resturl/urls.go @@ -109,10 +109,12 @@ const ( TNodeCount = "/vpp/telemetry/nodecount" ) -// Tracer +// Stats const ( // Traced binary API calls Tracer = "/vpp/binapitrace" + // Configurator stats + ConfiguratorStats = "/stats/configurator" ) // Index diff --git a/vendor/github.com/ligato/vpp-agent/plugins/telemetry/README.md b/vendor/github.com/ligato/vpp-agent/plugins/telemetry/README.md deleted file mode 100644 index 7592c19c86..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/telemetry/README.md +++ /dev/null @@ -1,196 +0,0 @@ -# Telemetry Plugin - -The `telemetry` plugin is a core Agent Plugin for exporting telemetry -statistics from VPP for Prometheus. - -Statistics are published via registry path `/vpp` on port `9191` and -updated every 30 seconds. - -### Exported data - -- VPP runtime (`show runtime`) - - ``` - Name State Calls Vectors Suspends Clocks Vectors/Call - acl-plugin-fa-cleaner-process event wait 0 0 1 4.24e4 0.00 - api-rx-from-ring any wait 0 0 18 2.92e5 0.00 - avf-process event wait 0 0 1 1.18e4 0.00 - bfd-process event wait 0 0 1 1.21e4 0.00 - cdp-process any wait 0 0 1 1.34e5 0.00 - dhcp-client-process any wait 0 0 1 4.88e3 0.00 - dns-resolver-process any wait 0 0 1 5.88e3 0.00 - fib-walk any wait 0 0 4 1.67e4 0.00 - flow-report-process any wait 0 0 1 3.19e3 0.00 - flowprobe-timer-process any wait 0 0 1 1.40e4 0.00 - igmp-timer-process event wait 0 0 1 1.29e4 0.00 - ikev2-manager-process any wait 0 0 7 4.58e3 0.00 - ioam-export-process any wait 0 0 1 3.49e3 0.00 - ip-route-resolver-process any wait 0 0 1 7.07e3 0.00 - ip4-reassembly-expire-walk any wait 0 0 1 3.92e3 0.00 - ip6-icmp-neighbor-discovery-ev any wait 0 0 7 4.78e3 0.00 - ip6-reassembly-expire-walk any wait 0 0 1 5.16e3 0.00 - l2fib-mac-age-scanner-process event wait 0 0 1 4.57e3 0.00 - lacp-process event wait 0 0 1 2.46e5 0.00 - lisp-retry-service any wait 0 0 4 1.05e4 0.00 - lldp-process event wait 0 0 1 6.79e4 0.00 - memif-process event wait 0 0 1 1.94e4 0.00 - nat-det-expire-walk done 1 0 0 5.68e3 0.00 - nat64-expire-walk event wait 0 0 1 5.01e7 0.00 - rd-cp-process any wait 0 0 174857 4.04e2 0.00 - send-rs-process any wait 0 0 1 3.22e3 0.00 - startup-config-process done 1 0 1 4.99e3 0.00 - udp-ping-process any wait 0 0 1 2.65e4 0.00 - unix-cli-127.0.0.1:38288 active 0 0 9 4.62e8 0.00 - unix-epoll-input polling 12735239 0 0 1.14e3 0.00 - vhost-user-process any wait 0 0 1 5.66e3 0.00 - vhost-user-send-interrupt-proc any wait 0 0 1 1.95e3 0.00 - vpe-link-state-process event wait 0 0 1 2.27e3 0.00 - vpe-oam-process any wait 0 0 4 1.11e4 0.00 - vxlan-gpe-ioam-export-process any wait 0 0 1 4.04e3 0.00 - wildcard-ip4-arp-publisher-pro event wait 0 0 1 5.49e4 0.00 - - ``` - - Example: - - ```sh - # HELP vpp_runtime_calls Number of calls - # TYPE vpp_runtime_calls gauge - ... - vpp_runtime_calls{agent="agent1",item="unix-epoll-input",thread="",threadID="0"} 7.65806939e+08 - ... - # HELP vpp_runtime_clocks Number of clocks - # TYPE vpp_runtime_clocks gauge - ... - vpp_runtime_clocks{agent="agent1",item="unix-epoll-input",thread="",threadID="0"} 1150 - ... - # HELP vpp_runtime_suspends Number of suspends - # TYPE vpp_runtime_suspends gauge - ... - vpp_runtime_suspends{agent="agent1",item="unix-epoll-input",thread="",threadID="0"} 0 - ... - # HELP vpp_runtime_vectors Number of vectors - # TYPE vpp_runtime_vectors gauge - ... - vpp_runtime_vectors{agent="agent1",item="unix-epoll-input",thread="",threadID="0"} 0 - ... - # HELP vpp_runtime_vectors_per_call Number of vectors per call - # TYPE vpp_runtime_vectors_per_call gauge - ... - vpp_runtime_vectors_per_call{agent="agent1",item="unix-epoll-input",thread="",threadID="0"} 0 - ... - ``` - -- VPP buffers (`show buffers`) - - ``` - Thread Name Index Size Alloc Free #Alloc #Free - 0 default 0 2048 0 0 0 0 - 0 lacp-ethernet 1 256 0 0 0 0 - 0 marker-ethernet 2 256 0 0 0 0 - 0 ip4 arp 3 256 0 0 0 0 - 0 ip6 neighbor discovery 4 256 0 0 0 0 - 0 cdp-ethernet 5 256 0 0 0 0 - 0 lldp-ethernet 6 256 0 0 0 0 - 0 replication-recycle 7 1024 0 0 0 0 - 0 default 8 2048 0 0 0 0 - ``` - - Example: - - ```sh - # HELP vpp_buffers_alloc Allocated - # TYPE vpp_buffers_alloc gauge - vpp_buffers_alloc{agent="agent1",index="0",item="default",threadID="0"} 0 - vpp_buffers_alloc{agent="agent1",index="1",item="lacp-ethernet",threadID="0"} 0 - ... - # HELP vpp_buffers_free Free - # TYPE vpp_buffers_free gauge - vpp_buffers_free{agent="agent1",index="0",item="default",threadID="0"} 0 - vpp_buffers_free{agent="agent1",index="1",item="lacp-ethernet",threadID="0"} 0 - ... - # HELP vpp_buffers_num_alloc Number of allocated - # TYPE vpp_buffers_num_alloc gauge - vpp_buffers_num_alloc{agent="agent1",index="0",item="default",threadID="0"} 0 - vpp_buffers_num_alloc{agent="agent1",index="1",item="lacp-ethernet",threadID="0"} 0 - ... - # HELP vpp_buffers_num_free Number of free - # TYPE vpp_buffers_num_free gauge - vpp_buffers_num_free{agent="agent1",index="0",item="default",threadID="0"} 0 - vpp_buffers_num_free{agent="agent1",index="1",item="lacp-ethernet",threadID="0"} 0 - ... - # HELP vpp_buffers_size Size of buffer - # TYPE vpp_buffers_size gauge - vpp_buffers_size{agent="agent1",index="0",item="default",threadID="0"} 2048 - vpp_buffers_size{agent="agent1",index="1",item="lacp-ethernet",threadID="0"} 256 - ... - ... - ``` - -- VPP memory (`show memory`) - - ``` - Thread 0 vpp_main - 20071 objects, 14276k of 14771k used, 21k free, 12k reclaimed, 315k overhead, 1048572k capacity - ``` - - Example: - - ```sh - # HELP vpp_memory_capacity Capacity - # TYPE vpp_memory_capacity gauge - vpp_memory_capacity{agent="agent1",thread="vpp_main",threadID="0"} 1.048572e+09 - # HELP vpp_memory_free Free memory - # TYPE vpp_memory_free gauge - vpp_memory_free{agent="agent1",thread="vpp_main",threadID="0"} 4000 - # HELP vpp_memory_objects Number of objects - # TYPE vpp_memory_objects gauge - vpp_memory_objects{agent="agent1",thread="vpp_main",threadID="0"} 20331 - # HELP vpp_memory_overhead Overhead - # TYPE vpp_memory_overhead gauge - vpp_memory_overhead{agent="agent1",thread="vpp_main",threadID="0"} 319000 - # HELP vpp_memory_reclaimed Reclaimed memory - # TYPE vpp_memory_reclaimed gauge - vpp_memory_reclaimed{agent="agent1",thread="vpp_main",threadID="0"} 0 - # HELP vpp_memory_total Total memory - # TYPE vpp_memory_total gauge - vpp_memory_total{agent="agent1",thread="vpp_main",threadID="0"} 1.471e+07 - # HELP vpp_memory_used Used memory - # TYPE vpp_memory_used gauge - vpp_memory_used{agent="agent1",thread="vpp_main",threadID="0"} 1.4227e+07 - ``` - -- VPP node counters (`show node counters`) - - ``` - Count Node Reason - 120406 ipsec-output-ip4 IPSec policy protect - 120406 esp-encrypt ESP pkts received - 123692 ipsec-input-ip4 IPSEC pkts received - 3286 ip4-icmp-input unknown type - 120406 ip4-icmp-input echo replies sent - 14 ethernet-input l3 mac mismatch - 102 arp-input ARP replies sent - ``` - - Example: - - ```sh - # HELP vpp_node_counter_count Count - # TYPE vpp_node_counter_count gauge - vpp_node_counter_count{agent="agent1",item="arp-input",reason="ARP replies sent"} 103 - vpp_node_counter_count{agent="agent1",item="esp-encrypt",reason="ESP pkts received"} 124669 - vpp_node_counter_count{agent="agent1",item="ethernet-input",reason="l3 mac mismatch"} 14 - vpp_node_counter_count{agent="agent1",item="ip4-icmp-input",reason="echo replies sent"} 124669 - vpp_node_counter_count{agent="agent1",item="ip4-icmp-input",reason="unknown type"} 3358 - vpp_node_counter_count{agent="agent1",item="ipsec-input-ip4",reason="IPSEC pkts received"} 128027 - vpp_node_counter_count{agent="agent1",item="ipsec-output-ip4",reason="IPSec policy protect"} 124669 - ``` - -### Configuration file - -Telemetry plugin configuration file allows to change polling interval, or turn the polling off. - -`polling-interval` is time in nanoseconds between reads from the VPP. - -`disabled` can be set to `true` in order to disable the plugin. \ No newline at end of file diff --git a/vendor/github.com/ligato/vpp-agent/plugins/telemetry/telemetry.go b/vendor/github.com/ligato/vpp-agent/plugins/telemetry/telemetry.go index 4c2495f48e..b9abed933a 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/telemetry/telemetry.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/telemetry/telemetry.go @@ -28,7 +28,6 @@ import ( "github.com/ligato/vpp-agent/plugins/govppmux" "github.com/ligato/vpp-agent/plugins/telemetry/vppcalls" - _ "github.com/ligato/vpp-agent/plugins/telemetry/vppcalls/vpp1810" _ "github.com/ligato/vpp-agent/plugins/telemetry/vppcalls/vpp1901" _ "github.com/ligato/vpp-agent/plugins/telemetry/vppcalls/vpp1904" ) diff --git a/vendor/github.com/ligato/vpp-agent/plugins/telemetry/vppcalls/vpp1810/telemetry_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/telemetry/vppcalls/vpp1810/telemetry_vppcalls.go deleted file mode 100644 index 19dcb5a3f1..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/telemetry/vppcalls/vpp1810/telemetry_vppcalls.go +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "context" - "fmt" - "regexp" - "strconv" - "strings" - - govppapi "git.fd.io/govpp.git/api" - "github.com/ligato/vpp-agent/plugins/govppmux/vppcalls/vpp1810" - - vpevppcalls "github.com/ligato/vpp-agent/plugins/govppmux/vppcalls" - "github.com/ligato/vpp-agent/plugins/telemetry/vppcalls" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/memclnt" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vpe" -) - -func init() { - var msgs []govppapi.Message - msgs = append(msgs, memclnt.Messages...) - msgs = append(msgs, vpe.Messages...) - - vppcalls.Versions["18.10"] = vppcalls.HandlerVersion{ - Msgs: msgs, - New: func(ch govppapi.Channel, stats govppapi.StatsProvider) vppcalls.TelemetryVppAPI { - return NewTelemetryVppHandler(ch, stats) - }, - } -} - -type TelemetryHandler struct { - ch govppapi.Channel - vpevppcalls.VpeVppAPI -} - -func NewTelemetryVppHandler(ch govppapi.Channel, stats govppapi.StatsProvider) *TelemetryHandler { - vpeHandler := vpp1810.NewVpeHandler(ch) - return &TelemetryHandler{ch, vpeHandler} -} - -var ( - // Regular expression to parse output from `show memory` - memoryRe = regexp.MustCompile(`Thread\s+(\d+)\s+(\w+).?\s+(\d+) objects, ([\dkmg\.]+) of ([\dkmg\.]+) used, ([\dkmg\.]+) free, ([\dkmg\.]+) reclaimed, ([\dkmg\.]+) overhead, ([\dkmg\.]+) capacity`) -) - -// GetMemory retrieves `show memory` info. -func (h *TelemetryHandler) GetMemory(ctx context.Context) (*vppcalls.MemoryInfo, error) { - data, err := h.RunCli("show memory") - if err != nil { - return nil, err - } - - var threads []vppcalls.MemoryThread - - threadMatches := memoryRe.FindAllStringSubmatch(string(data), -1) - for _, matches := range threadMatches { - fields := matches[1:] - if len(fields) != 9 { - return nil, fmt.Errorf("invalid memory data for thread: %q", matches[0]) - } - id, err := strconv.ParseUint(fields[0], 10, 64) - if err != nil { - return nil, err - } - thread := &vppcalls.MemoryThread{ - ID: uint(id), - Name: fields[1], - Objects: strToUint64(fields[2]), - Used: strToUint64(fields[3]), - Total: strToUint64(fields[4]), - Free: strToUint64(fields[5]), - Reclaimed: strToUint64(fields[6]), - Overhead: strToUint64(fields[7]), - Size: strToUint64(fields[8]), - } - threads = append(threads, *thread) - } - - info := &vppcalls.MemoryInfo{ - Threads: threads, - } - - return info, nil -} - -var ( - // Regular expression to parse output from `show node counters` - nodeCountersRe = regexp.MustCompile(`^\s+(\d+)\s+([\w-\/]+)\s+(.+)$`) -) - -// GetNodeCounters retrieves node counters info. -func (h *TelemetryHandler) GetNodeCounters(ctx context.Context) (*vppcalls.NodeCounterInfo, error) { - data, err := h.RunCli("show node counters") - if err != nil { - return nil, err - } - - var counters []vppcalls.NodeCounter - - for i, line := range strings.Split(string(data), "\n") { - // Skip empty lines - if strings.TrimSpace(line) == "" { - continue - } - // Check first line - if i == 0 { - fields := strings.Fields(line) - // Verify header - if len(fields) != 3 || fields[0] != "Count" { - return nil, fmt.Errorf("invalid header for `show node counters` received: %q", line) - } - continue - } - - // Parse lines using regexp - matches := nodeCountersRe.FindStringSubmatch(line) - if len(matches)-1 != 3 { - return nil, fmt.Errorf("parsing failed for `show node counters` line: %q", line) - } - fields := matches[1:] - - counters = append(counters, vppcalls.NodeCounter{ - Name: strings.Join(fields, "/"), - Value: strToUint64(fields[0]), - }) - } - - info := &vppcalls.NodeCounterInfo{ - Counters: counters, - } - - return info, nil -} - -var ( - // Regular expression to parse output from `show runtime` - runtimeRe = regexp.MustCompile(`(?:-+\n)?(?:Thread (\d+) (\w+)(?: \(lcore \d+\))?\n)?` + - `Time ([0-9\.e]+), average vectors/node ([0-9\.e]+), last (\d+) main loops ([0-9\.e]+) per node ([0-9\.e]+)\s+` + - `vector rates in ([0-9\.e]+), out ([0-9\.e]+), drop ([0-9\.e]+), punt ([0-9\.e]+)\n` + - `\s+Name\s+State\s+Calls\s+Vectors\s+Suspends\s+Clocks\s+Vectors/Call\s+` + - `((?:[\w-:\.]+\s+\w+(?:[ -]\w+)*\s+\d+\s+\d+\s+\d+\s+[0-9\.e]+\s+[0-9\.e]+\s+)+)`) - runtimeItemsRe = regexp.MustCompile(`([\w-:\.]+)\s+(\w+(?:[ -]\w+)*)\s+(\d+)\s+(\d+)\s+(\d+)\s+([0-9\.e]+)\s+([0-9\.e]+)\s+`) -) - -// GetRuntimeInfo retrieves how runtime info. -func (h *TelemetryHandler) GetRuntimeInfo(ctx context.Context) (*vppcalls.RuntimeInfo, error) { - data, err := h.RunCli("show runtime") - if err != nil { - return nil, err - } - - var threads []vppcalls.RuntimeThread - - threadMatches := runtimeRe.FindAllStringSubmatch(string(data), -1) - for _, matches := range threadMatches { - fields := matches[1:] - if len(fields) != 12 { - return nil, fmt.Errorf("invalid runtime data for thread: %q", matches[0]) - } - thread := vppcalls.RuntimeThread{ - ID: uint(strToUint64(fields[0])), - Name: fields[1], - Time: strToFloat64(fields[2]), - AvgVectorsPerNode: strToFloat64(fields[3]), - LastMainLoops: strToUint64(fields[4]), - VectorsPerMainLoop: strToFloat64(fields[5]), - VectorLengthPerNode: strToFloat64(fields[6]), - VectorRatesIn: strToFloat64(fields[7]), - VectorRatesOut: strToFloat64(fields[8]), - VectorRatesDrop: strToFloat64(fields[9]), - VectorRatesPunt: strToFloat64(fields[10]), - } - - itemMatches := runtimeItemsRe.FindAllStringSubmatch(fields[11], -1) - for _, matches := range itemMatches { - fields := matches[1:] - if len(fields) != 7 { - return nil, fmt.Errorf("invalid runtime data for thread item: %q", matches[0]) - } - thread.Items = append(thread.Items, vppcalls.RuntimeItem{ - Name: fields[0], - State: fields[1], - Calls: strToUint64(fields[2]), - Vectors: strToUint64(fields[3]), - Suspends: strToUint64(fields[4]), - Clocks: strToFloat64(fields[5]), - VectorsPerCall: strToFloat64(fields[6]), - }) - } - - threads = append(threads, thread) - } - - info := &vppcalls.RuntimeInfo{ - Threads: threads, - } - - return info, nil -} - -var ( - // Regular expression to parse output from `show buffers` - buffersRe = regexp.MustCompile(`^\s+(\d+)\s+(\w+(?:[ \-]\w+)*)\s+(\d+)\s+(\d+)\s+([\dkmg\.]+)\s+([\dkmg\.]+)\s+(\d+)\s+(\d+).*$`) -) - -// GetBuffersInfo retrieves buffers info -func (h *TelemetryHandler) GetBuffersInfo(ctx context.Context) (*vppcalls.BuffersInfo, error) { - data, err := h.RunCli("show buffers") - if err != nil { - return nil, err - } - - var items []vppcalls.BuffersItem - - for i, line := range strings.Split(string(data), "\n") { - // Skip empty lines - if strings.TrimSpace(line) == "" { - continue - } - // Check first line - if i == 0 { - fields := strings.Fields(line) - // Verify header - if len(fields) != 8 || fields[0] != "Thread" { - return nil, fmt.Errorf("invalid header for `show buffers` received: %q", line) - } - continue - } - - // Parse lines using regexp - matches := buffersRe.FindStringSubmatch(line) - if len(matches)-1 != 8 { - return nil, fmt.Errorf("parsing failed for `show buffers` line: %q", line) - } - fields := matches[1:] - - items = append(items, vppcalls.BuffersItem{ - ThreadID: uint(strToUint64(fields[0])), - Name: fields[1], - Index: uint(strToUint64(fields[2])), - Size: strToUint64(fields[3]), - Alloc: strToUint64(fields[4]), - Free: strToUint64(fields[5]), - NumAlloc: strToUint64(fields[6]), - NumFree: strToUint64(fields[7]), - }) - } - - info := &vppcalls.BuffersInfo{ - Items: items, - } - - return info, nil -} - -func strToFloat64(s string) float64 { - // Replace 'k' (thousands) with 'e3' to make it parsable with strconv - s = strings.Replace(s, "k", "e3", 1) - s = strings.Replace(s, "m", "e6", 1) - s = strings.Replace(s, "g", "e9", 1) - - num, err := strconv.ParseFloat(s, 10) - if err != nil { - return 0 - } - return num -} - -func strToUint64(s string) uint64 { - return uint64(strToFloat64(s)) -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/aclplugin.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/aclplugin.go index aafd45f605..3bc9834e99 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/aclplugin.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/aclplugin.go @@ -30,7 +30,6 @@ import ( "github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls" "github.com/ligato/vpp-agent/plugins/vpp/ifplugin" - _ "github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1810" _ "github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1901" _ "github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1904" ) diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1810/acl_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1810/acl_vppcalls.go deleted file mode 100644 index 8ef3700cbe..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1810/acl_vppcalls.go +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "fmt" - "net" - "strings" - - acl "github.com/ligato/vpp-agent/api/models/vpp/acl" - "github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls" - aclapi "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/acl" -) - -// AddACL implements ACL handler. -func (h *ACLVppHandler) AddACL(rules []*acl.ACL_Rule, aclName string) (uint32, error) { - // Prepare Ip rules - aclIPRules, err := transformACLIpRules(rules) - if err != nil { - return 0, err - } - if len(aclIPRules) == 0 { - return 0, fmt.Errorf("no rules found for ACL %v", aclName) - } - - req := &aclapi.ACLAddReplace{ - ACLIndex: 0xffffffff, // to make new Entry - Count: uint32(len(aclIPRules)), - Tag: []byte(aclName), - R: aclIPRules, - } - reply := &aclapi.ACLAddReplaceReply{} - - if err = h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return 0, fmt.Errorf("failed to write ACL %v: %v", aclName, err) - } - - return reply.ACLIndex, nil -} - -// AddMACIPACL implements ACL handler. -func (h *ACLVppHandler) AddMACIPACL(rules []*acl.ACL_Rule, aclName string) (uint32, error) { - // Prepare MAc Ip rules - aclMacIPRules, err := h.transformACLMacIPRules(rules) - if err != nil { - return 0, err - } - if len(aclMacIPRules) == 0 { - return 0, fmt.Errorf("no rules found for ACL %v", aclName) - } - - req := &aclapi.MacipACLAdd{ - Count: uint32(len(aclMacIPRules)), - Tag: []byte(aclName), - R: aclMacIPRules, - } - reply := &aclapi.MacipACLAddReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return 0, fmt.Errorf("failed to write ACL %v: %v", aclName, err) - } - - return reply.ACLIndex, nil -} - -// ModifyACL implements ACL handler. -func (h *ACLVppHandler) ModifyACL(aclIndex uint32, rules []*acl.ACL_Rule, aclName string) error { - // Prepare Ip rules - aclIPRules, err := transformACLIpRules(rules) - if err != nil { - return err - } - if len(aclIPRules) == 0 { - return nil - } - - req := &aclapi.ACLAddReplace{ - ACLIndex: aclIndex, - Count: uint32(len(aclIPRules)), - Tag: []byte(aclName), - R: aclIPRules, - } - reply := &aclapi.ACLAddReplaceReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return fmt.Errorf("failed to write ACL %v: %v", aclName, err) - } - - return nil -} - -// ModifyMACIPACL implements ACL handler. -func (h *ACLVppHandler) ModifyMACIPACL(aclIndex uint32, rules []*acl.ACL_Rule, aclName string) error { - // Prepare MAc Ip rules - aclMacIPRules, err := h.transformACLMacIPRules(rules) - if err != nil { - return err - } - if len(aclMacIPRules) == 0 { - return fmt.Errorf("no rules found for ACL %v", aclName) - } - - req := &aclapi.MacipACLAddReplace{ - ACLIndex: aclIndex, - Count: uint32(len(aclMacIPRules)), - Tag: []byte(aclName), - R: aclMacIPRules, - } - reply := &aclapi.MacipACLAddReplaceReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return fmt.Errorf("failed to write ACL %v: %v", aclName, err) - } - - return nil -} - -// DeleteACL implements ACL handler. -func (h *ACLVppHandler) DeleteACL(aclIndex uint32) error { - req := &aclapi.ACLDel{ - ACLIndex: aclIndex, - } - reply := &aclapi.ACLDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return fmt.Errorf("failed to remove L3/L4 ACL %v: %v", aclIndex, err) - } - - return nil -} - -// DeleteMACIPACL implements ACL handler. -func (h *ACLVppHandler) DeleteMACIPACL(aclIndex uint32) error { - req := &aclapi.MacipACLDel{ - ACLIndex: aclIndex, - } - reply := &aclapi.MacipACLDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return fmt.Errorf("failed to remove L2 ACL %v: %v", aclIndex, err) - } - - return nil -} - -// Method transforms provided set of IP proto ACL rules to binapi ACL rules. -func transformACLIpRules(rules []*acl.ACL_Rule) (aclIPRules []aclapi.ACLRule, err error) { - for _, rule := range rules { - aclRule := &aclapi.ACLRule{ - IsPermit: uint8(rule.Action), - } - // Match - if ipRule := rule.GetIpRule(); ipRule != nil { - // Concerned to IP rules only - // L3 - if ipRule.Ip != nil { - aclRule, err = ipACL(ipRule.Ip, aclRule) - if err != nil { - return nil, err - } - } - // ICMP/L4 - if ipRule.Icmp != nil { - aclRule = icmpACL(ipRule.Icmp, aclRule) - } else if ipRule.Tcp != nil { - aclRule = tcpACL(ipRule.Tcp, aclRule) - } else if ipRule.Udp != nil { - aclRule = udpACL(ipRule.Udp, aclRule) - } - aclIPRules = append(aclIPRules, *aclRule) - } - } - return aclIPRules, nil -} - -func (h *ACLVppHandler) transformACLMacIPRules(rules []*acl.ACL_Rule) (aclMacIPRules []aclapi.MacipACLRule, err error) { - for _, rule := range rules { - aclMacIPRule := &aclapi.MacipACLRule{ - IsPermit: uint8(rule.Action), - } - // Matche - if macIPRule := rule.GetMacipRule(); macIPRule != nil { - // Concerned to MAC IP rules only - // Source IP Address + Prefix - srcIPAddress := net.ParseIP(macIPRule.SourceAddress) - if srcIPAddress.To4() != nil { - aclMacIPRule.IsIPv6 = 0 - aclMacIPRule.SrcIPAddr = srcIPAddress.To4() - aclMacIPRule.SrcIPPrefixLen = uint8(macIPRule.SourceAddressPrefix) - } else if srcIPAddress.To16() != nil { - aclMacIPRule.IsIPv6 = 1 - aclMacIPRule.SrcIPAddr = srcIPAddress.To16() - aclMacIPRule.SrcIPPrefixLen = uint8(macIPRule.SourceAddressPrefix) - } else { - return nil, fmt.Errorf("invalid IP address %v", macIPRule.SourceAddress) - } - // MAC + mask - srcMac, err := net.ParseMAC(macIPRule.SourceMacAddress) - if err != nil { - return aclMacIPRules, err - } - srcMacMask, err := net.ParseMAC(macIPRule.SourceMacAddressMask) - if err != nil { - return aclMacIPRules, err - } - aclMacIPRule.SrcMac = srcMac - aclMacIPRule.SrcMacMask = srcMacMask - aclMacIPRules = append(aclMacIPRules, *aclMacIPRule) - } - } - return aclMacIPRules, nil -} - -// The function sets an IP ACL rule fields into provided ACL Rule object. Source -// and destination addresses have to be the same IP version and contain a network mask. -func ipACL(ipRule *acl.ACL_Rule_IpRule_Ip, aclRule *aclapi.ACLRule) (*aclapi.ACLRule, error) { - var ( - err error - srcIP net.IP - srcNetwork *net.IPNet - dstIP net.IP - dstNetwork *net.IPNet - srcMask uint8 - dstMask uint8 - ) - - if strings.TrimSpace(ipRule.SourceNetwork) != "" { - // Resolve source address - srcIP, srcNetwork, err = net.ParseCIDR(ipRule.SourceNetwork) - if err != nil { - return nil, err - } - if srcIP.To4() == nil && srcIP.To16() == nil { - return aclRule, fmt.Errorf("source address %v is invalid", ipRule.SourceNetwork) - } - maskSize, _ := srcNetwork.Mask.Size() - srcMask = uint8(maskSize) - } - - if strings.TrimSpace(ipRule.DestinationNetwork) != "" { - // Resolve destination address - dstIP, dstNetwork, err = net.ParseCIDR(ipRule.DestinationNetwork) - if err != nil { - return nil, err - } - if dstIP.To4() == nil && dstIP.To16() == nil { - return aclRule, fmt.Errorf("destination address %v is invalid", ipRule.DestinationNetwork) - } - maskSize, _ := dstNetwork.Mask.Size() - dstMask = uint8(maskSize) - } - - // Check IP version (they should be the same), beware: IPv4 address can be converted to IPv6. - if (srcIP.To4() != nil && dstIP.To4() == nil && dstIP.To16() != nil) || - (srcIP.To4() == nil && srcIP.To16() != nil && dstIP.To4() != nil) { - return aclRule, fmt.Errorf("source address %v and destionation address %v have different IP versions", - ipRule.SourceNetwork, ipRule.DestinationNetwork) - } - - if srcIP.To4() != nil || dstIP.To4() != nil { - // Ipv4 case - aclRule.IsIPv6 = 0 - aclRule.SrcIPAddr = srcIP.To4() - aclRule.SrcIPPrefixLen = srcMask - aclRule.DstIPAddr = dstIP.To4() - aclRule.DstIPPrefixLen = dstMask - } else if srcIP.To16() != nil || dstIP.To16() != nil { - // Ipv6 case - aclRule.IsIPv6 = 1 - aclRule.SrcIPAddr = srcIP.To16() - aclRule.SrcIPPrefixLen = srcMask - aclRule.DstIPAddr = dstIP.To16() - aclRule.DstIPPrefixLen = dstMask - } else { - // Both empty - aclRule.IsIPv6 = 0 - } - return aclRule, nil -} - -// The function sets an ICMP ACL rule fields into provided ACL Rule object. -// The ranges are exclusive, use first = 0 and last = 255/65535 (icmpv4/icmpv6) to match "any". -func icmpACL(icmpRule *acl.ACL_Rule_IpRule_Icmp, aclRule *aclapi.ACLRule) *aclapi.ACLRule { - if icmpRule == nil { - return aclRule - } - if icmpRule.Icmpv6 { - aclRule.Proto = vppcalls.ICMPv6Proto // IANA ICMPv6 - aclRule.IsIPv6 = 1 - // ICMPv6 type range - aclRule.SrcportOrIcmptypeFirst = uint16(icmpRule.IcmpTypeRange.First) - aclRule.SrcportOrIcmptypeLast = uint16(icmpRule.IcmpTypeRange.Last) - // ICMPv6 code range - aclRule.DstportOrIcmpcodeFirst = uint16(icmpRule.IcmpCodeRange.First) - aclRule.DstportOrIcmpcodeLast = uint16(icmpRule.IcmpCodeRange.First) - } else { - aclRule.Proto = vppcalls.ICMPv4Proto // IANA ICMPv4 - aclRule.IsIPv6 = 0 - // ICMPv4 type range - aclRule.SrcportOrIcmptypeFirst = uint16(icmpRule.IcmpTypeRange.First) - aclRule.SrcportOrIcmptypeLast = uint16(icmpRule.IcmpTypeRange.Last) - // ICMPv4 code range - aclRule.DstportOrIcmpcodeFirst = uint16(icmpRule.IcmpCodeRange.First) - aclRule.DstportOrIcmpcodeLast = uint16(icmpRule.IcmpCodeRange.Last) - } - return aclRule -} - -// Sets an TCP ACL rule fields into provided ACL Rule object. -func tcpACL(tcpRule *acl.ACL_Rule_IpRule_Tcp, aclRule *aclapi.ACLRule) *aclapi.ACLRule { - aclRule.Proto = vppcalls.TCPProto // IANA TCP - aclRule.SrcportOrIcmptypeFirst = uint16(tcpRule.SourcePortRange.LowerPort) - aclRule.SrcportOrIcmptypeLast = uint16(tcpRule.SourcePortRange.UpperPort) - aclRule.DstportOrIcmpcodeFirst = uint16(tcpRule.DestinationPortRange.LowerPort) - aclRule.DstportOrIcmpcodeLast = uint16(tcpRule.DestinationPortRange.UpperPort) - aclRule.TCPFlagsValue = uint8(tcpRule.TcpFlagsValue) - aclRule.TCPFlagsMask = uint8(tcpRule.TcpFlagsMask) - return aclRule -} - -// Sets an UDP ACL rule fields into provided ACL Rule object. -func udpACL(udpRule *acl.ACL_Rule_IpRule_Udp, aclRule *aclapi.ACLRule) *aclapi.ACLRule { - aclRule.Proto = vppcalls.UDPProto // IANA UDP - aclRule.SrcportOrIcmptypeFirst = uint16(udpRule.SourcePortRange.LowerPort) - aclRule.SrcportOrIcmptypeLast = uint16(udpRule.SourcePortRange.UpperPort) - aclRule.DstportOrIcmpcodeFirst = uint16(udpRule.DestinationPortRange.LowerPort) - aclRule.DstportOrIcmpcodeLast = uint16(udpRule.DestinationPortRange.UpperPort) - return aclRule -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1810/dump_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1810/dump_vppcalls.go deleted file mode 100644 index d2d98eaf0e..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1810/dump_vppcalls.go +++ /dev/null @@ -1,650 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "bytes" - "fmt" - "net" - - "github.com/ligato/cn-infra/logging/logrus" - - acl "github.com/ligato/vpp-agent/api/models/vpp/acl" - "github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls" - acl_api "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/acl" -) - -// DumpACL implements ACL handler. -func (h *ACLVppHandler) DumpACL() ([]*vppcalls.ACLDetails, error) { - ruleIPData := make(map[vppcalls.ACLMeta][]*acl.ACL_Rule) - - // get all ACLs with IP ruleData - IPRuleACLs, err := h.DumpIPAcls() - if len(IPRuleACLs) < 1 || err != nil { - return nil, err - } - - // resolve IP rules for every ACL - // Note: currently ACL may have only IP ruleData or only MAC IP ruleData - var wasErr error - for identifier, IPRules := range IPRuleACLs { - var rulesDetails []*acl.ACL_Rule - - if len(IPRules) > 0 { - for _, IPRule := range IPRules { - ruleDetails, err := h.getIPRuleDetails(IPRule) - if err != nil { - return nil, fmt.Errorf("failed to get IP Rule %v details: %v", IPRule, err) - } - rulesDetails = append(rulesDetails, ruleDetails) - } - } - ruleIPData[identifier] = rulesDetails - } - - // Prepare separate list of all active ACL indices on the VPP - var indices []uint32 - for identifier := range ruleIPData { - indices = append(indices, identifier.Index) - } - - // Get all ACL indices with ingress and egress interfaces - interfaceData, err := h.DumpACLInterfaces(indices) - if err != nil { - return nil, err - } - - var ACLs []*vppcalls.ACLDetails - // Build a list of ACL ruleData with ruleData, interfaces, index and tag (name) - for identifier, rules := range ruleIPData { - ACLs = append(ACLs, &vppcalls.ACLDetails{ - ACL: &acl.ACL{ - Name: identifier.Tag, - Rules: rules, - Interfaces: interfaceData[identifier.Index], - }, - Meta: &vppcalls.ACLMeta{ - Index: identifier.Index, - Tag: identifier.Tag, - }, - }) - } - - return ACLs, wasErr -} - -// DumpMACIPACL implements ACL handler. -func (h *ACLVppHandler) DumpMACIPACL() ([]*vppcalls.ACLDetails, error) { - ruleMACIPData := make(map[vppcalls.ACLMeta][]*acl.ACL_Rule) - - // get all ACLs with MACIP ruleData - MACIPRuleACLs, err := h.DumpMacIPAcls() - if len(MACIPRuleACLs) < 1 || err != nil { - return nil, err - } - - // resolve MACIP rules for every ACL - for metadata, MACIPRules := range MACIPRuleACLs { - var rulesDetails []*acl.ACL_Rule - - for _, MACIPRule := range MACIPRules { - ruleDetails, err := h.getMACIPRuleDetails(MACIPRule) - if err != nil { - return nil, fmt.Errorf("failed to get MACIP Rule %v details: %v", MACIPRule, err) - } - rulesDetails = append(rulesDetails, ruleDetails) - } - ruleMACIPData[metadata] = rulesDetails - } - - // Prepare separate list of all active ACL indices on the VPP - var indices []uint32 - for identifier := range ruleMACIPData { - indices = append(indices, identifier.Index) - } - - // Get all ACL indices with ingress and egress interfaces - interfaceData, err := h.DumpMACIPACLInterfaces(indices) - if err != nil { - return nil, err - } - - var ACLs []*vppcalls.ACLDetails - // Build a list of ACL ruleData with ruleData, interfaces, index and tag (name) - for metadata, rules := range ruleMACIPData { - ACLs = append(ACLs, &vppcalls.ACLDetails{ - ACL: &acl.ACL{ - Name: metadata.Tag, - Rules: rules, - Interfaces: interfaceData[metadata.Index], - }, - Meta: &vppcalls.ACLMeta{ - Index: metadata.Index, - Tag: metadata.Tag, - }, - }) - } - return ACLs, nil -} - -// DumpACLInterfaces implements ACL handler. -func (h *ACLVppHandler) DumpACLInterfaces(indices []uint32) (map[uint32]*acl.ACL_Interfaces, error) { - // list of ACL-to-interfaces - aclsWithInterfaces := make(map[uint32]*acl.ACL_Interfaces) - - var interfaceData []*vppcalls.ACLToInterface - var wasErr error - - msgIP := &acl_api.ACLInterfaceListDump{ - SwIfIndex: 0xffffffff, // dump all - } - reqIP := h.dumpChannel.SendMultiRequest(msgIP) - for { - replyIP := &acl_api.ACLInterfaceListDetails{} - stop, err := reqIP.ReceiveReply(replyIP) - if stop { - break - } - if err != nil { - return aclsWithInterfaces, fmt.Errorf("ACL interface list dump reply error: %v", err) - } - - if replyIP.Count > 0 { - data := &vppcalls.ACLToInterface{ - SwIfIdx: replyIP.SwIfIndex, - } - for i, aclIdx := range replyIP.Acls { - if i < int(replyIP.NInput) { - data.IngressACL = append(data.IngressACL, aclIdx) - } else { - data.EgressACL = append(data.EgressACL, aclIdx) - } - } - interfaceData = append(interfaceData, data) - } - } - - // sort interfaces for every ACL - for _, aclIdx := range indices { - var ingress []string - var egress []string - for _, data := range interfaceData { - // look for ingress - for _, ingressACLIdx := range data.IngressACL { - if ingressACLIdx == aclIdx { - name, _, found := h.ifIndexes.LookupBySwIfIndex(data.SwIfIdx) - if !found { - continue - } - ingress = append(ingress, name) - } - } - // look for egress - for _, egressACLIdx := range data.EgressACL { - if egressACLIdx == aclIdx { - name, _, found := h.ifIndexes.LookupBySwIfIndex(data.SwIfIdx) - if !found { - continue - } - egress = append(egress, name) - } - } - } - - aclsWithInterfaces[aclIdx] = &acl.ACL_Interfaces{ - Egress: egress, - Ingress: ingress, - } - } - - return aclsWithInterfaces, wasErr -} - -// DumpMACIPACLInterfaces implements ACL handler. -func (h *ACLVppHandler) DumpMACIPACLInterfaces(indices []uint32) (map[uint32]*acl.ACL_Interfaces, error) { - // list of ACL-to-interfaces - aclsWithInterfaces := make(map[uint32]*acl.ACL_Interfaces) - - var interfaceData []*vppcalls.ACLToInterface - - msgMACIP := &acl_api.MacipACLInterfaceListDump{ - SwIfIndex: 0xffffffff, // dump all - } - reqMACIP := h.dumpChannel.SendMultiRequest(msgMACIP) - for { - replyMACIP := &acl_api.MacipACLInterfaceListDetails{} - stop, err := reqMACIP.ReceiveReply(replyMACIP) - if stop { - break - } - if err != nil { - return nil, fmt.Errorf("MACIP ACL interface list dump reply error: %v", err) - } - if replyMACIP.Count > 0 { - data := &vppcalls.ACLToInterface{ - SwIfIdx: replyMACIP.SwIfIndex, - } - for _, aclIdx := range replyMACIP.Acls { - data.IngressACL = append(data.IngressACL, aclIdx) - } - interfaceData = append(interfaceData, data) - } - } - - for _, aclIdx := range indices { - var ingress []string - for _, data := range interfaceData { - // look for ingress - for _, ingressACLIdx := range data.IngressACL { - if ingressACLIdx == aclIdx { - name, _, found := h.ifIndexes.LookupBySwIfIndex(data.SwIfIdx) - if !found { - continue - } - ingress = append(ingress, name) - } - } - } - var ifaces *acl.ACL_Interfaces - if len(ingress) > 0 { - ifaces = &acl.ACL_Interfaces{ - Egress: nil, - Ingress: ingress, - } - } - aclsWithInterfaces[aclIdx] = ifaces - } - - return aclsWithInterfaces, nil -} - -// DumpIPAcls implements ACL handler. -func (h *ACLVppHandler) DumpIPAcls() (map[vppcalls.ACLMeta][]acl_api.ACLRule, error) { - aclIPRules := make(map[vppcalls.ACLMeta][]acl_api.ACLRule) - var wasErr error - - req := &acl_api.ACLDump{ - ACLIndex: 0xffffffff, - } - reqContext := h.dumpChannel.SendMultiRequest(req) - for { - msg := &acl_api.ACLDetails{} - stop, err := reqContext.ReceiveReply(msg) - if err != nil { - return aclIPRules, fmt.Errorf("ACL dump reply error: %v", err) - } - if stop { - break - } - - metadata := vppcalls.ACLMeta{ - Index: msg.ACLIndex, - Tag: string(bytes.SplitN(msg.Tag, []byte{0x00}, 2)[0]), - } - - aclIPRules[metadata] = msg.R - } - - return aclIPRules, wasErr -} - -// DumpMacIPAcls implements ACL handler. -func (h *ACLVppHandler) DumpMacIPAcls() (map[vppcalls.ACLMeta][]acl_api.MacipACLRule, error) { - aclMACIPRules := make(map[vppcalls.ACLMeta][]acl_api.MacipACLRule) - - req := &acl_api.MacipACLDump{ - ACLIndex: 0xffffffff, - } - reqContext := h.dumpChannel.SendMultiRequest(req) - for { - msg := &acl_api.MacipACLDetails{} - stop, err := reqContext.ReceiveReply(msg) - if err != nil { - return nil, fmt.Errorf("ACL MACIP dump reply error: %v", err) - } - if stop { - break - } - - metadata := vppcalls.ACLMeta{ - Index: msg.ACLIndex, - Tag: string(bytes.Trim(msg.Tag, "\x00")), - } - - aclMACIPRules[metadata] = msg.R - } - return aclMACIPRules, nil -} - -// DumpInterfaceACLs implements ACL handler. -func (h *ACLVppHandler) DumpInterfaceACLs(swIndex uint32) (acls []*acl.ACL, err error) { - res, err := h.DumpInterfaceACLList(swIndex) - if err != nil { - return nil, err - } - - if res.SwIfIndex != swIndex { - return nil, fmt.Errorf("returned interface index %d does not match request", res.SwIfIndex) - } - - for aidx := range res.Acls { - ipACL, err := h.getIPACLDetails(uint32(aidx)) - if err != nil { - return nil, err - } - acls = append(acls, ipACL) - } - return acls, nil -} - -// DumpInterfaceMACIPACLs implements ACL handler. -func (h *ACLVppHandler) DumpInterfaceMACIPACLs(swIndex uint32) (acls []*acl.ACL, err error) { - resMacIP, err := h.DumpInterfaceMACIPACLList(swIndex) - if err != nil { - return nil, err - } - - if resMacIP.SwIfIndex != swIndex { - return nil, fmt.Errorf("returned interface index %d does not match request", resMacIP.SwIfIndex) - } - - for aidx := range resMacIP.Acls { - macipACL, err := h.getMACIPACLDetails(uint32(aidx)) - if err != nil { - return nil, err - } - acls = append(acls, macipACL) - } - return acls, nil -} - -// DumpInterfaceACLList implements ACL handler. -func (h *ACLVppHandler) DumpInterfaceACLList(swIndex uint32) (*acl_api.ACLInterfaceListDetails, error) { - req := &acl_api.ACLInterfaceListDump{ - SwIfIndex: swIndex, - } - reply := &acl_api.ACLInterfaceListDetails{} - - if err := h.dumpChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return nil, err - } - - return reply, nil -} - -// DumpInterfaceMACIPACLList implements ACL handler. -func (h *ACLVppHandler) DumpInterfaceMACIPACLList(swIndex uint32) (*acl_api.MacipACLInterfaceListDetails, error) { - req := &acl_api.MacipACLInterfaceListDump{ - SwIfIndex: swIndex, - } - reply := &acl_api.MacipACLInterfaceListDetails{} - - if err := h.dumpChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return nil, err - } - - return reply, nil -} - -// DumpInterfacesLists implements ACL handler. -func (h *ACLVppHandler) DumpInterfacesLists() ([]*acl_api.ACLInterfaceListDetails, []*acl_api.MacipACLInterfaceListDetails, error) { - msgIPACL := &acl_api.ACLInterfaceListDump{ - SwIfIndex: 0xffffffff, // dump all - } - - reqIPACL := h.dumpChannel.SendMultiRequest(msgIPACL) - - var IPaclInterfaces []*acl_api.ACLInterfaceListDetails - for { - reply := &acl_api.ACLInterfaceListDetails{} - stop, err := reqIPACL.ReceiveReply(reply) - if stop { - break - } - if err != nil { - logrus.DefaultLogger().Error(err) - return nil, nil, err - } - IPaclInterfaces = append(IPaclInterfaces, reply) - } - - msgMACIPACL := &acl_api.ACLInterfaceListDump{ - SwIfIndex: 0xffffffff, // dump all - } - - reqMACIPACL := h.dumpChannel.SendMultiRequest(msgMACIPACL) - - var MACIPaclInterfaces []*acl_api.MacipACLInterfaceListDetails - for { - reply := &acl_api.MacipACLInterfaceListDetails{} - stop, err := reqMACIPACL.ReceiveReply(reply) - if stop { - break - } - if err != nil { - logrus.DefaultLogger().Error(err) - return nil, nil, err - } - MACIPaclInterfaces = append(MACIPaclInterfaces, reply) - } - - return IPaclInterfaces, MACIPaclInterfaces, nil -} - -func (h *ACLVppHandler) getIPRuleDetails(rule acl_api.ACLRule) (*acl.ACL_Rule, error) { - // Resolve rule actions - aclAction, err := h.resolveRuleAction(rule.IsPermit) - if err != nil { - return nil, err - } - - return &acl.ACL_Rule{ - Action: aclAction, - IpRule: h.getIPRuleMatches(rule), - }, nil -} - -// getIPACLDetails gets details for a given IP ACL from VPP and translates -// them from the binary VPP API format into the ACL Plugin's NB format. -func (h *ACLVppHandler) getIPACLDetails(idx uint32) (aclRule *acl.ACL, err error) { - req := &acl_api.ACLDump{ - ACLIndex: uint32(idx), - } - - reply := &acl_api.ACLDetails{} - if err := h.dumpChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return nil, err - } - - var ruleData []*acl.ACL_Rule - for _, r := range reply.R { - rule := &acl.ACL_Rule{} - - ipRule, err := h.getIPRuleDetails(r) - if err != nil { - return nil, err - } - - aclAction, err := h.resolveRuleAction(r.IsPermit) - if err != nil { - return nil, err - } - - rule.IpRule = ipRule.GetIpRule() - rule.Action = aclAction - ruleData = append(ruleData, rule) - } - - return &acl.ACL{Rules: ruleData, Name: string(bytes.SplitN(reply.Tag, []byte{0x00}, 2)[0])}, nil -} - -func (h *ACLVppHandler) getMACIPRuleDetails(rule acl_api.MacipACLRule) (*acl.ACL_Rule, error) { - // Resolve rule actions - aclAction, err := h.resolveRuleAction(rule.IsPermit) - if err != nil { - return nil, err - } - - return &acl.ACL_Rule{ - Action: aclAction, - MacipRule: h.getMACIPRuleMatches(rule), - }, nil -} - -// getMACIPACLDetails gets details for a given MACIP ACL from VPP and translates -// them from the binary VPP API format into the ACL Plugin's NB format. -func (h *ACLVppHandler) getMACIPACLDetails(idx uint32) (aclRule *acl.ACL, err error) { - req := &acl_api.MacipACLDump{ - ACLIndex: uint32(idx), - } - - reply := &acl_api.MacipACLDetails{} - if err := h.dumpChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return nil, err - } - - var ruleData []*acl.ACL_Rule - for _, r := range reply.R { - rule := &acl.ACL_Rule{} - - ipRule, err := h.getMACIPRuleDetails(r) - if err != nil { - return nil, err - } - - aclAction, err := h.resolveRuleAction(r.IsPermit) - if err != nil { - return nil, err - } - - rule.IpRule = ipRule.GetIpRule() - rule.Action = aclAction - ruleData = append(ruleData, rule) - } - - return &acl.ACL{Rules: ruleData, Name: string(bytes.SplitN(reply.Tag, []byte{0x00}, 2)[0])}, nil -} - -// getIPRuleMatches translates an IP rule from the binary VPP API format into the -// ACL Plugin's NB format -func (h *ACLVppHandler) getIPRuleMatches(r acl_api.ACLRule) *acl.ACL_Rule_IpRule { - var srcIP, dstIP string - if r.IsIPv6 == 1 { - srcIP = net.IP(r.SrcIPAddr).To16().String() - dstIP = net.IP(r.DstIPAddr).To16().String() - } else { - srcIP = net.IP(r.SrcIPAddr[:4]).To4().String() - dstIP = net.IP(r.DstIPAddr[:4]).To4().String() - } - - ipRule := &acl.ACL_Rule_IpRule{ - Ip: &acl.ACL_Rule_IpRule_Ip{ - SourceNetwork: fmt.Sprintf("%s/%d", srcIP, r.SrcIPPrefixLen), - DestinationNetwork: fmt.Sprintf("%s/%d", dstIP, r.DstIPPrefixLen), - }, - } - - switch r.Proto { - case vppcalls.TCPProto: - ipRule.Tcp = h.getTCPMatchRule(r) - case vppcalls.UDPProto: - ipRule.Udp = h.getUDPMatchRule(r) - case vppcalls.ICMPv4Proto, vppcalls.ICMPv6Proto: - ipRule.Icmp = h.getIcmpMatchRule(r) - } - return ipRule -} - -// getMACIPRuleMatches translates an MACIP rule from the binary VPP API format into the -// ACL Plugin's NB format -func (h *ACLVppHandler) getMACIPRuleMatches(rule acl_api.MacipACLRule) *acl.ACL_Rule_MacIpRule { - var srcAddr string - if rule.IsIPv6 == 1 { - srcAddr = net.IP(rule.SrcIPAddr).To16().String() - } else { - srcAddr = net.IP(rule.SrcIPAddr[:4]).To4().String() - } - srcMacAddr := net.HardwareAddr(rule.SrcMac) - srcMacAddrMask := net.HardwareAddr(rule.SrcMacMask) - return &acl.ACL_Rule_MacIpRule{ - SourceAddress: srcAddr, - SourceAddressPrefix: uint32(rule.SrcIPPrefixLen), - SourceMacAddress: srcMacAddr.String(), - SourceMacAddressMask: srcMacAddrMask.String(), - } -} - -// getTCPMatchRule translates a TCP match rule from the binary VPP API format -// into the ACL Plugin's NB format -func (h *ACLVppHandler) getTCPMatchRule(r acl_api.ACLRule) *acl.ACL_Rule_IpRule_Tcp { - dstPortRange := &acl.ACL_Rule_IpRule_PortRange{ - LowerPort: uint32(r.DstportOrIcmpcodeFirst), - UpperPort: uint32(r.DstportOrIcmpcodeLast), - } - srcPortRange := &acl.ACL_Rule_IpRule_PortRange{ - LowerPort: uint32(r.SrcportOrIcmptypeFirst), - UpperPort: uint32(r.SrcportOrIcmptypeLast), - } - tcp := acl.ACL_Rule_IpRule_Tcp{ - DestinationPortRange: dstPortRange, - SourcePortRange: srcPortRange, - TcpFlagsMask: uint32(r.TCPFlagsMask), - TcpFlagsValue: uint32(r.TCPFlagsValue), - } - return &tcp -} - -// getUDPMatchRule translates a UDP match rule from the binary VPP API format -// into the ACL Plugin's NB format -func (h *ACLVppHandler) getUDPMatchRule(r acl_api.ACLRule) *acl.ACL_Rule_IpRule_Udp { - dstPortRange := &acl.ACL_Rule_IpRule_PortRange{ - LowerPort: uint32(r.DstportOrIcmpcodeFirst), - UpperPort: uint32(r.DstportOrIcmpcodeLast), - } - srcPortRange := &acl.ACL_Rule_IpRule_PortRange{ - LowerPort: uint32(r.SrcportOrIcmptypeFirst), - UpperPort: uint32(r.SrcportOrIcmptypeLast), - } - udp := acl.ACL_Rule_IpRule_Udp{ - DestinationPortRange: dstPortRange, - SourcePortRange: srcPortRange, - } - return &udp -} - -// getIcmpMatchRule translates an ICMP match rule from the binary VPP API -// format into the ACL Plugin's NB format -func (h *ACLVppHandler) getIcmpMatchRule(r acl_api.ACLRule) *acl.ACL_Rule_IpRule_Icmp { - icmp := &acl.ACL_Rule_IpRule_Icmp{ - Icmpv6: r.IsIPv6 > 0, - IcmpCodeRange: &acl.ACL_Rule_IpRule_Icmp_Range{}, - IcmpTypeRange: &acl.ACL_Rule_IpRule_Icmp_Range{}, - } - return icmp -} - -// Returns rule action representation in model according to the vpp input -func (h *ACLVppHandler) resolveRuleAction(isPermit uint8) (acl.ACL_Rule_Action, error) { - switch isPermit { - case 0: - return acl.ACL_Rule_DENY, nil - case 1: - return acl.ACL_Rule_PERMIT, nil - case 2: - return acl.ACL_Rule_REFLECT, nil - default: - return acl.ACL_Rule_DENY, fmt.Errorf("invalid match rule %d", isPermit) - } -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1810/interfaces_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1810/interfaces_vppcalls.go deleted file mode 100644 index 07423b26e0..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1810/interfaces_vppcalls.go +++ /dev/null @@ -1,338 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "fmt" - - acl_api "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/acl" -) - -// SetACLToInterfacesAsIngress implements ACL handler. -func (h *ACLVppHandler) SetACLToInterfacesAsIngress(ACLIndex uint32, ifIndices []uint32) error { - return h.requestSetACLToInterfaces(&aclInterfaceLogicalReq{ - aclIndex: ACLIndex, - ifIndices: ifIndices, - ingress: true, - }) -} - -// RemoveACLFromInterfacesAsIngress implements ACL handler. -func (h *ACLVppHandler) RemoveACLFromInterfacesAsIngress(ACLIndex uint32, ifIndices []uint32) error { - return h.requestRemoveInterfacesFromACL(&aclInterfaceLogicalReq{ - aclIndex: ACLIndex, - ifIndices: ifIndices, - ingress: true, - }) -} - -// SetACLToInterfacesAsEgress implements ACL handler. -func (h *ACLVppHandler) SetACLToInterfacesAsEgress(ACLIndex uint32, ifIndices []uint32) error { - return h.requestSetACLToInterfaces(&aclInterfaceLogicalReq{ - aclIndex: ACLIndex, - ifIndices: ifIndices, - ingress: false, - }) -} - -// RemoveACLFromInterfacesAsEgress implements ACL handler. -func (h *ACLVppHandler) RemoveACLFromInterfacesAsEgress(ACLIndex uint32, ifIndices []uint32) error { - return h.requestRemoveInterfacesFromACL(&aclInterfaceLogicalReq{ - aclIndex: ACLIndex, - ifIndices: ifIndices, - ingress: false, - }) -} - -// AddACLToInterfaceAsIngress implements ACL handler. -func (h *ACLVppHandler) AddACLToInterfaceAsIngress(aclIndex uint32, ifName string) error { - meta, ok := h.ifIndexes.LookupByName(ifName) - if !ok { - return fmt.Errorf("metadata for interface %s not found", ifName) - } - ifIdx := meta.SwIfIndex - - req := &acl_api.ACLInterfaceAddDel{ - ACLIndex: aclIndex, - IsAdd: 1, - SwIfIndex: ifIdx, - IsInput: 1, - } - reply := &acl_api.ACLInterfaceAddDelReply{} - - err := h.callsChannel.SendRequest(req).ReceiveReply(reply) - if err != nil { - return fmt.Errorf("failed to add interface %d to ACL (L3/L4) %d as ingress: %v", ifIdx, aclIndex, err) - } - - return nil -} - -// AddACLToInterfaceAsEgress implements ACL handler. -func (h *ACLVppHandler) AddACLToInterfaceAsEgress(aclIndex uint32, ifName string) error { - meta, ok := h.ifIndexes.LookupByName(ifName) - if !ok { - return fmt.Errorf("metadata for interface %s not found", ifName) - } - ifIdx := meta.SwIfIndex - - req := &acl_api.ACLInterfaceAddDel{ - ACLIndex: aclIndex, - IsAdd: 1, - SwIfIndex: ifIdx, - IsInput: 0, - } - reply := &acl_api.ACLInterfaceAddDelReply{} - - err := h.callsChannel.SendRequest(req).ReceiveReply(reply) - if err != nil { - return fmt.Errorf("failed to add interface %d to ACL (L3/L4) %d as egress: %v", ifIdx, aclIndex, err) - } - - return nil -} - -// DeleteACLFromInterfaceAsIngress implements ACL handler. -func (h *ACLVppHandler) DeleteACLFromInterfaceAsIngress(aclIndex uint32, ifName string) error { - meta, ok := h.ifIndexes.LookupByName(ifName) - if !ok { - return fmt.Errorf("metadata for interface %s not found", ifName) - } - ifIdx := meta.SwIfIndex - - req := &acl_api.ACLInterfaceAddDel{ - ACLIndex: aclIndex, - IsAdd: 0, - SwIfIndex: ifIdx, - IsInput: 1, - } - reply := &acl_api.ACLInterfaceAddDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return fmt.Errorf("failed to delete interface %d from ACL (L3/L4) %d as ingress: %v", ifIdx, aclIndex, err) - } - - return nil -} - -// DeleteACLFromInterfaceAsEgress implements ACL handler. -func (h *ACLVppHandler) DeleteACLFromInterfaceAsEgress(aclIndex uint32, ifName string) error { - meta, ok := h.ifIndexes.LookupByName(ifName) - if !ok { - return fmt.Errorf("metadata for interface %s not found", ifName) - } - ifIdx := meta.SwIfIndex - - req := &acl_api.ACLInterfaceAddDel{ - ACLIndex: aclIndex, - IsAdd: 0, - SwIfIndex: ifIdx, - IsInput: 0, - } - reply := &acl_api.ACLInterfaceAddDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return fmt.Errorf("failed to delete interface %d from ACL (L3/L4) %d as egress: %v", ifIdx, aclIndex, err) - } - - return nil -} - -// AddMACIPACLToInterface implements ACL handler. -func (h *ACLVppHandler) AddMACIPACLToInterface(aclIndex uint32, ifName string) error { - meta, ok := h.ifIndexes.LookupByName(ifName) - if !ok { - return fmt.Errorf("metadata for interface %s not found", ifName) - } - ifIdx := meta.SwIfIndex - - req := &acl_api.MacipACLInterfaceAddDel{ - ACLIndex: aclIndex, - IsAdd: 1, - SwIfIndex: ifIdx, - } - reply := &acl_api.MacipACLInterfaceAddDelReply{} - - err := h.callsChannel.SendRequest(req).ReceiveReply(reply) - if err != nil { - return fmt.Errorf("failed to add interface %d to MACIP ACL (L2) %d: %v", ifIdx, aclIndex, err) - } - - return nil -} - -// DeleteMACIPACLFromInterface implements ACL handler. -func (h *ACLVppHandler) DeleteMACIPACLFromInterface(aclIndex uint32, ifName string) error { - meta, ok := h.ifIndexes.LookupByName(ifName) - if !ok { - return fmt.Errorf("metadata for interface %s not found", ifName) - } - ifIdx := meta.SwIfIndex - - req := &acl_api.MacipACLInterfaceAddDel{ - ACLIndex: aclIndex, - IsAdd: 0, - SwIfIndex: ifIdx, - } - reply := &acl_api.MacipACLInterfaceAddDelReply{} - - err := h.callsChannel.SendRequest(req).ReceiveReply(reply) - if err != nil { - return fmt.Errorf("failed to delete interface %d from MACIP ACL (L2) %d: %v", ifIdx, aclIndex, err) - } - - return nil -} - -// SetMACIPACLToInterfaces implements ACL handler. -func (h *ACLVppHandler) SetMACIPACLToInterfaces(aclIndex uint32, ifIndices []uint32) error { - for _, ingressIfIdx := range ifIndices { - req := &acl_api.MacipACLInterfaceAddDel{ - ACLIndex: aclIndex, - IsAdd: 1, - SwIfIndex: ingressIfIdx, - } - reply := &acl_api.MacipACLInterfaceAddDelReply{} - - err := h.callsChannel.SendRequest(req).ReceiveReply(reply) - if err != nil { - return fmt.Errorf("failed to set interface %d to L2 ACL %d: %v", ingressIfIdx, aclIndex, err) - } - } - - return nil -} - -// RemoveMACIPACLFromInterfaces implements ACL handler. -func (h *ACLVppHandler) RemoveMACIPACLFromInterfaces(removedACLIndex uint32, ifIndices []uint32) error { - for _, ifIdx := range ifIndices { - req := &acl_api.MacipACLInterfaceAddDel{ - ACLIndex: removedACLIndex, - SwIfIndex: ifIdx, - IsAdd: 0, - } - reply := &acl_api.MacipACLInterfaceAddDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return fmt.Errorf("failed to remove L2 ACL %d from interface %d: %v", removedACLIndex, ifIdx, err) - } - } - return nil -} - -// aclInterfaceLogicalReq groups multiple fields to not enumerate all of them in one function call -type aclInterfaceLogicalReq struct { - aclIndex uint32 - ifIndices []uint32 - ingress bool -} - -func (h *ACLVppHandler) requestSetACLToInterfaces(logicalReq *aclInterfaceLogicalReq) error { - for _, aclIfIdx := range logicalReq.ifIndices { - // Create acl list with new entry - var ACLs []uint32 - - // All previously assigned ACLs have to be dumped and added to acl list - aclInterfaceDetails, err := h.DumpInterfaceACLList(aclIfIdx) - if err != nil { - return err - } - - var nInput uint8 - if aclInterfaceDetails != nil { - nInput = aclInterfaceDetails.NInput - if logicalReq.ingress { - // Construct ACL list. ACLs within NInput are defined as ingress, so provided new aclIndex has to be - // added to the beginning of the list - // TODO it would be nicer to add new acl index to newNInput index - ACLs = append(ACLs, logicalReq.aclIndex) - for _, aclIndex := range aclInterfaceDetails.Acls { - ACLs = append(ACLs, aclIndex) - } - nInput++ // Rise NInput - } else { - // Construct ACL list. ACLs outside of NInput are defined as egress, so provided new aclIndex has to be - // added to the end of the list - for _, aclIndex := range aclInterfaceDetails.Acls { - ACLs = append(ACLs, aclIndex) - } - ACLs = append(ACLs, logicalReq.aclIndex) - // NInput remains the same - } - } - - msg := &acl_api.ACLInterfaceSetACLList{ - Acls: ACLs, - Count: uint8(len(ACLs)), - SwIfIndex: aclIfIdx, - NInput: nInput, - } - reply := &acl_api.ACLInterfaceSetACLListReply{} - - err = h.callsChannel.SendRequest(msg).ReceiveReply(reply) - if err != nil { - return err - } - } - - return nil -} - -func (h *ACLVppHandler) requestRemoveInterfacesFromACL(logicalReq *aclInterfaceLogicalReq) error { - var wasErr error - for _, aclIfIdx := range logicalReq.ifIndices { - // Create empty ACL list - var ACLs []uint32 - - // All assigned ACLs have to be dumped - aclInterfaceDetails, err := h.DumpInterfaceACLList(aclIfIdx) - if err != nil { - return err - } - - // Reconstruct ACL list without removed ACL - var nInput uint8 - if aclInterfaceDetails != nil { - nInput = aclInterfaceDetails.NInput - for idx, aclIndex := range aclInterfaceDetails.Acls { - if (aclIndex != logicalReq.aclIndex) || - (logicalReq.ingress && idx >= int(aclInterfaceDetails.NInput)) || - (!logicalReq.ingress && idx < int(aclInterfaceDetails.NInput)) { - ACLs = append(ACLs, aclIndex) - } else { - // Decrease NInput if ingress, otherwise keep it the same - if logicalReq.ingress { - nInput-- - } - } - } - } - - msg := &acl_api.ACLInterfaceSetACLList{ - Acls: ACLs, - Count: uint8(len(ACLs)), - SwIfIndex: aclIfIdx, - NInput: nInput, - } - - reply := &acl_api.ACLInterfaceSetACLListReply{} - err = h.callsChannel.SendRequest(msg).ReceiveReply(reply) - if err != nil { - wasErr = err - } - } - - return wasErr -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1810/vppcalls_handlers.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1810/vppcalls_handlers.go deleted file mode 100644 index b2415ab258..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls/vpp1810/vppcalls_handlers.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - govppapi "git.fd.io/govpp.git/api" - - "github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/acl" - "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifaceidx" -) - -func init() { - var msgs []govppapi.Message - msgs = append(msgs, acl.Messages...) - - vppcalls.Versions["vpp1810"] = vppcalls.HandlerVersion{ - Msgs: msgs, - New: func(ch govppapi.Channel, ifIndexes ifaceidx.IfaceMetadataIndex) vppcalls.ACLVppAPI { - return &ACLVppHandler{ - callsChannel: ch, - dumpChannel: ch, - ifIndexes: ifIndexes, - } - }, - } -} - -// ACLVppHandler is accessor for acl-related vppcalls methods -type ACLVppHandler struct { - callsChannel govppapi.Channel - dumpChannel govppapi.Channel - ifIndexes ifaceidx.IfaceMetadataIndex -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/default b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/default deleted file mode 120000 index da7e95ff77..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/default +++ /dev/null @@ -1 +0,0 @@ -vpp1904 \ No newline at end of file diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/acl/acl.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/acl/acl.ba.go deleted file mode 100644 index 994a34d061..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/acl/acl.ba.go +++ /dev/null @@ -1,705 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/acl.api.json - -/* - Package acl is a generated from VPP binary API module 'acl'. - - It contains following objects: - 17 services - 2 types - 34 messages -*/ -package acl - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpACL(*ACLDump) ([]*ACLDetails, error) - DumpACLInterfaceEtypeWhitelist(*ACLInterfaceEtypeWhitelistDump) ([]*ACLInterfaceEtypeWhitelistDetails, error) - DumpACLInterfaceList(*ACLInterfaceListDump) ([]*ACLInterfaceListDetails, error) - DumpMacipACL(*MacipACLDump) ([]*MacipACLDetails, error) - DumpMacipACLInterfaceList(*MacipACLInterfaceListDump) ([]*MacipACLInterfaceListDetails, error) - ACLAddReplace(*ACLAddReplace) (*ACLAddReplaceReply, error) - ACLDel(*ACLDel) (*ACLDelReply, error) - ACLInterfaceAddDel(*ACLInterfaceAddDel) (*ACLInterfaceAddDelReply, error) - ACLInterfaceSetACLList(*ACLInterfaceSetACLList) (*ACLInterfaceSetACLListReply, error) - ACLInterfaceSetEtypeWhitelist(*ACLInterfaceSetEtypeWhitelist) (*ACLInterfaceSetEtypeWhitelistReply, error) - ACLPluginControlPing(*ACLPluginControlPing) (*ACLPluginControlPingReply, error) - ACLPluginGetVersion(*ACLPluginGetVersion) (*ACLPluginGetVersionReply, error) - MacipACLAdd(*MacipACLAdd) (*MacipACLAddReply, error) - MacipACLAddReplace(*MacipACLAddReplace) (*MacipACLAddReplaceReply, error) - MacipACLDel(*MacipACLDel) (*MacipACLDelReply, error) - MacipACLInterfaceAddDel(*MacipACLInterfaceAddDel) (*MacipACLInterfaceAddDelReply, error) - MacipACLInterfaceGet(*MacipACLInterfaceGet) (*MacipACLInterfaceGetReply, error) -} - -/* Types */ - -// ACLRule represents VPP binary API type 'acl_rule': -type ACLRule struct { - IsPermit uint8 - IsIPv6 uint8 - SrcIPAddr []byte `struc:"[16]byte"` - SrcIPPrefixLen uint8 - DstIPAddr []byte `struc:"[16]byte"` - DstIPPrefixLen uint8 - Proto uint8 - SrcportOrIcmptypeFirst uint16 - SrcportOrIcmptypeLast uint16 - DstportOrIcmpcodeFirst uint16 - DstportOrIcmpcodeLast uint16 - TCPFlagsMask uint8 - TCPFlagsValue uint8 -} - -func (*ACLRule) GetTypeName() string { - return "acl_rule" -} -func (*ACLRule) GetCrcString() string { - return "6f99bf4d" -} - -// MacipACLRule represents VPP binary API type 'macip_acl_rule': -type MacipACLRule struct { - IsPermit uint8 - IsIPv6 uint8 - SrcMac []byte `struc:"[6]byte"` - SrcMacMask []byte `struc:"[6]byte"` - SrcIPAddr []byte `struc:"[16]byte"` - SrcIPPrefixLen uint8 -} - -func (*MacipACLRule) GetTypeName() string { - return "macip_acl_rule" -} -func (*MacipACLRule) GetCrcString() string { - return "70589f1e" -} - -/* Messages */ - -// ACLAddReplace represents VPP binary API message 'acl_add_replace': -type ACLAddReplace struct { - ACLIndex uint32 - Tag []byte `struc:"[64]byte"` - Count uint32 `struc:"sizeof=R"` - R []ACLRule -} - -func (*ACLAddReplace) GetMessageName() string { - return "acl_add_replace" -} -func (*ACLAddReplace) GetCrcString() string { - return "e839997e" -} -func (*ACLAddReplace) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ACLAddReplaceReply represents VPP binary API message 'acl_add_replace_reply': -type ACLAddReplaceReply struct { - ACLIndex uint32 - Retval int32 -} - -func (*ACLAddReplaceReply) GetMessageName() string { - return "acl_add_replace_reply" -} -func (*ACLAddReplaceReply) GetCrcString() string { - return "ac407b0c" -} -func (*ACLAddReplaceReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ACLDel represents VPP binary API message 'acl_del': -type ACLDel struct { - ACLIndex uint32 -} - -func (*ACLDel) GetMessageName() string { - return "acl_del" -} -func (*ACLDel) GetCrcString() string { - return "ef34fea4" -} -func (*ACLDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ACLDelReply represents VPP binary API message 'acl_del_reply': -type ACLDelReply struct { - Retval int32 -} - -func (*ACLDelReply) GetMessageName() string { - return "acl_del_reply" -} -func (*ACLDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*ACLDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ACLDetails represents VPP binary API message 'acl_details': -type ACLDetails struct { - ACLIndex uint32 - Tag []byte `struc:"[64]byte"` - Count uint32 `struc:"sizeof=R"` - R []ACLRule -} - -func (*ACLDetails) GetMessageName() string { - return "acl_details" -} -func (*ACLDetails) GetCrcString() string { - return "5bd895be" -} -func (*ACLDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ACLDump represents VPP binary API message 'acl_dump': -type ACLDump struct { - ACLIndex uint32 -} - -func (*ACLDump) GetMessageName() string { - return "acl_dump" -} -func (*ACLDump) GetCrcString() string { - return "ef34fea4" -} -func (*ACLDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ACLInterfaceAddDel represents VPP binary API message 'acl_interface_add_del': -type ACLInterfaceAddDel struct { - IsAdd uint8 - IsInput uint8 - SwIfIndex uint32 - ACLIndex uint32 -} - -func (*ACLInterfaceAddDel) GetMessageName() string { - return "acl_interface_add_del" -} -func (*ACLInterfaceAddDel) GetCrcString() string { - return "0b2aedd1" -} -func (*ACLInterfaceAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ACLInterfaceAddDelReply represents VPP binary API message 'acl_interface_add_del_reply': -type ACLInterfaceAddDelReply struct { - Retval int32 -} - -func (*ACLInterfaceAddDelReply) GetMessageName() string { - return "acl_interface_add_del_reply" -} -func (*ACLInterfaceAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*ACLInterfaceAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ACLInterfaceEtypeWhitelistDetails represents VPP binary API message 'acl_interface_etype_whitelist_details': -type ACLInterfaceEtypeWhitelistDetails struct { - SwIfIndex uint32 - Count uint8 `struc:"sizeof=Whitelist"` - NInput uint8 - Whitelist []uint16 -} - -func (*ACLInterfaceEtypeWhitelistDetails) GetMessageName() string { - return "acl_interface_etype_whitelist_details" -} -func (*ACLInterfaceEtypeWhitelistDetails) GetCrcString() string { - return "6a5d4e81" -} -func (*ACLInterfaceEtypeWhitelistDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ACLInterfaceEtypeWhitelistDump represents VPP binary API message 'acl_interface_etype_whitelist_dump': -type ACLInterfaceEtypeWhitelistDump struct { - SwIfIndex uint32 -} - -func (*ACLInterfaceEtypeWhitelistDump) GetMessageName() string { - return "acl_interface_etype_whitelist_dump" -} -func (*ACLInterfaceEtypeWhitelistDump) GetCrcString() string { - return "529cb13f" -} -func (*ACLInterfaceEtypeWhitelistDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ACLInterfaceListDetails represents VPP binary API message 'acl_interface_list_details': -type ACLInterfaceListDetails struct { - SwIfIndex uint32 - Count uint8 `struc:"sizeof=Acls"` - NInput uint8 - Acls []uint32 -} - -func (*ACLInterfaceListDetails) GetMessageName() string { - return "acl_interface_list_details" -} -func (*ACLInterfaceListDetails) GetCrcString() string { - return "d5e80809" -} -func (*ACLInterfaceListDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ACLInterfaceListDump represents VPP binary API message 'acl_interface_list_dump': -type ACLInterfaceListDump struct { - SwIfIndex uint32 -} - -func (*ACLInterfaceListDump) GetMessageName() string { - return "acl_interface_list_dump" -} -func (*ACLInterfaceListDump) GetCrcString() string { - return "529cb13f" -} -func (*ACLInterfaceListDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ACLInterfaceSetACLList represents VPP binary API message 'acl_interface_set_acl_list': -type ACLInterfaceSetACLList struct { - SwIfIndex uint32 - Count uint8 `struc:"sizeof=Acls"` - NInput uint8 - Acls []uint32 -} - -func (*ACLInterfaceSetACLList) GetMessageName() string { - return "acl_interface_set_acl_list" -} -func (*ACLInterfaceSetACLList) GetCrcString() string { - return "8baece38" -} -func (*ACLInterfaceSetACLList) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ACLInterfaceSetACLListReply represents VPP binary API message 'acl_interface_set_acl_list_reply': -type ACLInterfaceSetACLListReply struct { - Retval int32 -} - -func (*ACLInterfaceSetACLListReply) GetMessageName() string { - return "acl_interface_set_acl_list_reply" -} -func (*ACLInterfaceSetACLListReply) GetCrcString() string { - return "e8d4e804" -} -func (*ACLInterfaceSetACLListReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ACLInterfaceSetEtypeWhitelist represents VPP binary API message 'acl_interface_set_etype_whitelist': -type ACLInterfaceSetEtypeWhitelist struct { - SwIfIndex uint32 - Count uint8 `struc:"sizeof=Whitelist"` - NInput uint8 - Whitelist []uint16 -} - -func (*ACLInterfaceSetEtypeWhitelist) GetMessageName() string { - return "acl_interface_set_etype_whitelist" -} -func (*ACLInterfaceSetEtypeWhitelist) GetCrcString() string { - return "f515efc5" -} -func (*ACLInterfaceSetEtypeWhitelist) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ACLInterfaceSetEtypeWhitelistReply represents VPP binary API message 'acl_interface_set_etype_whitelist_reply': -type ACLInterfaceSetEtypeWhitelistReply struct { - Retval int32 -} - -func (*ACLInterfaceSetEtypeWhitelistReply) GetMessageName() string { - return "acl_interface_set_etype_whitelist_reply" -} -func (*ACLInterfaceSetEtypeWhitelistReply) GetCrcString() string { - return "e8d4e804" -} -func (*ACLInterfaceSetEtypeWhitelistReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ACLPluginControlPing represents VPP binary API message 'acl_plugin_control_ping': -type ACLPluginControlPing struct{} - -func (*ACLPluginControlPing) GetMessageName() string { - return "acl_plugin_control_ping" -} -func (*ACLPluginControlPing) GetCrcString() string { - return "51077d14" -} -func (*ACLPluginControlPing) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ACLPluginControlPingReply represents VPP binary API message 'acl_plugin_control_ping_reply': -type ACLPluginControlPingReply struct { - Retval int32 - ClientIndex uint32 - VpePID uint32 -} - -func (*ACLPluginControlPingReply) GetMessageName() string { - return "acl_plugin_control_ping_reply" -} -func (*ACLPluginControlPingReply) GetCrcString() string { - return "f6b0b8ca" -} -func (*ACLPluginControlPingReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ACLPluginGetVersion represents VPP binary API message 'acl_plugin_get_version': -type ACLPluginGetVersion struct{} - -func (*ACLPluginGetVersion) GetMessageName() string { - return "acl_plugin_get_version" -} -func (*ACLPluginGetVersion) GetCrcString() string { - return "51077d14" -} -func (*ACLPluginGetVersion) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ACLPluginGetVersionReply represents VPP binary API message 'acl_plugin_get_version_reply': -type ACLPluginGetVersionReply struct { - Major uint32 - Minor uint32 -} - -func (*ACLPluginGetVersionReply) GetMessageName() string { - return "acl_plugin_get_version_reply" -} -func (*ACLPluginGetVersionReply) GetCrcString() string { - return "9b32cf86" -} -func (*ACLPluginGetVersionReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MacipACLAdd represents VPP binary API message 'macip_acl_add': -type MacipACLAdd struct { - Tag []byte `struc:"[64]byte"` - Count uint32 `struc:"sizeof=R"` - R []MacipACLRule -} - -func (*MacipACLAdd) GetMessageName() string { - return "macip_acl_add" -} -func (*MacipACLAdd) GetCrcString() string { - return "b3d3d65a" -} -func (*MacipACLAdd) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// MacipACLAddReplace represents VPP binary API message 'macip_acl_add_replace': -type MacipACLAddReplace struct { - ACLIndex uint32 - Tag []byte `struc:"[64]byte"` - Count uint32 `struc:"sizeof=R"` - R []MacipACLRule -} - -func (*MacipACLAddReplace) GetMessageName() string { - return "macip_acl_add_replace" -} -func (*MacipACLAddReplace) GetCrcString() string { - return "a0e8c01b" -} -func (*MacipACLAddReplace) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// MacipACLAddReplaceReply represents VPP binary API message 'macip_acl_add_replace_reply': -type MacipACLAddReplaceReply struct { - ACLIndex uint32 - Retval int32 -} - -func (*MacipACLAddReplaceReply) GetMessageName() string { - return "macip_acl_add_replace_reply" -} -func (*MacipACLAddReplaceReply) GetCrcString() string { - return "ac407b0c" -} -func (*MacipACLAddReplaceReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MacipACLAddReply represents VPP binary API message 'macip_acl_add_reply': -type MacipACLAddReply struct { - ACLIndex uint32 - Retval int32 -} - -func (*MacipACLAddReply) GetMessageName() string { - return "macip_acl_add_reply" -} -func (*MacipACLAddReply) GetCrcString() string { - return "ac407b0c" -} -func (*MacipACLAddReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MacipACLDel represents VPP binary API message 'macip_acl_del': -type MacipACLDel struct { - ACLIndex uint32 -} - -func (*MacipACLDel) GetMessageName() string { - return "macip_acl_del" -} -func (*MacipACLDel) GetCrcString() string { - return "ef34fea4" -} -func (*MacipACLDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// MacipACLDelReply represents VPP binary API message 'macip_acl_del_reply': -type MacipACLDelReply struct { - Retval int32 -} - -func (*MacipACLDelReply) GetMessageName() string { - return "macip_acl_del_reply" -} -func (*MacipACLDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*MacipACLDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MacipACLDetails represents VPP binary API message 'macip_acl_details': -type MacipACLDetails struct { - ACLIndex uint32 - Tag []byte `struc:"[64]byte"` - Count uint32 `struc:"sizeof=R"` - R []MacipACLRule -} - -func (*MacipACLDetails) GetMessageName() string { - return "macip_acl_details" -} -func (*MacipACLDetails) GetCrcString() string { - return "dd2b55ba" -} -func (*MacipACLDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MacipACLDump represents VPP binary API message 'macip_acl_dump': -type MacipACLDump struct { - ACLIndex uint32 -} - -func (*MacipACLDump) GetMessageName() string { - return "macip_acl_dump" -} -func (*MacipACLDump) GetCrcString() string { - return "ef34fea4" -} -func (*MacipACLDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// MacipACLInterfaceAddDel represents VPP binary API message 'macip_acl_interface_add_del': -type MacipACLInterfaceAddDel struct { - IsAdd uint8 - SwIfIndex uint32 - ACLIndex uint32 -} - -func (*MacipACLInterfaceAddDel) GetMessageName() string { - return "macip_acl_interface_add_del" -} -func (*MacipACLInterfaceAddDel) GetCrcString() string { - return "6a6be97c" -} -func (*MacipACLInterfaceAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// MacipACLInterfaceAddDelReply represents VPP binary API message 'macip_acl_interface_add_del_reply': -type MacipACLInterfaceAddDelReply struct { - Retval int32 -} - -func (*MacipACLInterfaceAddDelReply) GetMessageName() string { - return "macip_acl_interface_add_del_reply" -} -func (*MacipACLInterfaceAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*MacipACLInterfaceAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MacipACLInterfaceGet represents VPP binary API message 'macip_acl_interface_get': -type MacipACLInterfaceGet struct{} - -func (*MacipACLInterfaceGet) GetMessageName() string { - return "macip_acl_interface_get" -} -func (*MacipACLInterfaceGet) GetCrcString() string { - return "51077d14" -} -func (*MacipACLInterfaceGet) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// MacipACLInterfaceGetReply represents VPP binary API message 'macip_acl_interface_get_reply': -type MacipACLInterfaceGetReply struct { - Count uint32 `struc:"sizeof=Acls"` - Acls []uint32 -} - -func (*MacipACLInterfaceGetReply) GetMessageName() string { - return "macip_acl_interface_get_reply" -} -func (*MacipACLInterfaceGetReply) GetCrcString() string { - return "accf9b05" -} -func (*MacipACLInterfaceGetReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MacipACLInterfaceListDetails represents VPP binary API message 'macip_acl_interface_list_details': -type MacipACLInterfaceListDetails struct { - SwIfIndex uint32 - Count uint8 `struc:"sizeof=Acls"` - Acls []uint32 -} - -func (*MacipACLInterfaceListDetails) GetMessageName() string { - return "macip_acl_interface_list_details" -} -func (*MacipACLInterfaceListDetails) GetCrcString() string { - return "29783fa0" -} -func (*MacipACLInterfaceListDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MacipACLInterfaceListDump represents VPP binary API message 'macip_acl_interface_list_dump': -type MacipACLInterfaceListDump struct { - SwIfIndex uint32 -} - -func (*MacipACLInterfaceListDump) GetMessageName() string { - return "macip_acl_interface_list_dump" -} -func (*MacipACLInterfaceListDump) GetCrcString() string { - return "529cb13f" -} -func (*MacipACLInterfaceListDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func init() { - api.RegisterMessage((*ACLAddReplace)(nil), "acl.ACLAddReplace") - api.RegisterMessage((*ACLAddReplaceReply)(nil), "acl.ACLAddReplaceReply") - api.RegisterMessage((*ACLDel)(nil), "acl.ACLDel") - api.RegisterMessage((*ACLDelReply)(nil), "acl.ACLDelReply") - api.RegisterMessage((*ACLDetails)(nil), "acl.ACLDetails") - api.RegisterMessage((*ACLDump)(nil), "acl.ACLDump") - api.RegisterMessage((*ACLInterfaceAddDel)(nil), "acl.ACLInterfaceAddDel") - api.RegisterMessage((*ACLInterfaceAddDelReply)(nil), "acl.ACLInterfaceAddDelReply") - api.RegisterMessage((*ACLInterfaceEtypeWhitelistDetails)(nil), "acl.ACLInterfaceEtypeWhitelistDetails") - api.RegisterMessage((*ACLInterfaceEtypeWhitelistDump)(nil), "acl.ACLInterfaceEtypeWhitelistDump") - api.RegisterMessage((*ACLInterfaceListDetails)(nil), "acl.ACLInterfaceListDetails") - api.RegisterMessage((*ACLInterfaceListDump)(nil), "acl.ACLInterfaceListDump") - api.RegisterMessage((*ACLInterfaceSetACLList)(nil), "acl.ACLInterfaceSetACLList") - api.RegisterMessage((*ACLInterfaceSetACLListReply)(nil), "acl.ACLInterfaceSetACLListReply") - api.RegisterMessage((*ACLInterfaceSetEtypeWhitelist)(nil), "acl.ACLInterfaceSetEtypeWhitelist") - api.RegisterMessage((*ACLInterfaceSetEtypeWhitelistReply)(nil), "acl.ACLInterfaceSetEtypeWhitelistReply") - api.RegisterMessage((*ACLPluginControlPing)(nil), "acl.ACLPluginControlPing") - api.RegisterMessage((*ACLPluginControlPingReply)(nil), "acl.ACLPluginControlPingReply") - api.RegisterMessage((*ACLPluginGetVersion)(nil), "acl.ACLPluginGetVersion") - api.RegisterMessage((*ACLPluginGetVersionReply)(nil), "acl.ACLPluginGetVersionReply") - api.RegisterMessage((*MacipACLAdd)(nil), "acl.MacipACLAdd") - api.RegisterMessage((*MacipACLAddReplace)(nil), "acl.MacipACLAddReplace") - api.RegisterMessage((*MacipACLAddReplaceReply)(nil), "acl.MacipACLAddReplaceReply") - api.RegisterMessage((*MacipACLAddReply)(nil), "acl.MacipACLAddReply") - api.RegisterMessage((*MacipACLDel)(nil), "acl.MacipACLDel") - api.RegisterMessage((*MacipACLDelReply)(nil), "acl.MacipACLDelReply") - api.RegisterMessage((*MacipACLDetails)(nil), "acl.MacipACLDetails") - api.RegisterMessage((*MacipACLDump)(nil), "acl.MacipACLDump") - api.RegisterMessage((*MacipACLInterfaceAddDel)(nil), "acl.MacipACLInterfaceAddDel") - api.RegisterMessage((*MacipACLInterfaceAddDelReply)(nil), "acl.MacipACLInterfaceAddDelReply") - api.RegisterMessage((*MacipACLInterfaceGet)(nil), "acl.MacipACLInterfaceGet") - api.RegisterMessage((*MacipACLInterfaceGetReply)(nil), "acl.MacipACLInterfaceGetReply") - api.RegisterMessage((*MacipACLInterfaceListDetails)(nil), "acl.MacipACLInterfaceListDetails") - api.RegisterMessage((*MacipACLInterfaceListDump)(nil), "acl.MacipACLInterfaceListDump") -} - -var Messages = []api.Message{ - (*ACLAddReplace)(nil), - (*ACLAddReplaceReply)(nil), - (*ACLDel)(nil), - (*ACLDelReply)(nil), - (*ACLDetails)(nil), - (*ACLDump)(nil), - (*ACLInterfaceAddDel)(nil), - (*ACLInterfaceAddDelReply)(nil), - (*ACLInterfaceEtypeWhitelistDetails)(nil), - (*ACLInterfaceEtypeWhitelistDump)(nil), - (*ACLInterfaceListDetails)(nil), - (*ACLInterfaceListDump)(nil), - (*ACLInterfaceSetACLList)(nil), - (*ACLInterfaceSetACLListReply)(nil), - (*ACLInterfaceSetEtypeWhitelist)(nil), - (*ACLInterfaceSetEtypeWhitelistReply)(nil), - (*ACLPluginControlPing)(nil), - (*ACLPluginControlPingReply)(nil), - (*ACLPluginGetVersion)(nil), - (*ACLPluginGetVersionReply)(nil), - (*MacipACLAdd)(nil), - (*MacipACLAddReplace)(nil), - (*MacipACLAddReplaceReply)(nil), - (*MacipACLAddReply)(nil), - (*MacipACLDel)(nil), - (*MacipACLDelReply)(nil), - (*MacipACLDetails)(nil), - (*MacipACLDump)(nil), - (*MacipACLInterfaceAddDel)(nil), - (*MacipACLInterfaceAddDelReply)(nil), - (*MacipACLInterfaceGet)(nil), - (*MacipACLInterfaceGetReply)(nil), - (*MacipACLInterfaceListDetails)(nil), - (*MacipACLInterfaceListDump)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/af_packet/af_packet.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/af_packet/af_packet.ba.go deleted file mode 100644 index 770cd04a8d..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/af_packet/af_packet.ba.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/af_packet.api.json - -/* - Package af_packet is a generated from VPP binary API module 'af_packet'. - - It contains following objects: - 4 services - 8 messages -*/ -package af_packet - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpAfPacket(*AfPacketDump) ([]*AfPacketDetails, error) - AfPacketCreate(*AfPacketCreate) (*AfPacketCreateReply, error) - AfPacketDelete(*AfPacketDelete) (*AfPacketDeleteReply, error) - AfPacketSetL4CksumOffload(*AfPacketSetL4CksumOffload) (*AfPacketSetL4CksumOffloadReply, error) -} - -/* Messages */ - -// AfPacketCreate represents VPP binary API message 'af_packet_create': -type AfPacketCreate struct { - HostIfName []byte `struc:"[64]byte"` - HwAddr []byte `struc:"[6]byte"` - UseRandomHwAddr uint8 -} - -func (*AfPacketCreate) GetMessageName() string { - return "af_packet_create" -} -func (*AfPacketCreate) GetCrcString() string { - return "6d5d30d6" -} -func (*AfPacketCreate) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// AfPacketCreateReply represents VPP binary API message 'af_packet_create_reply': -type AfPacketCreateReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*AfPacketCreateReply) GetMessageName() string { - return "af_packet_create_reply" -} -func (*AfPacketCreateReply) GetCrcString() string { - return "fda5941f" -} -func (*AfPacketCreateReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// AfPacketDelete represents VPP binary API message 'af_packet_delete': -type AfPacketDelete struct { - HostIfName []byte `struc:"[64]byte"` -} - -func (*AfPacketDelete) GetMessageName() string { - return "af_packet_delete" -} -func (*AfPacketDelete) GetCrcString() string { - return "3efceda3" -} -func (*AfPacketDelete) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// AfPacketDeleteReply represents VPP binary API message 'af_packet_delete_reply': -type AfPacketDeleteReply struct { - Retval int32 -} - -func (*AfPacketDeleteReply) GetMessageName() string { - return "af_packet_delete_reply" -} -func (*AfPacketDeleteReply) GetCrcString() string { - return "e8d4e804" -} -func (*AfPacketDeleteReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// AfPacketDetails represents VPP binary API message 'af_packet_details': -type AfPacketDetails struct { - SwIfIndex uint32 - HostIfName []byte `struc:"[64]byte"` -} - -func (*AfPacketDetails) GetMessageName() string { - return "af_packet_details" -} -func (*AfPacketDetails) GetCrcString() string { - return "057205fa" -} -func (*AfPacketDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// AfPacketDump represents VPP binary API message 'af_packet_dump': -type AfPacketDump struct{} - -func (*AfPacketDump) GetMessageName() string { - return "af_packet_dump" -} -func (*AfPacketDump) GetCrcString() string { - return "51077d14" -} -func (*AfPacketDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// AfPacketSetL4CksumOffload represents VPP binary API message 'af_packet_set_l4_cksum_offload': -type AfPacketSetL4CksumOffload struct { - SwIfIndex uint8 - Set uint8 -} - -func (*AfPacketSetL4CksumOffload) GetMessageName() string { - return "af_packet_set_l4_cksum_offload" -} -func (*AfPacketSetL4CksumOffload) GetCrcString() string { - return "86538585" -} -func (*AfPacketSetL4CksumOffload) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// AfPacketSetL4CksumOffloadReply represents VPP binary API message 'af_packet_set_l4_cksum_offload_reply': -type AfPacketSetL4CksumOffloadReply struct { - Retval int32 -} - -func (*AfPacketSetL4CksumOffloadReply) GetMessageName() string { - return "af_packet_set_l4_cksum_offload_reply" -} -func (*AfPacketSetL4CksumOffloadReply) GetCrcString() string { - return "e8d4e804" -} -func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func init() { - api.RegisterMessage((*AfPacketCreate)(nil), "af_packet.AfPacketCreate") - api.RegisterMessage((*AfPacketCreateReply)(nil), "af_packet.AfPacketCreateReply") - api.RegisterMessage((*AfPacketDelete)(nil), "af_packet.AfPacketDelete") - api.RegisterMessage((*AfPacketDeleteReply)(nil), "af_packet.AfPacketDeleteReply") - api.RegisterMessage((*AfPacketDetails)(nil), "af_packet.AfPacketDetails") - api.RegisterMessage((*AfPacketDump)(nil), "af_packet.AfPacketDump") - api.RegisterMessage((*AfPacketSetL4CksumOffload)(nil), "af_packet.AfPacketSetL4CksumOffload") - api.RegisterMessage((*AfPacketSetL4CksumOffloadReply)(nil), "af_packet.AfPacketSetL4CksumOffloadReply") -} - -var Messages = []api.Message{ - (*AfPacketCreate)(nil), - (*AfPacketCreateReply)(nil), - (*AfPacketDelete)(nil), - (*AfPacketDeleteReply)(nil), - (*AfPacketDetails)(nil), - (*AfPacketDump)(nil), - (*AfPacketSetL4CksumOffload)(nil), - (*AfPacketSetL4CksumOffloadReply)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/bond/bond.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/bond/bond.ba.go deleted file mode 100644 index 99a69b7550..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/bond/bond.ba.go +++ /dev/null @@ -1,255 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/bond.api.json - -/* - Package bond is a generated from VPP binary API module 'bond'. - - It contains following objects: - 6 services - 12 messages -*/ -package bond - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpSwInterfaceBond(*SwInterfaceBondDump) ([]*SwInterfaceBondDetails, error) - DumpSwInterfaceSlave(*SwInterfaceSlaveDump) ([]*SwInterfaceSlaveDetails, error) - BondCreate(*BondCreate) (*BondCreateReply, error) - BondDelete(*BondDelete) (*BondDeleteReply, error) - BondDetachSlave(*BondDetachSlave) (*BondDetachSlaveReply, error) - BondEnslave(*BondEnslave) (*BondEnslaveReply, error) -} - -/* Messages */ - -// BondCreate represents VPP binary API message 'bond_create': -type BondCreate struct { - UseCustomMac uint8 - MacAddress []byte `struc:"[6]byte"` - Mode uint8 - Lb uint8 -} - -func (*BondCreate) GetMessageName() string { - return "bond_create" -} -func (*BondCreate) GetCrcString() string { - return "6921214e" -} -func (*BondCreate) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// BondCreateReply represents VPP binary API message 'bond_create_reply': -type BondCreateReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*BondCreateReply) GetMessageName() string { - return "bond_create_reply" -} -func (*BondCreateReply) GetCrcString() string { - return "fda5941f" -} -func (*BondCreateReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// BondDelete represents VPP binary API message 'bond_delete': -type BondDelete struct { - SwIfIndex uint32 -} - -func (*BondDelete) GetMessageName() string { - return "bond_delete" -} -func (*BondDelete) GetCrcString() string { - return "529cb13f" -} -func (*BondDelete) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// BondDeleteReply represents VPP binary API message 'bond_delete_reply': -type BondDeleteReply struct { - Retval int32 -} - -func (*BondDeleteReply) GetMessageName() string { - return "bond_delete_reply" -} -func (*BondDeleteReply) GetCrcString() string { - return "e8d4e804" -} -func (*BondDeleteReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// BondDetachSlave represents VPP binary API message 'bond_detach_slave': -type BondDetachSlave struct { - SwIfIndex uint32 -} - -func (*BondDetachSlave) GetMessageName() string { - return "bond_detach_slave" -} -func (*BondDetachSlave) GetCrcString() string { - return "529cb13f" -} -func (*BondDetachSlave) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// BondDetachSlaveReply represents VPP binary API message 'bond_detach_slave_reply': -type BondDetachSlaveReply struct { - Retval int32 -} - -func (*BondDetachSlaveReply) GetMessageName() string { - return "bond_detach_slave_reply" -} -func (*BondDetachSlaveReply) GetCrcString() string { - return "e8d4e804" -} -func (*BondDetachSlaveReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// BondEnslave represents VPP binary API message 'bond_enslave': -type BondEnslave struct { - SwIfIndex uint32 - BondSwIfIndex uint32 - IsPassive uint8 - IsLongTimeout uint8 -} - -func (*BondEnslave) GetMessageName() string { - return "bond_enslave" -} -func (*BondEnslave) GetCrcString() string { - return "0ded34f6" -} -func (*BondEnslave) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// BondEnslaveReply represents VPP binary API message 'bond_enslave_reply': -type BondEnslaveReply struct { - Retval int32 -} - -func (*BondEnslaveReply) GetMessageName() string { - return "bond_enslave_reply" -} -func (*BondEnslaveReply) GetCrcString() string { - return "e8d4e804" -} -func (*BondEnslaveReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceBondDetails represents VPP binary API message 'sw_interface_bond_details': -type SwInterfaceBondDetails struct { - SwIfIndex uint32 - InterfaceName []byte `struc:"[64]byte"` - Mode uint8 - Lb uint8 - ActiveSlaves uint32 - Slaves uint32 -} - -func (*SwInterfaceBondDetails) GetMessageName() string { - return "sw_interface_bond_details" -} -func (*SwInterfaceBondDetails) GetCrcString() string { - return "aae79478" -} -func (*SwInterfaceBondDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceBondDump represents VPP binary API message 'sw_interface_bond_dump': -type SwInterfaceBondDump struct{} - -func (*SwInterfaceBondDump) GetMessageName() string { - return "sw_interface_bond_dump" -} -func (*SwInterfaceBondDump) GetCrcString() string { - return "51077d14" -} -func (*SwInterfaceBondDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSlaveDetails represents VPP binary API message 'sw_interface_slave_details': -type SwInterfaceSlaveDetails struct { - SwIfIndex uint32 - InterfaceName []byte `struc:"[64]byte"` - IsPassive uint8 - IsLongTimeout uint8 -} - -func (*SwInterfaceSlaveDetails) GetMessageName() string { - return "sw_interface_slave_details" -} -func (*SwInterfaceSlaveDetails) GetCrcString() string { - return "d5c58e45" -} -func (*SwInterfaceSlaveDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceSlaveDump represents VPP binary API message 'sw_interface_slave_dump': -type SwInterfaceSlaveDump struct { - SwIfIndex uint32 -} - -func (*SwInterfaceSlaveDump) GetMessageName() string { - return "sw_interface_slave_dump" -} -func (*SwInterfaceSlaveDump) GetCrcString() string { - return "529cb13f" -} -func (*SwInterfaceSlaveDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func init() { - api.RegisterMessage((*BondCreate)(nil), "bond.BondCreate") - api.RegisterMessage((*BondCreateReply)(nil), "bond.BondCreateReply") - api.RegisterMessage((*BondDelete)(nil), "bond.BondDelete") - api.RegisterMessage((*BondDeleteReply)(nil), "bond.BondDeleteReply") - api.RegisterMessage((*BondDetachSlave)(nil), "bond.BondDetachSlave") - api.RegisterMessage((*BondDetachSlaveReply)(nil), "bond.BondDetachSlaveReply") - api.RegisterMessage((*BondEnslave)(nil), "bond.BondEnslave") - api.RegisterMessage((*BondEnslaveReply)(nil), "bond.BondEnslaveReply") - api.RegisterMessage((*SwInterfaceBondDetails)(nil), "bond.SwInterfaceBondDetails") - api.RegisterMessage((*SwInterfaceBondDump)(nil), "bond.SwInterfaceBondDump") - api.RegisterMessage((*SwInterfaceSlaveDetails)(nil), "bond.SwInterfaceSlaveDetails") - api.RegisterMessage((*SwInterfaceSlaveDump)(nil), "bond.SwInterfaceSlaveDump") -} - -var Messages = []api.Message{ - (*BondCreate)(nil), - (*BondCreateReply)(nil), - (*BondDelete)(nil), - (*BondDeleteReply)(nil), - (*BondDetachSlave)(nil), - (*BondDetachSlaveReply)(nil), - (*BondEnslave)(nil), - (*BondEnslaveReply)(nil), - (*SwInterfaceBondDetails)(nil), - (*SwInterfaceBondDump)(nil), - (*SwInterfaceSlaveDetails)(nil), - (*SwInterfaceSlaveDump)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/dhcp/dhcp.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/dhcp/dhcp.ba.go deleted file mode 100644 index 21af79c903..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/dhcp/dhcp.ba.go +++ /dev/null @@ -1,613 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/dhcp.api.json - -/* - Package dhcp is a generated from VPP binary API module 'dhcp'. - - It contains following objects: - 11 services - 5 types - 25 messages -*/ -package dhcp - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpDHCPClient(*DHCPClientDump) ([]*DHCPClientDetails, error) - DumpDHCPProxy(*DHCPProxyDump) ([]*DHCPProxyDetails, error) - DHCP6ClientsEnableDisable(*DHCP6ClientsEnableDisable) (*DHCP6ClientsEnableDisableReply, error) - DHCP6DuidLlSet(*DHCP6DuidLlSet) (*DHCP6DuidLlSetReply, error) - DHCP6PdSendClientMessage(*DHCP6PdSendClientMessage) (*DHCP6PdSendClientMessageReply, error) - DHCP6SendClientMessage(*DHCP6SendClientMessage) (*DHCP6SendClientMessageReply, error) - DHCPClientConfig(*DHCPClientConfig) (*DHCPClientConfigReply, error) - DHCPProxyConfig(*DHCPProxyConfig) (*DHCPProxyConfigReply, error) - DHCPProxySetVss(*DHCPProxySetVss) (*DHCPProxySetVssReply, error) - WantDHCP6PdReplyEvents(*WantDHCP6PdReplyEvents) (*WantDHCP6PdReplyEventsReply, error) - WantDHCP6ReplyEvents(*WantDHCP6ReplyEvents) (*WantDHCP6ReplyEventsReply, error) -} - -/* Types */ - -// DHCP6AddressInfo represents VPP binary API type 'dhcp6_address_info': -type DHCP6AddressInfo struct { - Address []byte `struc:"[16]byte"` - ValidTime uint32 - PreferredTime uint32 -} - -func (*DHCP6AddressInfo) GetTypeName() string { - return "dhcp6_address_info" -} -func (*DHCP6AddressInfo) GetCrcString() string { - return "f3d501e2" -} - -// DHCP6PdPrefixInfo represents VPP binary API type 'dhcp6_pd_prefix_info': -type DHCP6PdPrefixInfo struct { - Prefix []byte `struc:"[16]byte"` - PrefixLength uint8 - ValidTime uint32 - PreferredTime uint32 -} - -func (*DHCP6PdPrefixInfo) GetTypeName() string { - return "dhcp6_pd_prefix_info" -} -func (*DHCP6PdPrefixInfo) GetCrcString() string { - return "c459690e" -} - -// DHCPClient represents VPP binary API type 'dhcp_client': -type DHCPClient struct { - SwIfIndex uint32 - Hostname []byte `struc:"[64]byte"` - ID []byte `struc:"[64]byte"` - WantDHCPEvent uint8 - SetBroadcastFlag uint8 - PID uint32 -} - -func (*DHCPClient) GetTypeName() string { - return "dhcp_client" -} -func (*DHCPClient) GetCrcString() string { - return "527f7935" -} - -// DHCPLease represents VPP binary API type 'dhcp_lease': -type DHCPLease struct { - SwIfIndex uint32 - State uint8 - Hostname []byte `struc:"[64]byte"` - IsIPv6 uint8 - MaskWidth uint8 - HostAddress []byte `struc:"[16]byte"` - RouterAddress []byte `struc:"[16]byte"` - HostMac []byte `struc:"[6]byte"` -} - -func (*DHCPLease) GetTypeName() string { - return "dhcp_lease" -} -func (*DHCPLease) GetCrcString() string { - return "61090276" -} - -// DHCPServer represents VPP binary API type 'dhcp_server': -type DHCPServer struct { - ServerVrfID uint32 - DHCPServer []byte `struc:"[16]byte"` -} - -func (*DHCPServer) GetTypeName() string { - return "dhcp_server" -} -func (*DHCPServer) GetCrcString() string { - return "f16506c4" -} - -/* Messages */ - -// DHCP6ClientsEnableDisable represents VPP binary API message 'dhcp6_clients_enable_disable': -type DHCP6ClientsEnableDisable struct { - Enable uint8 -} - -func (*DHCP6ClientsEnableDisable) GetMessageName() string { - return "dhcp6_clients_enable_disable" -} -func (*DHCP6ClientsEnableDisable) GetCrcString() string { - return "8050327d" -} -func (*DHCP6ClientsEnableDisable) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DHCP6ClientsEnableDisableReply represents VPP binary API message 'dhcp6_clients_enable_disable_reply': -type DHCP6ClientsEnableDisableReply struct { - Retval int32 -} - -func (*DHCP6ClientsEnableDisableReply) GetMessageName() string { - return "dhcp6_clients_enable_disable_reply" -} -func (*DHCP6ClientsEnableDisableReply) GetCrcString() string { - return "e8d4e804" -} -func (*DHCP6ClientsEnableDisableReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DHCP6DuidLlSet represents VPP binary API message 'dhcp6_duid_ll_set': -type DHCP6DuidLlSet struct { - DuidLl []byte `struc:"[10]byte"` -} - -func (*DHCP6DuidLlSet) GetMessageName() string { - return "dhcp6_duid_ll_set" -} -func (*DHCP6DuidLlSet) GetCrcString() string { - return "0f6ca323" -} -func (*DHCP6DuidLlSet) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DHCP6DuidLlSetReply represents VPP binary API message 'dhcp6_duid_ll_set_reply': -type DHCP6DuidLlSetReply struct { - Retval int32 -} - -func (*DHCP6DuidLlSetReply) GetMessageName() string { - return "dhcp6_duid_ll_set_reply" -} -func (*DHCP6DuidLlSetReply) GetCrcString() string { - return "e8d4e804" -} -func (*DHCP6DuidLlSetReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DHCP6PdReplyEvent represents VPP binary API message 'dhcp6_pd_reply_event': -type DHCP6PdReplyEvent struct { - PID uint32 - SwIfIndex uint32 - ServerIndex uint32 - MsgType uint8 - T1 uint32 - T2 uint32 - InnerStatusCode uint16 - StatusCode uint16 - Preference uint8 - NPrefixes uint32 `struc:"sizeof=Prefixes"` - Prefixes []DHCP6PdPrefixInfo -} - -func (*DHCP6PdReplyEvent) GetMessageName() string { - return "dhcp6_pd_reply_event" -} -func (*DHCP6PdReplyEvent) GetCrcString() string { - return "48e73c36" -} -func (*DHCP6PdReplyEvent) GetMessageType() api.MessageType { - return api.EventMessage -} - -// DHCP6PdSendClientMessage represents VPP binary API message 'dhcp6_pd_send_client_message': -type DHCP6PdSendClientMessage struct { - SwIfIndex uint32 - ServerIndex uint32 - Irt uint32 - Mrt uint32 - Mrc uint32 - Mrd uint32 - Stop uint8 - MsgType uint8 - T1 uint32 - T2 uint32 - NPrefixes uint32 `struc:"sizeof=Prefixes"` - Prefixes []DHCP6PdPrefixInfo -} - -func (*DHCP6PdSendClientMessage) GetMessageName() string { - return "dhcp6_pd_send_client_message" -} -func (*DHCP6PdSendClientMessage) GetCrcString() string { - return "5a063fbc" -} -func (*DHCP6PdSendClientMessage) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DHCP6PdSendClientMessageReply represents VPP binary API message 'dhcp6_pd_send_client_message_reply': -type DHCP6PdSendClientMessageReply struct { - Retval int32 -} - -func (*DHCP6PdSendClientMessageReply) GetMessageName() string { - return "dhcp6_pd_send_client_message_reply" -} -func (*DHCP6PdSendClientMessageReply) GetCrcString() string { - return "e8d4e804" -} -func (*DHCP6PdSendClientMessageReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DHCP6ReplyEvent represents VPP binary API message 'dhcp6_reply_event': -type DHCP6ReplyEvent struct { - PID uint32 - SwIfIndex uint32 - ServerIndex uint32 - MsgType uint8 - T1 uint32 - T2 uint32 - InnerStatusCode uint16 - StatusCode uint16 - Preference uint8 - NAddresses uint32 `struc:"sizeof=Addresses"` - Addresses []DHCP6AddressInfo -} - -func (*DHCP6ReplyEvent) GetMessageName() string { - return "dhcp6_reply_event" -} -func (*DHCP6ReplyEvent) GetCrcString() string { - return "ac4563f9" -} -func (*DHCP6ReplyEvent) GetMessageType() api.MessageType { - return api.EventMessage -} - -// DHCP6SendClientMessage represents VPP binary API message 'dhcp6_send_client_message': -type DHCP6SendClientMessage struct { - SwIfIndex uint32 - ServerIndex uint32 - Irt uint32 - Mrt uint32 - Mrc uint32 - Mrd uint32 - Stop uint8 - MsgType uint8 - T1 uint32 - T2 uint32 - NAddresses uint32 `struc:"sizeof=Addresses"` - Addresses []DHCP6AddressInfo -} - -func (*DHCP6SendClientMessage) GetMessageName() string { - return "dhcp6_send_client_message" -} -func (*DHCP6SendClientMessage) GetCrcString() string { - return "a13ae8c4" -} -func (*DHCP6SendClientMessage) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DHCP6SendClientMessageReply represents VPP binary API message 'dhcp6_send_client_message_reply': -type DHCP6SendClientMessageReply struct { - Retval int32 -} - -func (*DHCP6SendClientMessageReply) GetMessageName() string { - return "dhcp6_send_client_message_reply" -} -func (*DHCP6SendClientMessageReply) GetCrcString() string { - return "e8d4e804" -} -func (*DHCP6SendClientMessageReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DHCPClientConfig represents VPP binary API message 'dhcp_client_config': -type DHCPClientConfig struct { - IsAdd uint8 - Client DHCPClient -} - -func (*DHCPClientConfig) GetMessageName() string { - return "dhcp_client_config" -} -func (*DHCPClientConfig) GetCrcString() string { - return "c32ccdfe" -} -func (*DHCPClientConfig) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DHCPClientConfigReply represents VPP binary API message 'dhcp_client_config_reply': -type DHCPClientConfigReply struct { - Retval int32 -} - -func (*DHCPClientConfigReply) GetMessageName() string { - return "dhcp_client_config_reply" -} -func (*DHCPClientConfigReply) GetCrcString() string { - return "e8d4e804" -} -func (*DHCPClientConfigReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DHCPClientDetails represents VPP binary API message 'dhcp_client_details': -type DHCPClientDetails struct { - Client DHCPClient - Lease DHCPLease -} - -func (*DHCPClientDetails) GetMessageName() string { - return "dhcp_client_details" -} -func (*DHCPClientDetails) GetCrcString() string { - return "7ea3a745" -} -func (*DHCPClientDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DHCPClientDump represents VPP binary API message 'dhcp_client_dump': -type DHCPClientDump struct{} - -func (*DHCPClientDump) GetMessageName() string { - return "dhcp_client_dump" -} -func (*DHCPClientDump) GetCrcString() string { - return "51077d14" -} -func (*DHCPClientDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DHCPComplEvent represents VPP binary API message 'dhcp_compl_event': -type DHCPComplEvent struct { - PID uint32 - Lease DHCPLease -} - -func (*DHCPComplEvent) GetMessageName() string { - return "dhcp_compl_event" -} -func (*DHCPComplEvent) GetCrcString() string { - return "2105c31b" -} -func (*DHCPComplEvent) GetMessageType() api.MessageType { - return api.EventMessage -} - -// DHCPProxyConfig represents VPP binary API message 'dhcp_proxy_config': -type DHCPProxyConfig struct { - RxVrfID uint32 - ServerVrfID uint32 - IsIPv6 uint8 - IsAdd uint8 - DHCPServer []byte `struc:"[16]byte"` - DHCPSrcAddress []byte `struc:"[16]byte"` -} - -func (*DHCPProxyConfig) GetMessageName() string { - return "dhcp_proxy_config" -} -func (*DHCPProxyConfig) GetCrcString() string { - return "6af4b645" -} -func (*DHCPProxyConfig) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DHCPProxyConfigReply represents VPP binary API message 'dhcp_proxy_config_reply': -type DHCPProxyConfigReply struct { - Retval int32 -} - -func (*DHCPProxyConfigReply) GetMessageName() string { - return "dhcp_proxy_config_reply" -} -func (*DHCPProxyConfigReply) GetCrcString() string { - return "e8d4e804" -} -func (*DHCPProxyConfigReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DHCPProxyDetails represents VPP binary API message 'dhcp_proxy_details': -type DHCPProxyDetails struct { - RxVrfID uint32 - VssOui uint32 - VssFibID uint32 - VssType uint8 - VssVPNAsciiID []byte `struc:"[129]byte"` - IsIPv6 uint8 - DHCPSrcAddress []byte `struc:"[16]byte"` - Count uint8 `struc:"sizeof=Servers"` - Servers []DHCPServer -} - -func (*DHCPProxyDetails) GetMessageName() string { - return "dhcp_proxy_details" -} -func (*DHCPProxyDetails) GetCrcString() string { - return "a5f2ad84" -} -func (*DHCPProxyDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DHCPProxyDump represents VPP binary API message 'dhcp_proxy_dump': -type DHCPProxyDump struct { - IsIP6 uint8 -} - -func (*DHCPProxyDump) GetMessageName() string { - return "dhcp_proxy_dump" -} -func (*DHCPProxyDump) GetCrcString() string { - return "6fe91190" -} -func (*DHCPProxyDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DHCPProxySetVss represents VPP binary API message 'dhcp_proxy_set_vss': -type DHCPProxySetVss struct { - TblID uint32 - VssType uint8 - VPNAsciiID []byte `struc:"[129]byte"` - Oui uint32 - VPNIndex uint32 - IsIPv6 uint8 - IsAdd uint8 -} - -func (*DHCPProxySetVss) GetMessageName() string { - return "dhcp_proxy_set_vss" -} -func (*DHCPProxySetVss) GetCrcString() string { - return "606535aa" -} -func (*DHCPProxySetVss) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DHCPProxySetVssReply represents VPP binary API message 'dhcp_proxy_set_vss_reply': -type DHCPProxySetVssReply struct { - Retval int32 -} - -func (*DHCPProxySetVssReply) GetMessageName() string { - return "dhcp_proxy_set_vss_reply" -} -func (*DHCPProxySetVssReply) GetCrcString() string { - return "e8d4e804" -} -func (*DHCPProxySetVssReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// WantDHCP6PdReplyEvents represents VPP binary API message 'want_dhcp6_pd_reply_events': -type WantDHCP6PdReplyEvents struct { - EnableDisable uint8 - PID uint32 -} - -func (*WantDHCP6PdReplyEvents) GetMessageName() string { - return "want_dhcp6_pd_reply_events" -} -func (*WantDHCP6PdReplyEvents) GetCrcString() string { - return "05b454b5" -} -func (*WantDHCP6PdReplyEvents) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// WantDHCP6PdReplyEventsReply represents VPP binary API message 'want_dhcp6_pd_reply_events_reply': -type WantDHCP6PdReplyEventsReply struct { - Retval int32 -} - -func (*WantDHCP6PdReplyEventsReply) GetMessageName() string { - return "want_dhcp6_pd_reply_events_reply" -} -func (*WantDHCP6PdReplyEventsReply) GetCrcString() string { - return "e8d4e804" -} -func (*WantDHCP6PdReplyEventsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// WantDHCP6ReplyEvents represents VPP binary API message 'want_dhcp6_reply_events': -type WantDHCP6ReplyEvents struct { - EnableDisable uint8 - PID uint32 -} - -func (*WantDHCP6ReplyEvents) GetMessageName() string { - return "want_dhcp6_reply_events" -} -func (*WantDHCP6ReplyEvents) GetCrcString() string { - return "05b454b5" -} -func (*WantDHCP6ReplyEvents) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// WantDHCP6ReplyEventsReply represents VPP binary API message 'want_dhcp6_reply_events_reply': -type WantDHCP6ReplyEventsReply struct { - Retval int32 -} - -func (*WantDHCP6ReplyEventsReply) GetMessageName() string { - return "want_dhcp6_reply_events_reply" -} -func (*WantDHCP6ReplyEventsReply) GetCrcString() string { - return "e8d4e804" -} -func (*WantDHCP6ReplyEventsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func init() { - api.RegisterMessage((*DHCP6ClientsEnableDisable)(nil), "dhcp.DHCP6ClientsEnableDisable") - api.RegisterMessage((*DHCP6ClientsEnableDisableReply)(nil), "dhcp.DHCP6ClientsEnableDisableReply") - api.RegisterMessage((*DHCP6DuidLlSet)(nil), "dhcp.DHCP6DuidLlSet") - api.RegisterMessage((*DHCP6DuidLlSetReply)(nil), "dhcp.DHCP6DuidLlSetReply") - api.RegisterMessage((*DHCP6PdReplyEvent)(nil), "dhcp.DHCP6PdReplyEvent") - api.RegisterMessage((*DHCP6PdSendClientMessage)(nil), "dhcp.DHCP6PdSendClientMessage") - api.RegisterMessage((*DHCP6PdSendClientMessageReply)(nil), "dhcp.DHCP6PdSendClientMessageReply") - api.RegisterMessage((*DHCP6ReplyEvent)(nil), "dhcp.DHCP6ReplyEvent") - api.RegisterMessage((*DHCP6SendClientMessage)(nil), "dhcp.DHCP6SendClientMessage") - api.RegisterMessage((*DHCP6SendClientMessageReply)(nil), "dhcp.DHCP6SendClientMessageReply") - api.RegisterMessage((*DHCPClientConfig)(nil), "dhcp.DHCPClientConfig") - api.RegisterMessage((*DHCPClientConfigReply)(nil), "dhcp.DHCPClientConfigReply") - api.RegisterMessage((*DHCPClientDetails)(nil), "dhcp.DHCPClientDetails") - api.RegisterMessage((*DHCPClientDump)(nil), "dhcp.DHCPClientDump") - api.RegisterMessage((*DHCPComplEvent)(nil), "dhcp.DHCPComplEvent") - api.RegisterMessage((*DHCPProxyConfig)(nil), "dhcp.DHCPProxyConfig") - api.RegisterMessage((*DHCPProxyConfigReply)(nil), "dhcp.DHCPProxyConfigReply") - api.RegisterMessage((*DHCPProxyDetails)(nil), "dhcp.DHCPProxyDetails") - api.RegisterMessage((*DHCPProxyDump)(nil), "dhcp.DHCPProxyDump") - api.RegisterMessage((*DHCPProxySetVss)(nil), "dhcp.DHCPProxySetVss") - api.RegisterMessage((*DHCPProxySetVssReply)(nil), "dhcp.DHCPProxySetVssReply") - api.RegisterMessage((*WantDHCP6PdReplyEvents)(nil), "dhcp.WantDHCP6PdReplyEvents") - api.RegisterMessage((*WantDHCP6PdReplyEventsReply)(nil), "dhcp.WantDHCP6PdReplyEventsReply") - api.RegisterMessage((*WantDHCP6ReplyEvents)(nil), "dhcp.WantDHCP6ReplyEvents") - api.RegisterMessage((*WantDHCP6ReplyEventsReply)(nil), "dhcp.WantDHCP6ReplyEventsReply") -} - -var Messages = []api.Message{ - (*DHCP6ClientsEnableDisable)(nil), - (*DHCP6ClientsEnableDisableReply)(nil), - (*DHCP6DuidLlSet)(nil), - (*DHCP6DuidLlSetReply)(nil), - (*DHCP6PdReplyEvent)(nil), - (*DHCP6PdSendClientMessage)(nil), - (*DHCP6PdSendClientMessageReply)(nil), - (*DHCP6ReplyEvent)(nil), - (*DHCP6SendClientMessage)(nil), - (*DHCP6SendClientMessageReply)(nil), - (*DHCPClientConfig)(nil), - (*DHCPClientConfigReply)(nil), - (*DHCPClientDetails)(nil), - (*DHCPClientDump)(nil), - (*DHCPComplEvent)(nil), - (*DHCPProxyConfig)(nil), - (*DHCPProxyConfigReply)(nil), - (*DHCPProxyDetails)(nil), - (*DHCPProxyDump)(nil), - (*DHCPProxySetVss)(nil), - (*DHCPProxySetVssReply)(nil), - (*WantDHCP6PdReplyEvents)(nil), - (*WantDHCP6PdReplyEventsReply)(nil), - (*WantDHCP6ReplyEvents)(nil), - (*WantDHCP6ReplyEventsReply)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces/interfaces.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces/interfaces.ba.go deleted file mode 100644 index 6ea1fa776c..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces/interfaces.ba.go +++ /dev/null @@ -1,1073 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/interface.api.json - -/* - Package interfaces is a generated from VPP binary API module 'interface'. - - It contains following objects: - 25 services - 3 types - 51 messages -*/ -package interfaces - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpSwInterface(*SwInterfaceDump) ([]*SwInterfaceDetails, error) - DumpSwInterfaceRxPlacement(*SwInterfaceRxPlacementDump) ([]*SwInterfaceRxPlacementDetails, error) - CollectDetailedInterfaceStats(*CollectDetailedInterfaceStats) (*CollectDetailedInterfaceStatsReply, error) - CreateLoopback(*CreateLoopback) (*CreateLoopbackReply, error) - CreateLoopbackInstance(*CreateLoopbackInstance) (*CreateLoopbackInstanceReply, error) - CreateSubif(*CreateSubif) (*CreateSubifReply, error) - CreateVlanSubif(*CreateVlanSubif) (*CreateVlanSubifReply, error) - DeleteLoopback(*DeleteLoopback) (*DeleteLoopbackReply, error) - DeleteSubif(*DeleteSubif) (*DeleteSubifReply, error) - HwInterfaceSetMtu(*HwInterfaceSetMtu) (*HwInterfaceSetMtuReply, error) - InterfaceNameRenumber(*InterfaceNameRenumber) (*InterfaceNameRenumberReply, error) - SwInterfaceAddDelAddress(*SwInterfaceAddDelAddress) (*SwInterfaceAddDelAddressReply, error) - SwInterfaceClearStats(*SwInterfaceClearStats) (*SwInterfaceClearStatsReply, error) - SwInterfaceGetMacAddress(*SwInterfaceGetMacAddress) (*SwInterfaceGetMacAddressReply, error) - SwInterfaceGetTable(*SwInterfaceGetTable) (*SwInterfaceGetTableReply, error) - SwInterfaceSetFlags(*SwInterfaceSetFlags) (*SwInterfaceSetFlagsReply, error) - SwInterfaceSetIPDirectedBroadcast(*SwInterfaceSetIPDirectedBroadcast) (*SwInterfaceSetIPDirectedBroadcastReply, error) - SwInterfaceSetMacAddress(*SwInterfaceSetMacAddress) (*SwInterfaceSetMacAddressReply, error) - SwInterfaceSetMtu(*SwInterfaceSetMtu) (*SwInterfaceSetMtuReply, error) - SwInterfaceSetRxMode(*SwInterfaceSetRxMode) (*SwInterfaceSetRxModeReply, error) - SwInterfaceSetRxPlacement(*SwInterfaceSetRxPlacement) (*SwInterfaceSetRxPlacementReply, error) - SwInterfaceSetTable(*SwInterfaceSetTable) (*SwInterfaceSetTableReply, error) - SwInterfaceSetUnnumbered(*SwInterfaceSetUnnumbered) (*SwInterfaceSetUnnumberedReply, error) - SwInterfaceTagAddDel(*SwInterfaceTagAddDel) (*SwInterfaceTagAddDelReply, error) - WantInterfaceEvents(*WantInterfaceEvents) (*WantInterfaceEventsReply, error) -} - -/* Types */ - -// VlibCounter represents VPP binary API type 'vlib_counter': -type VlibCounter struct { - Packets uint64 - Bytes uint64 -} - -func (*VlibCounter) GetTypeName() string { - return "vlib_counter" -} -func (*VlibCounter) GetCrcString() string { - return "ce2325a2" -} - -// VnetCombinedCounter represents VPP binary API type 'vnet_combined_counter': -type VnetCombinedCounter struct { - SwIfIndex uint32 - RxPackets uint64 - RxBytes uint64 - RxUnicastPackets uint64 - RxUnicastBytes uint64 - RxMulticastPackets uint64 - RxMulticastBytes uint64 - RxBroadcastPackets uint64 - RxBroadcastBytes uint64 - TxPackets uint64 - TxBytes uint64 - TxUnicastPackets uint64 - TxUnicastBytes uint64 - TxMulticastPackets uint64 - TxMulticastBytes uint64 - TxBroadcastPackets uint64 - TxBroadcastBytes uint64 -} - -func (*VnetCombinedCounter) GetTypeName() string { - return "vnet_combined_counter" -} -func (*VnetCombinedCounter) GetCrcString() string { - return "20905ca4" -} - -// VnetSimpleCounter represents VPP binary API type 'vnet_simple_counter': -type VnetSimpleCounter struct { - SwIfIndex uint32 - Drop uint64 - Punt uint64 - RxIP4 uint64 - RxIP6 uint64 - RxNoBuffer uint64 - RxMiss uint64 - RxError uint64 - TxError uint64 - RxMpls uint64 -} - -func (*VnetSimpleCounter) GetTypeName() string { - return "vnet_simple_counter" -} -func (*VnetSimpleCounter) GetCrcString() string { - return "8bd65e2d" -} - -/* Messages */ - -// CollectDetailedInterfaceStats represents VPP binary API message 'collect_detailed_interface_stats': -type CollectDetailedInterfaceStats struct { - SwIfIndex uint32 - EnableDisable uint8 -} - -func (*CollectDetailedInterfaceStats) GetMessageName() string { - return "collect_detailed_interface_stats" -} -func (*CollectDetailedInterfaceStats) GetCrcString() string { - return "69d24598" -} -func (*CollectDetailedInterfaceStats) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// CollectDetailedInterfaceStatsReply represents VPP binary API message 'collect_detailed_interface_stats_reply': -type CollectDetailedInterfaceStatsReply struct { - Retval int32 -} - -func (*CollectDetailedInterfaceStatsReply) GetMessageName() string { - return "collect_detailed_interface_stats_reply" -} -func (*CollectDetailedInterfaceStatsReply) GetCrcString() string { - return "e8d4e804" -} -func (*CollectDetailedInterfaceStatsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// CreateLoopback represents VPP binary API message 'create_loopback': -type CreateLoopback struct { - MacAddress []byte `struc:"[6]byte"` -} - -func (*CreateLoopback) GetMessageName() string { - return "create_loopback" -} -func (*CreateLoopback) GetCrcString() string { - return "3b54129c" -} -func (*CreateLoopback) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// CreateLoopbackInstance represents VPP binary API message 'create_loopback_instance': -type CreateLoopbackInstance struct { - MacAddress []byte `struc:"[6]byte"` - IsSpecified uint8 - UserInstance uint32 -} - -func (*CreateLoopbackInstance) GetMessageName() string { - return "create_loopback_instance" -} -func (*CreateLoopbackInstance) GetCrcString() string { - return "7bbd53b6" -} -func (*CreateLoopbackInstance) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// CreateLoopbackInstanceReply represents VPP binary API message 'create_loopback_instance_reply': -type CreateLoopbackInstanceReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*CreateLoopbackInstanceReply) GetMessageName() string { - return "create_loopback_instance_reply" -} -func (*CreateLoopbackInstanceReply) GetCrcString() string { - return "fda5941f" -} -func (*CreateLoopbackInstanceReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// CreateLoopbackReply represents VPP binary API message 'create_loopback_reply': -type CreateLoopbackReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*CreateLoopbackReply) GetMessageName() string { - return "create_loopback_reply" -} -func (*CreateLoopbackReply) GetCrcString() string { - return "fda5941f" -} -func (*CreateLoopbackReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// CreateSubif represents VPP binary API message 'create_subif': -type CreateSubif struct { - SwIfIndex uint32 - SubID uint32 - NoTags uint8 - OneTag uint8 - TwoTags uint8 - Dot1ad uint8 - ExactMatch uint8 - DefaultSub uint8 - OuterVlanIDAny uint8 - InnerVlanIDAny uint8 - OuterVlanID uint16 - InnerVlanID uint16 -} - -func (*CreateSubif) GetMessageName() string { - return "create_subif" -} -func (*CreateSubif) GetCrcString() string { - return "86cfe408" -} -func (*CreateSubif) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// CreateSubifReply represents VPP binary API message 'create_subif_reply': -type CreateSubifReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*CreateSubifReply) GetMessageName() string { - return "create_subif_reply" -} -func (*CreateSubifReply) GetCrcString() string { - return "fda5941f" -} -func (*CreateSubifReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// CreateVlanSubif represents VPP binary API message 'create_vlan_subif': -type CreateVlanSubif struct { - SwIfIndex uint32 - VlanID uint32 -} - -func (*CreateVlanSubif) GetMessageName() string { - return "create_vlan_subif" -} -func (*CreateVlanSubif) GetCrcString() string { - return "70cadeda" -} -func (*CreateVlanSubif) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// CreateVlanSubifReply represents VPP binary API message 'create_vlan_subif_reply': -type CreateVlanSubifReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*CreateVlanSubifReply) GetMessageName() string { - return "create_vlan_subif_reply" -} -func (*CreateVlanSubifReply) GetCrcString() string { - return "fda5941f" -} -func (*CreateVlanSubifReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DeleteLoopback represents VPP binary API message 'delete_loopback': -type DeleteLoopback struct { - SwIfIndex uint32 -} - -func (*DeleteLoopback) GetMessageName() string { - return "delete_loopback" -} -func (*DeleteLoopback) GetCrcString() string { - return "529cb13f" -} -func (*DeleteLoopback) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DeleteLoopbackReply represents VPP binary API message 'delete_loopback_reply': -type DeleteLoopbackReply struct { - Retval int32 -} - -func (*DeleteLoopbackReply) GetMessageName() string { - return "delete_loopback_reply" -} -func (*DeleteLoopbackReply) GetCrcString() string { - return "e8d4e804" -} -func (*DeleteLoopbackReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DeleteSubif represents VPP binary API message 'delete_subif': -type DeleteSubif struct { - SwIfIndex uint32 -} - -func (*DeleteSubif) GetMessageName() string { - return "delete_subif" -} -func (*DeleteSubif) GetCrcString() string { - return "529cb13f" -} -func (*DeleteSubif) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DeleteSubifReply represents VPP binary API message 'delete_subif_reply': -type DeleteSubifReply struct { - Retval int32 -} - -func (*DeleteSubifReply) GetMessageName() string { - return "delete_subif_reply" -} -func (*DeleteSubifReply) GetCrcString() string { - return "e8d4e804" -} -func (*DeleteSubifReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// HwInterfaceSetMtu represents VPP binary API message 'hw_interface_set_mtu': -type HwInterfaceSetMtu struct { - SwIfIndex uint32 - Mtu uint16 -} - -func (*HwInterfaceSetMtu) GetMessageName() string { - return "hw_interface_set_mtu" -} -func (*HwInterfaceSetMtu) GetCrcString() string { - return "132da1e7" -} -func (*HwInterfaceSetMtu) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// HwInterfaceSetMtuReply represents VPP binary API message 'hw_interface_set_mtu_reply': -type HwInterfaceSetMtuReply struct { - Retval int32 -} - -func (*HwInterfaceSetMtuReply) GetMessageName() string { - return "hw_interface_set_mtu_reply" -} -func (*HwInterfaceSetMtuReply) GetCrcString() string { - return "e8d4e804" -} -func (*HwInterfaceSetMtuReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// InterfaceNameRenumber represents VPP binary API message 'interface_name_renumber': -type InterfaceNameRenumber struct { - SwIfIndex uint32 - NewShowDevInstance uint32 -} - -func (*InterfaceNameRenumber) GetMessageName() string { - return "interface_name_renumber" -} -func (*InterfaceNameRenumber) GetCrcString() string { - return "39194269" -} -func (*InterfaceNameRenumber) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// InterfaceNameRenumberReply represents VPP binary API message 'interface_name_renumber_reply': -type InterfaceNameRenumberReply struct { - Retval int32 -} - -func (*InterfaceNameRenumberReply) GetMessageName() string { - return "interface_name_renumber_reply" -} -func (*InterfaceNameRenumberReply) GetCrcString() string { - return "e8d4e804" -} -func (*InterfaceNameRenumberReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceAddDelAddress represents VPP binary API message 'sw_interface_add_del_address': -type SwInterfaceAddDelAddress struct { - SwIfIndex uint32 - IsAdd uint8 - IsIPv6 uint8 - DelAll uint8 - AddressLength uint8 - Address []byte `struc:"[16]byte"` -} - -func (*SwInterfaceAddDelAddress) GetMessageName() string { - return "sw_interface_add_del_address" -} -func (*SwInterfaceAddDelAddress) GetCrcString() string { - return "7b583179" -} -func (*SwInterfaceAddDelAddress) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceAddDelAddressReply represents VPP binary API message 'sw_interface_add_del_address_reply': -type SwInterfaceAddDelAddressReply struct { - Retval int32 -} - -func (*SwInterfaceAddDelAddressReply) GetMessageName() string { - return "sw_interface_add_del_address_reply" -} -func (*SwInterfaceAddDelAddressReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceAddDelAddressReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceClearStats represents VPP binary API message 'sw_interface_clear_stats': -type SwInterfaceClearStats struct { - SwIfIndex uint32 -} - -func (*SwInterfaceClearStats) GetMessageName() string { - return "sw_interface_clear_stats" -} -func (*SwInterfaceClearStats) GetCrcString() string { - return "529cb13f" -} -func (*SwInterfaceClearStats) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceClearStatsReply represents VPP binary API message 'sw_interface_clear_stats_reply': -type SwInterfaceClearStatsReply struct { - Retval int32 -} - -func (*SwInterfaceClearStatsReply) GetMessageName() string { - return "sw_interface_clear_stats_reply" -} -func (*SwInterfaceClearStatsReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceClearStatsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceDetails represents VPP binary API message 'sw_interface_details': -type SwInterfaceDetails struct { - SwIfIndex uint32 - SupSwIfIndex uint32 - L2AddressLength uint32 - L2Address []byte `struc:"[8]byte"` - InterfaceName []byte `struc:"[64]byte"` - AdminUpDown uint8 - LinkUpDown uint8 - LinkDuplex uint8 - LinkSpeed uint8 - LinkMtu uint16 - Mtu []uint32 `struc:"[4]uint32"` - SubID uint32 - SubDot1ad uint8 - SubDot1ah uint8 - SubNumberOfTags uint8 - SubOuterVlanID uint16 - SubInnerVlanID uint16 - SubExactMatch uint8 - SubDefault uint8 - SubOuterVlanIDAny uint8 - SubInnerVlanIDAny uint8 - VtrOp uint32 - VtrPushDot1q uint32 - VtrTag1 uint32 - VtrTag2 uint32 - Tag []byte `struc:"[64]byte"` - OuterTag uint16 - BDmac []byte `struc:"[6]byte"` - BSmac []byte `struc:"[6]byte"` - BVlanid uint16 - ISid uint32 -} - -func (*SwInterfaceDetails) GetMessageName() string { - return "sw_interface_details" -} -func (*SwInterfaceDetails) GetCrcString() string { - return "09b4b510" -} -func (*SwInterfaceDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceDump represents VPP binary API message 'sw_interface_dump': -type SwInterfaceDump struct { - NameFilterValid uint8 - NameFilter []byte `struc:"[49]byte"` -} - -func (*SwInterfaceDump) GetMessageName() string { - return "sw_interface_dump" -} -func (*SwInterfaceDump) GetCrcString() string { - return "63f5e3b7" -} -func (*SwInterfaceDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceEvent represents VPP binary API message 'sw_interface_event': -type SwInterfaceEvent struct { - PID uint32 - SwIfIndex uint32 - AdminUpDown uint8 - LinkUpDown uint8 - Deleted uint8 -} - -func (*SwInterfaceEvent) GetMessageName() string { - return "sw_interface_event" -} -func (*SwInterfaceEvent) GetCrcString() string { - return "bf9938e4" -} -func (*SwInterfaceEvent) GetMessageType() api.MessageType { - return api.EventMessage -} - -// SwInterfaceGetMacAddress represents VPP binary API message 'sw_interface_get_mac_address': -type SwInterfaceGetMacAddress struct { - SwIfIndex uint32 -} - -func (*SwInterfaceGetMacAddress) GetMessageName() string { - return "sw_interface_get_mac_address" -} -func (*SwInterfaceGetMacAddress) GetCrcString() string { - return "529cb13f" -} -func (*SwInterfaceGetMacAddress) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceGetMacAddressReply represents VPP binary API message 'sw_interface_get_mac_address_reply': -type SwInterfaceGetMacAddressReply struct { - Retval int32 - MacAddress []byte `struc:"[6]byte"` -} - -func (*SwInterfaceGetMacAddressReply) GetMessageName() string { - return "sw_interface_get_mac_address_reply" -} -func (*SwInterfaceGetMacAddressReply) GetCrcString() string { - return "8ea538d3" -} -func (*SwInterfaceGetMacAddressReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceGetTable represents VPP binary API message 'sw_interface_get_table': -type SwInterfaceGetTable struct { - SwIfIndex uint32 - IsIPv6 uint8 -} - -func (*SwInterfaceGetTable) GetMessageName() string { - return "sw_interface_get_table" -} -func (*SwInterfaceGetTable) GetCrcString() string { - return "6b7bcd0a" -} -func (*SwInterfaceGetTable) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceGetTableReply represents VPP binary API message 'sw_interface_get_table_reply': -type SwInterfaceGetTableReply struct { - Retval int32 - VrfID uint32 -} - -func (*SwInterfaceGetTableReply) GetMessageName() string { - return "sw_interface_get_table_reply" -} -func (*SwInterfaceGetTableReply) GetCrcString() string { - return "a6eb0109" -} -func (*SwInterfaceGetTableReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceRxPlacementDetails represents VPP binary API message 'sw_interface_rx_placement_details': -type SwInterfaceRxPlacementDetails struct { - SwIfIndex uint32 - QueueID uint32 - WorkerID uint32 - Mode uint8 -} - -func (*SwInterfaceRxPlacementDetails) GetMessageName() string { - return "sw_interface_rx_placement_details" -} -func (*SwInterfaceRxPlacementDetails) GetCrcString() string { - return "0e9e33f4" -} -func (*SwInterfaceRxPlacementDetails) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceRxPlacementDump represents VPP binary API message 'sw_interface_rx_placement_dump': -type SwInterfaceRxPlacementDump struct { - SwIfIndex uint32 -} - -func (*SwInterfaceRxPlacementDump) GetMessageName() string { - return "sw_interface_rx_placement_dump" -} -func (*SwInterfaceRxPlacementDump) GetCrcString() string { - return "529cb13f" -} -func (*SwInterfaceRxPlacementDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSetFlags represents VPP binary API message 'sw_interface_set_flags': -type SwInterfaceSetFlags struct { - SwIfIndex uint32 - AdminUpDown uint8 -} - -func (*SwInterfaceSetFlags) GetMessageName() string { - return "sw_interface_set_flags" -} -func (*SwInterfaceSetFlags) GetCrcString() string { - return "555485f5" -} -func (*SwInterfaceSetFlags) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSetFlagsReply represents VPP binary API message 'sw_interface_set_flags_reply': -type SwInterfaceSetFlagsReply struct { - Retval int32 -} - -func (*SwInterfaceSetFlagsReply) GetMessageName() string { - return "sw_interface_set_flags_reply" -} -func (*SwInterfaceSetFlagsReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceSetFlagsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceSetIPDirectedBroadcast represents VPP binary API message 'sw_interface_set_ip_directed_broadcast': -type SwInterfaceSetIPDirectedBroadcast struct { - SwIfIndex uint32 - Enable uint8 -} - -func (*SwInterfaceSetIPDirectedBroadcast) GetMessageName() string { - return "sw_interface_set_ip_directed_broadcast" -} -func (*SwInterfaceSetIPDirectedBroadcast) GetCrcString() string { - return "a36fadc0" -} -func (*SwInterfaceSetIPDirectedBroadcast) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSetIPDirectedBroadcastReply represents VPP binary API message 'sw_interface_set_ip_directed_broadcast_reply': -type SwInterfaceSetIPDirectedBroadcastReply struct { - Retval int32 -} - -func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageName() string { - return "sw_interface_set_ip_directed_broadcast_reply" -} -func (*SwInterfaceSetIPDirectedBroadcastReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceSetMacAddress represents VPP binary API message 'sw_interface_set_mac_address': -type SwInterfaceSetMacAddress struct { - SwIfIndex uint32 - MacAddress []byte `struc:"[6]byte"` -} - -func (*SwInterfaceSetMacAddress) GetMessageName() string { - return "sw_interface_set_mac_address" -} -func (*SwInterfaceSetMacAddress) GetCrcString() string { - return "eed5dfca" -} -func (*SwInterfaceSetMacAddress) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSetMacAddressReply represents VPP binary API message 'sw_interface_set_mac_address_reply': -type SwInterfaceSetMacAddressReply struct { - Retval int32 -} - -func (*SwInterfaceSetMacAddressReply) GetMessageName() string { - return "sw_interface_set_mac_address_reply" -} -func (*SwInterfaceSetMacAddressReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceSetMacAddressReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceSetMtu represents VPP binary API message 'sw_interface_set_mtu': -type SwInterfaceSetMtu struct { - SwIfIndex uint32 - Mtu []uint32 `struc:"[4]uint32"` -} - -func (*SwInterfaceSetMtu) GetMessageName() string { - return "sw_interface_set_mtu" -} -func (*SwInterfaceSetMtu) GetCrcString() string { - return "d0008db8" -} -func (*SwInterfaceSetMtu) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSetMtuReply represents VPP binary API message 'sw_interface_set_mtu_reply': -type SwInterfaceSetMtuReply struct { - Retval int32 -} - -func (*SwInterfaceSetMtuReply) GetMessageName() string { - return "sw_interface_set_mtu_reply" -} -func (*SwInterfaceSetMtuReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceSetMtuReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceSetRxMode represents VPP binary API message 'sw_interface_set_rx_mode': -type SwInterfaceSetRxMode struct { - SwIfIndex uint32 - QueueIDValid uint8 - QueueID uint32 - Mode uint8 -} - -func (*SwInterfaceSetRxMode) GetMessageName() string { - return "sw_interface_set_rx_mode" -} -func (*SwInterfaceSetRxMode) GetCrcString() string { - return "2a1cc58c" -} -func (*SwInterfaceSetRxMode) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSetRxModeReply represents VPP binary API message 'sw_interface_set_rx_mode_reply': -type SwInterfaceSetRxModeReply struct { - Retval int32 -} - -func (*SwInterfaceSetRxModeReply) GetMessageName() string { - return "sw_interface_set_rx_mode_reply" -} -func (*SwInterfaceSetRxModeReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceSetRxModeReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceSetRxPlacement represents VPP binary API message 'sw_interface_set_rx_placement': -type SwInterfaceSetRxPlacement struct { - SwIfIndex uint32 - QueueID uint32 - WorkerID uint32 - IsMain uint8 -} - -func (*SwInterfaceSetRxPlacement) GetMessageName() string { - return "sw_interface_set_rx_placement" -} -func (*SwInterfaceSetRxPlacement) GetCrcString() string { - return "4ef4377d" -} -func (*SwInterfaceSetRxPlacement) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSetRxPlacementReply represents VPP binary API message 'sw_interface_set_rx_placement_reply': -type SwInterfaceSetRxPlacementReply struct { - Retval int32 -} - -func (*SwInterfaceSetRxPlacementReply) GetMessageName() string { - return "sw_interface_set_rx_placement_reply" -} -func (*SwInterfaceSetRxPlacementReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceSetRxPlacementReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceSetTable represents VPP binary API message 'sw_interface_set_table': -type SwInterfaceSetTable struct { - SwIfIndex uint32 - IsIPv6 uint8 - VrfID uint32 -} - -func (*SwInterfaceSetTable) GetMessageName() string { - return "sw_interface_set_table" -} -func (*SwInterfaceSetTable) GetCrcString() string { - return "acb25d89" -} -func (*SwInterfaceSetTable) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSetTableReply represents VPP binary API message 'sw_interface_set_table_reply': -type SwInterfaceSetTableReply struct { - Retval int32 -} - -func (*SwInterfaceSetTableReply) GetMessageName() string { - return "sw_interface_set_table_reply" -} -func (*SwInterfaceSetTableReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceSetTableReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceSetUnnumbered represents VPP binary API message 'sw_interface_set_unnumbered': -type SwInterfaceSetUnnumbered struct { - SwIfIndex uint32 - UnnumberedSwIfIndex uint32 - IsAdd uint8 -} - -func (*SwInterfaceSetUnnumbered) GetMessageName() string { - return "sw_interface_set_unnumbered" -} -func (*SwInterfaceSetUnnumbered) GetCrcString() string { - return "a2c1bbda" -} -func (*SwInterfaceSetUnnumbered) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSetUnnumberedReply represents VPP binary API message 'sw_interface_set_unnumbered_reply': -type SwInterfaceSetUnnumberedReply struct { - Retval int32 -} - -func (*SwInterfaceSetUnnumberedReply) GetMessageName() string { - return "sw_interface_set_unnumbered_reply" -} -func (*SwInterfaceSetUnnumberedReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceSetUnnumberedReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceTagAddDel represents VPP binary API message 'sw_interface_tag_add_del': -type SwInterfaceTagAddDel struct { - IsAdd uint8 - SwIfIndex uint32 - Tag []byte `struc:"[64]byte"` -} - -func (*SwInterfaceTagAddDel) GetMessageName() string { - return "sw_interface_tag_add_del" -} -func (*SwInterfaceTagAddDel) GetCrcString() string { - return "14cc636c" -} -func (*SwInterfaceTagAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceTagAddDelReply represents VPP binary API message 'sw_interface_tag_add_del_reply': -type SwInterfaceTagAddDelReply struct { - Retval int32 -} - -func (*SwInterfaceTagAddDelReply) GetMessageName() string { - return "sw_interface_tag_add_del_reply" -} -func (*SwInterfaceTagAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceTagAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// WantInterfaceEvents represents VPP binary API message 'want_interface_events': -type WantInterfaceEvents struct { - EnableDisable uint32 - PID uint32 -} - -func (*WantInterfaceEvents) GetMessageName() string { - return "want_interface_events" -} -func (*WantInterfaceEvents) GetCrcString() string { - return "476f5a08" -} -func (*WantInterfaceEvents) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// WantInterfaceEventsReply represents VPP binary API message 'want_interface_events_reply': -type WantInterfaceEventsReply struct { - Retval int32 -} - -func (*WantInterfaceEventsReply) GetMessageName() string { - return "want_interface_events_reply" -} -func (*WantInterfaceEventsReply) GetCrcString() string { - return "e8d4e804" -} -func (*WantInterfaceEventsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func init() { - api.RegisterMessage((*CollectDetailedInterfaceStats)(nil), "interface.CollectDetailedInterfaceStats") - api.RegisterMessage((*CollectDetailedInterfaceStatsReply)(nil), "interface.CollectDetailedInterfaceStatsReply") - api.RegisterMessage((*CreateLoopback)(nil), "interface.CreateLoopback") - api.RegisterMessage((*CreateLoopbackInstance)(nil), "interface.CreateLoopbackInstance") - api.RegisterMessage((*CreateLoopbackInstanceReply)(nil), "interface.CreateLoopbackInstanceReply") - api.RegisterMessage((*CreateLoopbackReply)(nil), "interface.CreateLoopbackReply") - api.RegisterMessage((*CreateSubif)(nil), "interface.CreateSubif") - api.RegisterMessage((*CreateSubifReply)(nil), "interface.CreateSubifReply") - api.RegisterMessage((*CreateVlanSubif)(nil), "interface.CreateVlanSubif") - api.RegisterMessage((*CreateVlanSubifReply)(nil), "interface.CreateVlanSubifReply") - api.RegisterMessage((*DeleteLoopback)(nil), "interface.DeleteLoopback") - api.RegisterMessage((*DeleteLoopbackReply)(nil), "interface.DeleteLoopbackReply") - api.RegisterMessage((*DeleteSubif)(nil), "interface.DeleteSubif") - api.RegisterMessage((*DeleteSubifReply)(nil), "interface.DeleteSubifReply") - api.RegisterMessage((*HwInterfaceSetMtu)(nil), "interface.HwInterfaceSetMtu") - api.RegisterMessage((*HwInterfaceSetMtuReply)(nil), "interface.HwInterfaceSetMtuReply") - api.RegisterMessage((*InterfaceNameRenumber)(nil), "interface.InterfaceNameRenumber") - api.RegisterMessage((*InterfaceNameRenumberReply)(nil), "interface.InterfaceNameRenumberReply") - api.RegisterMessage((*SwInterfaceAddDelAddress)(nil), "interface.SwInterfaceAddDelAddress") - api.RegisterMessage((*SwInterfaceAddDelAddressReply)(nil), "interface.SwInterfaceAddDelAddressReply") - api.RegisterMessage((*SwInterfaceClearStats)(nil), "interface.SwInterfaceClearStats") - api.RegisterMessage((*SwInterfaceClearStatsReply)(nil), "interface.SwInterfaceClearStatsReply") - api.RegisterMessage((*SwInterfaceDetails)(nil), "interface.SwInterfaceDetails") - api.RegisterMessage((*SwInterfaceDump)(nil), "interface.SwInterfaceDump") - api.RegisterMessage((*SwInterfaceEvent)(nil), "interface.SwInterfaceEvent") - api.RegisterMessage((*SwInterfaceGetMacAddress)(nil), "interface.SwInterfaceGetMacAddress") - api.RegisterMessage((*SwInterfaceGetMacAddressReply)(nil), "interface.SwInterfaceGetMacAddressReply") - api.RegisterMessage((*SwInterfaceGetTable)(nil), "interface.SwInterfaceGetTable") - api.RegisterMessage((*SwInterfaceGetTableReply)(nil), "interface.SwInterfaceGetTableReply") - api.RegisterMessage((*SwInterfaceRxPlacementDetails)(nil), "interface.SwInterfaceRxPlacementDetails") - api.RegisterMessage((*SwInterfaceRxPlacementDump)(nil), "interface.SwInterfaceRxPlacementDump") - api.RegisterMessage((*SwInterfaceSetFlags)(nil), "interface.SwInterfaceSetFlags") - api.RegisterMessage((*SwInterfaceSetFlagsReply)(nil), "interface.SwInterfaceSetFlagsReply") - api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcast)(nil), "interface.SwInterfaceSetIPDirectedBroadcast") - api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcastReply)(nil), "interface.SwInterfaceSetIPDirectedBroadcastReply") - api.RegisterMessage((*SwInterfaceSetMacAddress)(nil), "interface.SwInterfaceSetMacAddress") - api.RegisterMessage((*SwInterfaceSetMacAddressReply)(nil), "interface.SwInterfaceSetMacAddressReply") - api.RegisterMessage((*SwInterfaceSetMtu)(nil), "interface.SwInterfaceSetMtu") - api.RegisterMessage((*SwInterfaceSetMtuReply)(nil), "interface.SwInterfaceSetMtuReply") - api.RegisterMessage((*SwInterfaceSetRxMode)(nil), "interface.SwInterfaceSetRxMode") - api.RegisterMessage((*SwInterfaceSetRxModeReply)(nil), "interface.SwInterfaceSetRxModeReply") - api.RegisterMessage((*SwInterfaceSetRxPlacement)(nil), "interface.SwInterfaceSetRxPlacement") - api.RegisterMessage((*SwInterfaceSetRxPlacementReply)(nil), "interface.SwInterfaceSetRxPlacementReply") - api.RegisterMessage((*SwInterfaceSetTable)(nil), "interface.SwInterfaceSetTable") - api.RegisterMessage((*SwInterfaceSetTableReply)(nil), "interface.SwInterfaceSetTableReply") - api.RegisterMessage((*SwInterfaceSetUnnumbered)(nil), "interface.SwInterfaceSetUnnumbered") - api.RegisterMessage((*SwInterfaceSetUnnumberedReply)(nil), "interface.SwInterfaceSetUnnumberedReply") - api.RegisterMessage((*SwInterfaceTagAddDel)(nil), "interface.SwInterfaceTagAddDel") - api.RegisterMessage((*SwInterfaceTagAddDelReply)(nil), "interface.SwInterfaceTagAddDelReply") - api.RegisterMessage((*WantInterfaceEvents)(nil), "interface.WantInterfaceEvents") - api.RegisterMessage((*WantInterfaceEventsReply)(nil), "interface.WantInterfaceEventsReply") -} - -var Messages = []api.Message{ - (*CollectDetailedInterfaceStats)(nil), - (*CollectDetailedInterfaceStatsReply)(nil), - (*CreateLoopback)(nil), - (*CreateLoopbackInstance)(nil), - (*CreateLoopbackInstanceReply)(nil), - (*CreateLoopbackReply)(nil), - (*CreateSubif)(nil), - (*CreateSubifReply)(nil), - (*CreateVlanSubif)(nil), - (*CreateVlanSubifReply)(nil), - (*DeleteLoopback)(nil), - (*DeleteLoopbackReply)(nil), - (*DeleteSubif)(nil), - (*DeleteSubifReply)(nil), - (*HwInterfaceSetMtu)(nil), - (*HwInterfaceSetMtuReply)(nil), - (*InterfaceNameRenumber)(nil), - (*InterfaceNameRenumberReply)(nil), - (*SwInterfaceAddDelAddress)(nil), - (*SwInterfaceAddDelAddressReply)(nil), - (*SwInterfaceClearStats)(nil), - (*SwInterfaceClearStatsReply)(nil), - (*SwInterfaceDetails)(nil), - (*SwInterfaceDump)(nil), - (*SwInterfaceEvent)(nil), - (*SwInterfaceGetMacAddress)(nil), - (*SwInterfaceGetMacAddressReply)(nil), - (*SwInterfaceGetTable)(nil), - (*SwInterfaceGetTableReply)(nil), - (*SwInterfaceRxPlacementDetails)(nil), - (*SwInterfaceRxPlacementDump)(nil), - (*SwInterfaceSetFlags)(nil), - (*SwInterfaceSetFlagsReply)(nil), - (*SwInterfaceSetIPDirectedBroadcast)(nil), - (*SwInterfaceSetIPDirectedBroadcastReply)(nil), - (*SwInterfaceSetMacAddress)(nil), - (*SwInterfaceSetMacAddressReply)(nil), - (*SwInterfaceSetMtu)(nil), - (*SwInterfaceSetMtuReply)(nil), - (*SwInterfaceSetRxMode)(nil), - (*SwInterfaceSetRxModeReply)(nil), - (*SwInterfaceSetRxPlacement)(nil), - (*SwInterfaceSetRxPlacementReply)(nil), - (*SwInterfaceSetTable)(nil), - (*SwInterfaceSetTableReply)(nil), - (*SwInterfaceSetUnnumbered)(nil), - (*SwInterfaceSetUnnumberedReply)(nil), - (*SwInterfaceTagAddDel)(nil), - (*SwInterfaceTagAddDelReply)(nil), - (*WantInterfaceEvents)(nil), - (*WantInterfaceEventsReply)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip/ip.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip/ip.ba.go deleted file mode 100644 index 8450a9a1cd..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip/ip.ba.go +++ /dev/null @@ -1,1956 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/ip.api.json - -/* - Package ip is a generated from VPP binary API module 'ip'. - - It contains following objects: - 42 services - 1 enum - 10 types - 1 union - 87 messages -*/ -package ip - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpIP6Fib(*IP6FibDump) ([]*IP6FibDetails, error) - DumpIP6Mfib(*IP6MfibDump) ([]*IP6MfibDetails, error) - DumpIP6ndProxy(*IP6ndProxyDump) ([]*IP6ndProxyDetails, error) - DumpIPAddress(*IPAddressDump) ([]*IPAddressDetails, error) - DumpIP(*IPDump) ([]*IPDetails, error) - DumpIPFib(*IPFibDump) ([]*IPFibDetails, error) - DumpIPMfib(*IPMfibDump) ([]*IPMfibDetails, error) - DumpIPNeighbor(*IPNeighborDump) ([]*IPNeighborDetails, error) - DumpIPUnnumbered(*IPUnnumberedDump) ([]*IPUnnumberedDetails, error) - DumpMfibSignal(*MfibSignalDump) ([]*MfibSignalDetails, error) - DumpProxyArp(*ProxyArpDump) ([]*ProxyArpDetails, error) - DumpProxyArpIntfc(*ProxyArpIntfcDump) ([]*ProxyArpIntfcDetails, error) - IoamDisable(*IoamDisable) (*IoamDisableReply, error) - IoamEnable(*IoamEnable) (*IoamEnableReply, error) - IP6ndProxyAddDel(*IP6ndProxyAddDel) (*IP6ndProxyAddDelReply, error) - IP6ndSendRouterSolicitation(*IP6ndSendRouterSolicitation) (*IP6ndSendRouterSolicitationReply, error) - IPAddDelRoute(*IPAddDelRoute) (*IPAddDelRouteReply, error) - IPContainerProxyAddDel(*IPContainerProxyAddDel) (*IPContainerProxyAddDelReply, error) - IPMrouteAddDel(*IPMrouteAddDel) (*IPMrouteAddDelReply, error) - IPNeighborAddDel(*IPNeighborAddDel) (*IPNeighborAddDelReply, error) - IPProbeNeighbor(*IPProbeNeighbor) (*IPProbeNeighborReply, error) - IPPuntPolice(*IPPuntPolice) (*IPPuntPoliceReply, error) - IPPuntRedirect(*IPPuntRedirect) (*IPPuntRedirectReply, error) - IPReassemblyEnableDisable(*IPReassemblyEnableDisable) (*IPReassemblyEnableDisableReply, error) - IPReassemblyGet(*IPReassemblyGet) (*IPReassemblyGetReply, error) - IPReassemblySet(*IPReassemblySet) (*IPReassemblySetReply, error) - IPScanNeighborEnableDisable(*IPScanNeighborEnableDisable) (*IPScanNeighborEnableDisableReply, error) - IPSourceAndPortRangeCheckAddDel(*IPSourceAndPortRangeCheckAddDel) (*IPSourceAndPortRangeCheckAddDelReply, error) - IPSourceAndPortRangeCheckInterfaceAddDel(*IPSourceAndPortRangeCheckInterfaceAddDel) (*IPSourceAndPortRangeCheckInterfaceAddDelReply, error) - IPTableAddDel(*IPTableAddDel) (*IPTableAddDelReply, error) - ProxyArpAddDel(*ProxyArpAddDel) (*ProxyArpAddDelReply, error) - ProxyArpIntfcEnableDisable(*ProxyArpIntfcEnableDisable) (*ProxyArpIntfcEnableDisableReply, error) - ResetFib(*ResetFib) (*ResetFibReply, error) - SetArpNeighborLimit(*SetArpNeighborLimit) (*SetArpNeighborLimitReply, error) - SetIPFlowHash(*SetIPFlowHash) (*SetIPFlowHashReply, error) - SwInterfaceIP6EnableDisable(*SwInterfaceIP6EnableDisable) (*SwInterfaceIP6EnableDisableReply, error) - SwInterfaceIP6SetLinkLocalAddress(*SwInterfaceIP6SetLinkLocalAddress) (*SwInterfaceIP6SetLinkLocalAddressReply, error) - SwInterfaceIP6ndRaConfig(*SwInterfaceIP6ndRaConfig) (*SwInterfaceIP6ndRaConfigReply, error) - SwInterfaceIP6ndRaPrefix(*SwInterfaceIP6ndRaPrefix) (*SwInterfaceIP6ndRaPrefixReply, error) - WantIP4ArpEvents(*WantIP4ArpEvents) (*WantIP4ArpEventsReply, error) - WantIP6NdEvents(*WantIP6NdEvents) (*WantIP6NdEventsReply, error) - WantIP6RaEvents(*WantIP6RaEvents) (*WantIP6RaEventsReply, error) -} - -/* Enums */ - -// AddressFamily represents VPP binary API enum 'address_family': -type AddressFamily uint32 - -const ( - ADDRESS_IP4 AddressFamily = 0 - ADDRESS_IP6 AddressFamily = 1 -) - -/* Types */ - -// Address represents VPP binary API type 'address': -type Address struct { - Af AddressFamily - Un AddressUnion -} - -func (*Address) GetTypeName() string { - return "address" -} -func (*Address) GetCrcString() string { - return "09f11671" -} - -// FibMplsLabel represents VPP binary API type 'fib_mpls_label': -type FibMplsLabel struct { - IsUniform uint8 - Label uint32 - TTL uint8 - Exp uint8 -} - -func (*FibMplsLabel) GetTypeName() string { - return "fib_mpls_label" -} -func (*FibMplsLabel) GetCrcString() string { - return "c93bf35c" -} - -// FibPath represents VPP binary API type 'fib_path': -type FibPath struct { - SwIfIndex uint32 - TableID uint32 - Weight uint8 - Preference uint8 - IsLocal uint8 - IsDrop uint8 - IsUDPEncap uint8 - IsUnreach uint8 - IsProhibit uint8 - IsResolveHost uint8 - IsResolveAttached uint8 - IsDvr uint8 - IsSourceLookup uint8 - Afi uint8 - NextHop []byte `struc:"[16]byte"` - NextHopID uint32 - RpfID uint32 - ViaLabel uint32 - NLabels uint8 `struc:"sizeof=LabelStack"` // MANUALLY FIXED, see https://jira.fd.io/browse/VPP-1261 - LabelStack []FibMplsLabel -} - -func (*FibPath) GetTypeName() string { - return "fib_path" -} -func (*FibPath) GetCrcString() string { - return "abe483ef" -} - -// IP4Address represents VPP binary API type 'ip4_address': -type IP4Address struct { - Address []byte `struc:"[4]byte"` -} - -func (*IP4Address) GetTypeName() string { - return "ip4_address" -} -func (*IP4Address) GetCrcString() string { - return "fc4baa28" -} - -// IP6Address represents VPP binary API type 'ip6_address': -type IP6Address struct { - Address []byte `struc:"[16]byte"` -} - -func (*IP6Address) GetTypeName() string { - return "ip6_address" -} -func (*IP6Address) GetCrcString() string { - return "ad99ccc2" -} - -// IP6RaPrefixInfo represents VPP binary API type 'ip6_ra_prefix_info': -type IP6RaPrefixInfo struct { - DstAddress []byte `struc:"[16]byte"` - DstAddressLength uint8 - Flags uint8 - ValidTime uint32 - PreferredTime uint32 -} - -func (*IP6RaPrefixInfo) GetTypeName() string { - return "ip6_ra_prefix_info" -} -func (*IP6RaPrefixInfo) GetCrcString() string { - return "83d7c6e5" -} - -// MacAddress represents VPP binary API type 'mac_address': -type MacAddress struct { - Bytes []byte `struc:"[6]byte"` -} - -func (*MacAddress) GetTypeName() string { - return "mac_address" -} -func (*MacAddress) GetCrcString() string { - return "efdbdddc" -} - -// Mprefix represents VPP binary API type 'mprefix': -type Mprefix struct { - Af AddressFamily - GrpAddressLength uint16 - GrpAddress AddressUnion - SrcAddress AddressUnion -} - -func (*Mprefix) GetTypeName() string { - return "mprefix" -} -func (*Mprefix) GetCrcString() string { - return "1c4cba05" -} - -// Prefix represents VPP binary API type 'prefix': -type Prefix struct { - Address Address - AddressLength uint8 -} - -func (*Prefix) GetTypeName() string { - return "prefix" -} -func (*Prefix) GetCrcString() string { - return "0403aebc" -} - -// ProxyArp represents VPP binary API type 'proxy_arp': -type ProxyArp struct { - VrfID uint32 - LowAddress []byte `struc:"[4]byte"` - HiAddress []byte `struc:"[4]byte"` -} - -func (*ProxyArp) GetTypeName() string { - return "proxy_arp" -} -func (*ProxyArp) GetCrcString() string { - return "6d88106e" -} - -/* Unions */ - -// AddressUnion represents VPP binary API union 'address_union': -type AddressUnion struct { - Union_data [16]byte -} - -func (*AddressUnion) GetTypeName() string { - return "address_union" -} -func (*AddressUnion) GetCrcString() string { - return "d68a2fb4" -} - -func AddressUnionIP4(a IP4Address) (u AddressUnion) { - u.SetIP4(a) - return -} -func (u *AddressUnion) SetIP4(a IP4Address) { - var b = new(bytes.Buffer) - if err := struc.Pack(b, &a); err != nil { - return - } - copy(u.Union_data[:], b.Bytes()) -} -func (u *AddressUnion) GetIP4() (a IP4Address) { - var b = bytes.NewReader(u.Union_data[:]) - struc.Unpack(b, &a) - return -} - -func AddressUnionIP6(a IP6Address) (u AddressUnion) { - u.SetIP6(a) - return -} -func (u *AddressUnion) SetIP6(a IP6Address) { - var b = new(bytes.Buffer) - if err := struc.Pack(b, &a); err != nil { - return - } - copy(u.Union_data[:], b.Bytes()) -} -func (u *AddressUnion) GetIP6() (a IP6Address) { - var b = bytes.NewReader(u.Union_data[:]) - struc.Unpack(b, &a) - return -} - -/* Messages */ - -// IoamDisable represents VPP binary API message 'ioam_disable': -type IoamDisable struct { - ID uint16 -} - -func (*IoamDisable) GetMessageName() string { - return "ioam_disable" -} -func (*IoamDisable) GetCrcString() string { - return "6b16a45e" -} -func (*IoamDisable) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IoamDisableReply represents VPP binary API message 'ioam_disable_reply': -type IoamDisableReply struct { - Retval int32 -} - -func (*IoamDisableReply) GetMessageName() string { - return "ioam_disable_reply" -} -func (*IoamDisableReply) GetCrcString() string { - return "e8d4e804" -} -func (*IoamDisableReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IoamEnable represents VPP binary API message 'ioam_enable': -type IoamEnable struct { - ID uint16 - Seqno uint8 - Analyse uint8 - PotEnable uint8 - TraceEnable uint8 - NodeID uint32 -} - -func (*IoamEnable) GetMessageName() string { - return "ioam_enable" -} -func (*IoamEnable) GetCrcString() string { - return "9392e032" -} -func (*IoamEnable) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IoamEnableReply represents VPP binary API message 'ioam_enable_reply': -type IoamEnableReply struct { - Retval int32 -} - -func (*IoamEnableReply) GetMessageName() string { - return "ioam_enable_reply" -} -func (*IoamEnableReply) GetCrcString() string { - return "e8d4e804" -} -func (*IoamEnableReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IP4ArpEvent represents VPP binary API message 'ip4_arp_event': -type IP4ArpEvent struct { - Address uint32 - PID uint32 - SwIfIndex uint32 - NewMac []byte `struc:"[6]byte"` - MacIP uint8 -} - -func (*IP4ArpEvent) GetMessageName() string { - return "ip4_arp_event" -} -func (*IP4ArpEvent) GetCrcString() string { - return "ef7235f7" -} -func (*IP4ArpEvent) GetMessageType() api.MessageType { - return api.EventMessage -} - -// IP6FibDetails represents VPP binary API message 'ip6_fib_details': -type IP6FibDetails struct { - TableID uint32 - TableName []byte `struc:"[64]byte"` - AddressLength uint8 - Address []byte `struc:"[16]byte"` - Count uint32 `struc:"sizeof=Path"` - StatsIndex uint32 - Path []FibPath -} - -func (*IP6FibDetails) GetMessageName() string { - return "ip6_fib_details" -} -func (*IP6FibDetails) GetCrcString() string { - return "ef11e94d" -} -func (*IP6FibDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IP6FibDump represents VPP binary API message 'ip6_fib_dump': -type IP6FibDump struct{} - -func (*IP6FibDump) GetMessageName() string { - return "ip6_fib_dump" -} -func (*IP6FibDump) GetCrcString() string { - return "51077d14" -} -func (*IP6FibDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IP6MfibDetails represents VPP binary API message 'ip6_mfib_details': -type IP6MfibDetails struct { - TableID uint32 - AddressLength uint8 - GrpAddress []byte `struc:"[16]byte"` - SrcAddress []byte `struc:"[16]byte"` - Count uint32 `struc:"sizeof=Path"` - Path []FibPath -} - -func (*IP6MfibDetails) GetMessageName() string { - return "ip6_mfib_details" -} -func (*IP6MfibDetails) GetCrcString() string { - return "e02dcb4b" -} -func (*IP6MfibDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IP6MfibDump represents VPP binary API message 'ip6_mfib_dump': -type IP6MfibDump struct{} - -func (*IP6MfibDump) GetMessageName() string { - return "ip6_mfib_dump" -} -func (*IP6MfibDump) GetCrcString() string { - return "51077d14" -} -func (*IP6MfibDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IP6NdEvent represents VPP binary API message 'ip6_nd_event': -type IP6NdEvent struct { - PID uint32 - SwIfIndex uint32 - Address []byte `struc:"[16]byte"` - NewMac []byte `struc:"[6]byte"` - MacIP uint8 -} - -func (*IP6NdEvent) GetMessageName() string { - return "ip6_nd_event" -} -func (*IP6NdEvent) GetCrcString() string { - return "96ab2fdd" -} -func (*IP6NdEvent) GetMessageType() api.MessageType { - return api.EventMessage -} - -// IP6RaEvent represents VPP binary API message 'ip6_ra_event': -type IP6RaEvent struct { - PID uint32 - SwIfIndex uint32 - RouterAddress []byte `struc:"[16]byte"` - CurrentHopLimit uint8 - Flags uint8 - RouterLifetimeInSec uint16 - NeighborReachableTimeInMsec uint32 - TimeInMsecBetweenRetransmittedNeighborSolicitations uint32 - NPrefixes uint32 `struc:"sizeof=Prefixes"` - Prefixes []IP6RaPrefixInfo -} - -func (*IP6RaEvent) GetMessageName() string { - return "ip6_ra_event" -} -func (*IP6RaEvent) GetCrcString() string { - return "c5e54257" -} -func (*IP6RaEvent) GetMessageType() api.MessageType { - return api.EventMessage -} - -// IP6ndProxyAddDel represents VPP binary API message 'ip6nd_proxy_add_del': -type IP6ndProxyAddDel struct { - SwIfIndex uint32 - IsDel uint8 - Address []byte `struc:"[16]byte"` -} - -func (*IP6ndProxyAddDel) GetMessageName() string { - return "ip6nd_proxy_add_del" -} -func (*IP6ndProxyAddDel) GetCrcString() string { - return "d95f0fa0" -} -func (*IP6ndProxyAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IP6ndProxyAddDelReply represents VPP binary API message 'ip6nd_proxy_add_del_reply': -type IP6ndProxyAddDelReply struct { - Retval int32 -} - -func (*IP6ndProxyAddDelReply) GetMessageName() string { - return "ip6nd_proxy_add_del_reply" -} -func (*IP6ndProxyAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*IP6ndProxyAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IP6ndProxyDetails represents VPP binary API message 'ip6nd_proxy_details': -type IP6ndProxyDetails struct { - SwIfIndex uint32 - Address []byte `struc:"[16]byte"` -} - -func (*IP6ndProxyDetails) GetMessageName() string { - return "ip6nd_proxy_details" -} -func (*IP6ndProxyDetails) GetCrcString() string { - return "6a47c974" -} -func (*IP6ndProxyDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IP6ndProxyDump represents VPP binary API message 'ip6nd_proxy_dump': -type IP6ndProxyDump struct{} - -func (*IP6ndProxyDump) GetMessageName() string { - return "ip6nd_proxy_dump" -} -func (*IP6ndProxyDump) GetCrcString() string { - return "51077d14" -} -func (*IP6ndProxyDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IP6ndSendRouterSolicitation represents VPP binary API message 'ip6nd_send_router_solicitation': -type IP6ndSendRouterSolicitation struct { - Irt uint32 - Mrt uint32 - Mrc uint32 - Mrd uint32 - SwIfIndex uint32 - Stop uint8 -} - -func (*IP6ndSendRouterSolicitation) GetMessageName() string { - return "ip6nd_send_router_solicitation" -} -func (*IP6ndSendRouterSolicitation) GetCrcString() string { - return "bd968917" -} -func (*IP6ndSendRouterSolicitation) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IP6ndSendRouterSolicitationReply represents VPP binary API message 'ip6nd_send_router_solicitation_reply': -type IP6ndSendRouterSolicitationReply struct { - Retval int32 -} - -func (*IP6ndSendRouterSolicitationReply) GetMessageName() string { - return "ip6nd_send_router_solicitation_reply" -} -func (*IP6ndSendRouterSolicitationReply) GetCrcString() string { - return "e8d4e804" -} -func (*IP6ndSendRouterSolicitationReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPAddDelRoute represents VPP binary API message 'ip_add_del_route': -type IPAddDelRoute struct { - NextHopSwIfIndex uint32 - TableID uint32 - ClassifyTableIndex uint32 - NextHopTableID uint32 - NextHopID uint32 - IsAdd uint8 - IsDrop uint8 - IsUnreach uint8 - IsProhibit uint8 - IsIPv6 uint8 - IsLocal uint8 - IsClassify uint8 - IsMultipath uint8 - IsResolveHost uint8 - IsResolveAttached uint8 - IsDvr uint8 - IsSourceLookup uint8 - IsUDPEncap uint8 - NextHopWeight uint8 - NextHopPreference uint8 - NextHopProto uint8 - DstAddressLength uint8 - DstAddress []byte `struc:"[16]byte"` - NextHopAddress []byte `struc:"[16]byte"` - NextHopNOutLabels uint8 `struc:"sizeof=NextHopOutLabelStack"` - NextHopViaLabel uint32 - NextHopOutLabelStack []FibMplsLabel -} - -func (*IPAddDelRoute) GetMessageName() string { - return "ip_add_del_route" -} -func (*IPAddDelRoute) GetCrcString() string { - return "4219d62d" -} -func (*IPAddDelRoute) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPAddDelRouteReply represents VPP binary API message 'ip_add_del_route_reply': -type IPAddDelRouteReply struct { - Retval int32 - StatsIndex uint32 -} - -func (*IPAddDelRouteReply) GetMessageName() string { - return "ip_add_del_route_reply" -} -func (*IPAddDelRouteReply) GetCrcString() string { - return "1992deab" -} -func (*IPAddDelRouteReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPAddressDetails represents VPP binary API message 'ip_address_details': -type IPAddressDetails struct { - IP []byte `struc:"[16]byte"` - PrefixLength uint8 - SwIfIndex uint32 - IsIPv6 uint8 -} - -func (*IPAddressDetails) GetMessageName() string { - return "ip_address_details" -} -func (*IPAddressDetails) GetCrcString() string { - return "9bc25966" -} -func (*IPAddressDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPAddressDump represents VPP binary API message 'ip_address_dump': -type IPAddressDump struct { - SwIfIndex uint32 - IsIPv6 uint8 -} - -func (*IPAddressDump) GetMessageName() string { - return "ip_address_dump" -} -func (*IPAddressDump) GetCrcString() string { - return "6b7bcd0a" -} -func (*IPAddressDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPContainerProxyAddDel represents VPP binary API message 'ip_container_proxy_add_del': -type IPContainerProxyAddDel struct { - IP []byte `struc:"[16]byte"` - IsIP4 uint8 - Plen uint8 - SwIfIndex uint32 - IsAdd uint8 -} - -func (*IPContainerProxyAddDel) GetMessageName() string { - return "ip_container_proxy_add_del" -} -func (*IPContainerProxyAddDel) GetCrcString() string { - return "0a355d39" -} -func (*IPContainerProxyAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPContainerProxyAddDelReply represents VPP binary API message 'ip_container_proxy_add_del_reply': -type IPContainerProxyAddDelReply struct { - Retval int32 -} - -func (*IPContainerProxyAddDelReply) GetMessageName() string { - return "ip_container_proxy_add_del_reply" -} -func (*IPContainerProxyAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*IPContainerProxyAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPDetails represents VPP binary API message 'ip_details': -type IPDetails struct { - SwIfIndex uint32 - IsIPv6 uint8 -} - -func (*IPDetails) GetMessageName() string { - return "ip_details" -} -func (*IPDetails) GetCrcString() string { - return "8bb37ec4" -} -func (*IPDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPDump represents VPP binary API message 'ip_dump': -type IPDump struct { - IsIPv6 uint8 -} - -func (*IPDump) GetMessageName() string { - return "ip_dump" -} -func (*IPDump) GetCrcString() string { - return "de883da4" -} -func (*IPDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPFibDetails represents VPP binary API message 'ip_fib_details': -type IPFibDetails struct { - TableID uint32 - TableName []byte `struc:"[64]byte"` - AddressLength uint8 - Address []byte `struc:"[4]byte"` - Count uint32 `struc:"sizeof=Path"` - StatsIndex uint32 - Path []FibPath -} - -func (*IPFibDetails) GetMessageName() string { - return "ip_fib_details" -} -func (*IPFibDetails) GetCrcString() string { - return "f6a2fab3" -} -func (*IPFibDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPFibDump represents VPP binary API message 'ip_fib_dump': -type IPFibDump struct{} - -func (*IPFibDump) GetMessageName() string { - return "ip_fib_dump" -} -func (*IPFibDump) GetCrcString() string { - return "51077d14" -} -func (*IPFibDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPMfibDetails represents VPP binary API message 'ip_mfib_details': -type IPMfibDetails struct { - TableID uint32 - EntryFlags uint32 - RpfID uint32 - AddressLength uint8 - GrpAddress []byte `struc:"[4]byte"` - SrcAddress []byte `struc:"[4]byte"` - Count uint32 `struc:"sizeof=Path"` - StatsIndex uint32 - Path []FibPath -} - -func (*IPMfibDetails) GetMessageName() string { - return "ip_mfib_details" -} -func (*IPMfibDetails) GetCrcString() string { - return "21329a12" -} -func (*IPMfibDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPMfibDump represents VPP binary API message 'ip_mfib_dump': -type IPMfibDump struct{} - -func (*IPMfibDump) GetMessageName() string { - return "ip_mfib_dump" -} -func (*IPMfibDump) GetCrcString() string { - return "51077d14" -} -func (*IPMfibDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPMrouteAddDel represents VPP binary API message 'ip_mroute_add_del': -type IPMrouteAddDel struct { - NextHopSwIfIndex uint32 - TableID uint32 - EntryFlags uint32 - ItfFlags uint32 - RpfID uint32 - BierImp uint32 - GrpAddressLength uint16 - NextHopAfi uint8 - IsAdd uint8 - IsIPv6 uint8 - IsLocal uint8 - GrpAddress []byte `struc:"[16]byte"` - SrcAddress []byte `struc:"[16]byte"` - NhAddress []byte `struc:"[16]byte"` -} - -func (*IPMrouteAddDel) GetMessageName() string { - return "ip_mroute_add_del" -} -func (*IPMrouteAddDel) GetCrcString() string { - return "f44c17b1" -} -func (*IPMrouteAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPMrouteAddDelReply represents VPP binary API message 'ip_mroute_add_del_reply': -type IPMrouteAddDelReply struct { - Retval int32 - StatsIndex uint32 -} - -func (*IPMrouteAddDelReply) GetMessageName() string { - return "ip_mroute_add_del_reply" -} -func (*IPMrouteAddDelReply) GetCrcString() string { - return "1992deab" -} -func (*IPMrouteAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPNeighborAddDel represents VPP binary API message 'ip_neighbor_add_del': -type IPNeighborAddDel struct { - SwIfIndex uint32 - IsAdd uint8 - IsIPv6 uint8 - IsStatic uint8 - IsNoAdjFib uint8 - MacAddress []byte `struc:"[6]byte"` - DstAddress []byte `struc:"[16]byte"` -} - -func (*IPNeighborAddDel) GetMessageName() string { - return "ip_neighbor_add_del" -} -func (*IPNeighborAddDel) GetCrcString() string { - return "4711eb25" -} -func (*IPNeighborAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPNeighborAddDelReply represents VPP binary API message 'ip_neighbor_add_del_reply': -type IPNeighborAddDelReply struct { - Retval int32 - StatsIndex uint32 -} - -func (*IPNeighborAddDelReply) GetMessageName() string { - return "ip_neighbor_add_del_reply" -} -func (*IPNeighborAddDelReply) GetCrcString() string { - return "1992deab" -} -func (*IPNeighborAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPNeighborDetails represents VPP binary API message 'ip_neighbor_details': -type IPNeighborDetails struct { - SwIfIndex uint32 - StatsIndex uint32 - IsStatic uint8 - IsIPv6 uint8 - MacAddress []byte `struc:"[6]byte"` - IPAddress []byte `struc:"[16]byte"` -} - -func (*IPNeighborDetails) GetMessageName() string { - return "ip_neighbor_details" -} -func (*IPNeighborDetails) GetCrcString() string { - return "c7001770" -} -func (*IPNeighborDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPNeighborDump represents VPP binary API message 'ip_neighbor_dump': -type IPNeighborDump struct { - SwIfIndex uint32 - IsIPv6 uint8 -} - -func (*IPNeighborDump) GetMessageName() string { - return "ip_neighbor_dump" -} -func (*IPNeighborDump) GetCrcString() string { - return "6b7bcd0a" -} -func (*IPNeighborDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPProbeNeighbor represents VPP binary API message 'ip_probe_neighbor': -type IPProbeNeighbor struct { - SwIfIndex uint32 - DstAddress []byte `struc:"[16]byte"` - IsIPv6 uint8 -} - -func (*IPProbeNeighbor) GetMessageName() string { - return "ip_probe_neighbor" -} -func (*IPProbeNeighbor) GetCrcString() string { - return "1e44bfd7" -} -func (*IPProbeNeighbor) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPProbeNeighborReply represents VPP binary API message 'ip_probe_neighbor_reply': -type IPProbeNeighborReply struct { - Retval int32 -} - -func (*IPProbeNeighborReply) GetMessageName() string { - return "ip_probe_neighbor_reply" -} -func (*IPProbeNeighborReply) GetCrcString() string { - return "e8d4e804" -} -func (*IPProbeNeighborReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPPuntPolice represents VPP binary API message 'ip_punt_police': -type IPPuntPolice struct { - PolicerIndex uint32 - IsAdd uint8 - IsIP6 uint8 -} - -func (*IPPuntPolice) GetMessageName() string { - return "ip_punt_police" -} -func (*IPPuntPolice) GetCrcString() string { - return "38691592" -} -func (*IPPuntPolice) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPPuntPoliceReply represents VPP binary API message 'ip_punt_police_reply': -type IPPuntPoliceReply struct { - Retval int32 -} - -func (*IPPuntPoliceReply) GetMessageName() string { - return "ip_punt_police_reply" -} -func (*IPPuntPoliceReply) GetCrcString() string { - return "e8d4e804" -} -func (*IPPuntPoliceReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPPuntRedirect represents VPP binary API message 'ip_punt_redirect': -type IPPuntRedirect struct { - RxSwIfIndex uint32 - TxSwIfIndex uint32 - IsAdd uint8 - IsIP6 uint8 - Nh []byte `struc:"[16]byte"` -} - -func (*IPPuntRedirect) GetMessageName() string { - return "ip_punt_redirect" -} -func (*IPPuntRedirect) GetCrcString() string { - return "996b6603" -} -func (*IPPuntRedirect) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPPuntRedirectReply represents VPP binary API message 'ip_punt_redirect_reply': -type IPPuntRedirectReply struct { - Retval int32 -} - -func (*IPPuntRedirectReply) GetMessageName() string { - return "ip_punt_redirect_reply" -} -func (*IPPuntRedirectReply) GetCrcString() string { - return "e8d4e804" -} -func (*IPPuntRedirectReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPReassemblyEnableDisable represents VPP binary API message 'ip_reassembly_enable_disable': -type IPReassemblyEnableDisable struct { - SwIfIndex uint32 - EnableIP4 uint8 - EnableIP6 uint8 -} - -func (*IPReassemblyEnableDisable) GetMessageName() string { - return "ip_reassembly_enable_disable" -} -func (*IPReassemblyEnableDisable) GetCrcString() string { - return "bb8dc5d0" -} -func (*IPReassemblyEnableDisable) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPReassemblyEnableDisableReply represents VPP binary API message 'ip_reassembly_enable_disable_reply': -type IPReassemblyEnableDisableReply struct { - Retval int32 -} - -func (*IPReassemblyEnableDisableReply) GetMessageName() string { - return "ip_reassembly_enable_disable_reply" -} -func (*IPReassemblyEnableDisableReply) GetCrcString() string { - return "e8d4e804" -} -func (*IPReassemblyEnableDisableReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPReassemblyGet represents VPP binary API message 'ip_reassembly_get': -type IPReassemblyGet struct { - IsIP6 uint8 -} - -func (*IPReassemblyGet) GetMessageName() string { - return "ip_reassembly_get" -} -func (*IPReassemblyGet) GetCrcString() string { - return "6fe91190" -} -func (*IPReassemblyGet) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPReassemblyGetReply represents VPP binary API message 'ip_reassembly_get_reply': -type IPReassemblyGetReply struct { - Retval int32 - TimeoutMs uint32 - MaxReassemblies uint32 - ExpireWalkIntervalMs uint32 - IsIP6 uint8 -} - -func (*IPReassemblyGetReply) GetMessageName() string { - return "ip_reassembly_get_reply" -} -func (*IPReassemblyGetReply) GetCrcString() string { - return "1f90afd1" -} -func (*IPReassemblyGetReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPReassemblySet represents VPP binary API message 'ip_reassembly_set': -type IPReassemblySet struct { - TimeoutMs uint32 - MaxReassemblies uint32 - ExpireWalkIntervalMs uint32 - IsIP6 uint8 -} - -func (*IPReassemblySet) GetMessageName() string { - return "ip_reassembly_set" -} -func (*IPReassemblySet) GetCrcString() string { - return "1db184de" -} -func (*IPReassemblySet) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPReassemblySetReply represents VPP binary API message 'ip_reassembly_set_reply': -type IPReassemblySetReply struct { - Retval int32 -} - -func (*IPReassemblySetReply) GetMessageName() string { - return "ip_reassembly_set_reply" -} -func (*IPReassemblySetReply) GetCrcString() string { - return "e8d4e804" -} -func (*IPReassemblySetReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPScanNeighborEnableDisable represents VPP binary API message 'ip_scan_neighbor_enable_disable': -type IPScanNeighborEnableDisable struct { - Mode uint8 - ScanInterval uint8 - MaxProcTime uint8 - MaxUpdate uint8 - ScanIntDelay uint8 - StaleThreshold uint8 -} - -func (*IPScanNeighborEnableDisable) GetMessageName() string { - return "ip_scan_neighbor_enable_disable" -} -func (*IPScanNeighborEnableDisable) GetCrcString() string { - return "0a6bf57a" -} -func (*IPScanNeighborEnableDisable) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPScanNeighborEnableDisableReply represents VPP binary API message 'ip_scan_neighbor_enable_disable_reply': -type IPScanNeighborEnableDisableReply struct { - Retval int32 -} - -func (*IPScanNeighborEnableDisableReply) GetMessageName() string { - return "ip_scan_neighbor_enable_disable_reply" -} -func (*IPScanNeighborEnableDisableReply) GetCrcString() string { - return "e8d4e804" -} -func (*IPScanNeighborEnableDisableReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPSourceAndPortRangeCheckAddDel represents VPP binary API message 'ip_source_and_port_range_check_add_del': -type IPSourceAndPortRangeCheckAddDel struct { - IsIPv6 uint8 - IsAdd uint8 - MaskLength uint8 - Address []byte `struc:"[16]byte"` - NumberOfRanges uint8 - LowPorts []uint16 `struc:"[32]uint16"` - HighPorts []uint16 `struc:"[32]uint16"` - VrfID uint32 -} - -func (*IPSourceAndPortRangeCheckAddDel) GetMessageName() string { - return "ip_source_and_port_range_check_add_del" -} -func (*IPSourceAndPortRangeCheckAddDel) GetCrcString() string { - return "03d6b03a" -} -func (*IPSourceAndPortRangeCheckAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPSourceAndPortRangeCheckAddDelReply represents VPP binary API message 'ip_source_and_port_range_check_add_del_reply': -type IPSourceAndPortRangeCheckAddDelReply struct { - Retval int32 -} - -func (*IPSourceAndPortRangeCheckAddDelReply) GetMessageName() string { - return "ip_source_and_port_range_check_add_del_reply" -} -func (*IPSourceAndPortRangeCheckAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*IPSourceAndPortRangeCheckAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPSourceAndPortRangeCheckInterfaceAddDel represents VPP binary API message 'ip_source_and_port_range_check_interface_add_del': -type IPSourceAndPortRangeCheckInterfaceAddDel struct { - IsAdd uint8 - SwIfIndex uint32 - TCPInVrfID uint32 - TCPOutVrfID uint32 - UDPInVrfID uint32 - UDPOutVrfID uint32 -} - -func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetMessageName() string { - return "ip_source_and_port_range_check_interface_add_del" -} -func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetCrcString() string { - return "6966bc44" -} -func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPSourceAndPortRangeCheckInterfaceAddDelReply represents VPP binary API message 'ip_source_and_port_range_check_interface_add_del_reply': -type IPSourceAndPortRangeCheckInterfaceAddDelReply struct { - Retval int32 -} - -func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetMessageName() string { - return "ip_source_and_port_range_check_interface_add_del_reply" -} -func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPTableAddDel represents VPP binary API message 'ip_table_add_del': -type IPTableAddDel struct { - TableID uint32 - IsIPv6 uint8 - IsAdd uint8 - Name []byte `struc:"[64]byte"` -} - -func (*IPTableAddDel) GetMessageName() string { - return "ip_table_add_del" -} -func (*IPTableAddDel) GetCrcString() string { - return "0240c89d" -} -func (*IPTableAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IPTableAddDelReply represents VPP binary API message 'ip_table_add_del_reply': -type IPTableAddDelReply struct { - Retval int32 -} - -func (*IPTableAddDelReply) GetMessageName() string { - return "ip_table_add_del_reply" -} -func (*IPTableAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*IPTableAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPUnnumberedDetails represents VPP binary API message 'ip_unnumbered_details': -type IPUnnumberedDetails struct { - SwIfIndex uint32 - IPSwIfIndex uint32 -} - -func (*IPUnnumberedDetails) GetMessageName() string { - return "ip_unnumbered_details" -} -func (*IPUnnumberedDetails) GetCrcString() string { - return "ae694cf4" -} -func (*IPUnnumberedDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IPUnnumberedDump represents VPP binary API message 'ip_unnumbered_dump': -type IPUnnumberedDump struct { - SwIfIndex uint32 -} - -func (*IPUnnumberedDump) GetMessageName() string { - return "ip_unnumbered_dump" -} -func (*IPUnnumberedDump) GetCrcString() string { - return "529cb13f" -} -func (*IPUnnumberedDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// MfibSignalDetails represents VPP binary API message 'mfib_signal_details': -type MfibSignalDetails struct { - SwIfIndex uint32 - TableID uint32 - GrpAddressLen uint16 - GrpAddress []byte `struc:"[16]byte"` - SrcAddress []byte `struc:"[16]byte"` - IPPacketLen uint16 - IPPacketData []byte `struc:"[256]byte"` -} - -func (*MfibSignalDetails) GetMessageName() string { - return "mfib_signal_details" -} -func (*MfibSignalDetails) GetCrcString() string { - return "3f5f03f5" -} -func (*MfibSignalDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MfibSignalDump represents VPP binary API message 'mfib_signal_dump': -type MfibSignalDump struct{} - -func (*MfibSignalDump) GetMessageName() string { - return "mfib_signal_dump" -} -func (*MfibSignalDump) GetCrcString() string { - return "51077d14" -} -func (*MfibSignalDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ProxyArpAddDel represents VPP binary API message 'proxy_arp_add_del': -type ProxyArpAddDel struct { - IsAdd uint8 - Proxy ProxyArp -} - -func (*ProxyArpAddDel) GetMessageName() string { - return "proxy_arp_add_del" -} -func (*ProxyArpAddDel) GetCrcString() string { - return "227988d9" -} -func (*ProxyArpAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ProxyArpAddDelReply represents VPP binary API message 'proxy_arp_add_del_reply': -type ProxyArpAddDelReply struct { - Retval int32 -} - -func (*ProxyArpAddDelReply) GetMessageName() string { - return "proxy_arp_add_del_reply" -} -func (*ProxyArpAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*ProxyArpAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ProxyArpDetails represents VPP binary API message 'proxy_arp_details': -type ProxyArpDetails struct { - Proxy ProxyArp -} - -func (*ProxyArpDetails) GetMessageName() string { - return "proxy_arp_details" -} -func (*ProxyArpDetails) GetCrcString() string { - return "9b707c77" -} -func (*ProxyArpDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ProxyArpDump represents VPP binary API message 'proxy_arp_dump': -type ProxyArpDump struct{} - -func (*ProxyArpDump) GetMessageName() string { - return "proxy_arp_dump" -} -func (*ProxyArpDump) GetCrcString() string { - return "51077d14" -} -func (*ProxyArpDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ProxyArpIntfcDetails represents VPP binary API message 'proxy_arp_intfc_details': -type ProxyArpIntfcDetails struct { - SwIfIndex uint32 -} - -func (*ProxyArpIntfcDetails) GetMessageName() string { - return "proxy_arp_intfc_details" -} -func (*ProxyArpIntfcDetails) GetCrcString() string { - return "f6458e5f" -} -func (*ProxyArpIntfcDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ProxyArpIntfcDump represents VPP binary API message 'proxy_arp_intfc_dump': -type ProxyArpIntfcDump struct{} - -func (*ProxyArpIntfcDump) GetMessageName() string { - return "proxy_arp_intfc_dump" -} -func (*ProxyArpIntfcDump) GetCrcString() string { - return "51077d14" -} -func (*ProxyArpIntfcDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ProxyArpIntfcEnableDisable represents VPP binary API message 'proxy_arp_intfc_enable_disable': -type ProxyArpIntfcEnableDisable struct { - SwIfIndex uint32 - EnableDisable uint8 -} - -func (*ProxyArpIntfcEnableDisable) GetMessageName() string { - return "proxy_arp_intfc_enable_disable" -} -func (*ProxyArpIntfcEnableDisable) GetCrcString() string { - return "69d24598" -} -func (*ProxyArpIntfcEnableDisable) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ProxyArpIntfcEnableDisableReply represents VPP binary API message 'proxy_arp_intfc_enable_disable_reply': -type ProxyArpIntfcEnableDisableReply struct { - Retval int32 -} - -func (*ProxyArpIntfcEnableDisableReply) GetMessageName() string { - return "proxy_arp_intfc_enable_disable_reply" -} -func (*ProxyArpIntfcEnableDisableReply) GetCrcString() string { - return "e8d4e804" -} -func (*ProxyArpIntfcEnableDisableReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ResetFib represents VPP binary API message 'reset_fib': -type ResetFib struct { - VrfID uint32 - IsIPv6 uint8 -} - -func (*ResetFib) GetMessageName() string { - return "reset_fib" -} -func (*ResetFib) GetCrcString() string { - return "8553ebd9" -} -func (*ResetFib) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ResetFibReply represents VPP binary API message 'reset_fib_reply': -type ResetFibReply struct { - Retval int32 -} - -func (*ResetFibReply) GetMessageName() string { - return "reset_fib_reply" -} -func (*ResetFibReply) GetCrcString() string { - return "e8d4e804" -} -func (*ResetFibReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SetArpNeighborLimit represents VPP binary API message 'set_arp_neighbor_limit': -type SetArpNeighborLimit struct { - IsIPv6 uint8 - ArpNeighborLimit uint32 -} - -func (*SetArpNeighborLimit) GetMessageName() string { - return "set_arp_neighbor_limit" -} -func (*SetArpNeighborLimit) GetCrcString() string { - return "97d01fd6" -} -func (*SetArpNeighborLimit) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SetArpNeighborLimitReply represents VPP binary API message 'set_arp_neighbor_limit_reply': -type SetArpNeighborLimitReply struct { - Retval int32 -} - -func (*SetArpNeighborLimitReply) GetMessageName() string { - return "set_arp_neighbor_limit_reply" -} -func (*SetArpNeighborLimitReply) GetCrcString() string { - return "e8d4e804" -} -func (*SetArpNeighborLimitReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SetIPFlowHash represents VPP binary API message 'set_ip_flow_hash': -type SetIPFlowHash struct { - VrfID uint32 - IsIPv6 uint8 - Src uint8 - Dst uint8 - Sport uint8 - Dport uint8 - Proto uint8 - Reverse uint8 -} - -func (*SetIPFlowHash) GetMessageName() string { - return "set_ip_flow_hash" -} -func (*SetIPFlowHash) GetCrcString() string { - return "32ebf737" -} -func (*SetIPFlowHash) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SetIPFlowHashReply represents VPP binary API message 'set_ip_flow_hash_reply': -type SetIPFlowHashReply struct { - Retval int32 -} - -func (*SetIPFlowHashReply) GetMessageName() string { - return "set_ip_flow_hash_reply" -} -func (*SetIPFlowHashReply) GetCrcString() string { - return "e8d4e804" -} -func (*SetIPFlowHashReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceIP6EnableDisable represents VPP binary API message 'sw_interface_ip6_enable_disable': -type SwInterfaceIP6EnableDisable struct { - SwIfIndex uint32 - Enable uint8 -} - -func (*SwInterfaceIP6EnableDisable) GetMessageName() string { - return "sw_interface_ip6_enable_disable" -} -func (*SwInterfaceIP6EnableDisable) GetCrcString() string { - return "a36fadc0" -} -func (*SwInterfaceIP6EnableDisable) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceIP6EnableDisableReply represents VPP binary API message 'sw_interface_ip6_enable_disable_reply': -type SwInterfaceIP6EnableDisableReply struct { - Retval int32 -} - -func (*SwInterfaceIP6EnableDisableReply) GetMessageName() string { - return "sw_interface_ip6_enable_disable_reply" -} -func (*SwInterfaceIP6EnableDisableReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceIP6EnableDisableReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceIP6SetLinkLocalAddress represents VPP binary API message 'sw_interface_ip6_set_link_local_address': -type SwInterfaceIP6SetLinkLocalAddress struct { - SwIfIndex uint32 - Address []byte `struc:"[16]byte"` -} - -func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageName() string { - return "sw_interface_ip6_set_link_local_address" -} -func (*SwInterfaceIP6SetLinkLocalAddress) GetCrcString() string { - return "d73bf1ab" -} -func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceIP6SetLinkLocalAddressReply represents VPP binary API message 'sw_interface_ip6_set_link_local_address_reply': -type SwInterfaceIP6SetLinkLocalAddressReply struct { - Retval int32 -} - -func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageName() string { - return "sw_interface_ip6_set_link_local_address_reply" -} -func (*SwInterfaceIP6SetLinkLocalAddressReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceIP6ndRaConfig represents VPP binary API message 'sw_interface_ip6nd_ra_config': -type SwInterfaceIP6ndRaConfig struct { - SwIfIndex uint32 - Suppress uint8 - Managed uint8 - Other uint8 - LlOption uint8 - SendUnicast uint8 - Cease uint8 - IsNo uint8 - DefaultRouter uint8 - MaxInterval uint32 - MinInterval uint32 - Lifetime uint32 - InitialCount uint32 - InitialInterval uint32 -} - -func (*SwInterfaceIP6ndRaConfig) GetMessageName() string { - return "sw_interface_ip6nd_ra_config" -} -func (*SwInterfaceIP6ndRaConfig) GetCrcString() string { - return "c3f02daa" -} -func (*SwInterfaceIP6ndRaConfig) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceIP6ndRaConfigReply represents VPP binary API message 'sw_interface_ip6nd_ra_config_reply': -type SwInterfaceIP6ndRaConfigReply struct { - Retval int32 -} - -func (*SwInterfaceIP6ndRaConfigReply) GetMessageName() string { - return "sw_interface_ip6nd_ra_config_reply" -} -func (*SwInterfaceIP6ndRaConfigReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceIP6ndRaConfigReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceIP6ndRaPrefix represents VPP binary API message 'sw_interface_ip6nd_ra_prefix': -type SwInterfaceIP6ndRaPrefix struct { - SwIfIndex uint32 - Address []byte `struc:"[16]byte"` - AddressLength uint8 - UseDefault uint8 - NoAdvertise uint8 - OffLink uint8 - NoAutoconfig uint8 - NoOnlink uint8 - IsNo uint8 - ValLifetime uint32 - PrefLifetime uint32 -} - -func (*SwInterfaceIP6ndRaPrefix) GetMessageName() string { - return "sw_interface_ip6nd_ra_prefix" -} -func (*SwInterfaceIP6ndRaPrefix) GetCrcString() string { - return "ca763c9a" -} -func (*SwInterfaceIP6ndRaPrefix) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceIP6ndRaPrefixReply represents VPP binary API message 'sw_interface_ip6nd_ra_prefix_reply': -type SwInterfaceIP6ndRaPrefixReply struct { - Retval int32 -} - -func (*SwInterfaceIP6ndRaPrefixReply) GetMessageName() string { - return "sw_interface_ip6nd_ra_prefix_reply" -} -func (*SwInterfaceIP6ndRaPrefixReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceIP6ndRaPrefixReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// WantIP4ArpEvents represents VPP binary API message 'want_ip4_arp_events': -type WantIP4ArpEvents struct { - EnableDisable uint8 - PID uint32 - Address uint32 -} - -func (*WantIP4ArpEvents) GetMessageName() string { - return "want_ip4_arp_events" -} -func (*WantIP4ArpEvents) GetCrcString() string { - return "77e06379" -} -func (*WantIP4ArpEvents) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// WantIP4ArpEventsReply represents VPP binary API message 'want_ip4_arp_events_reply': -type WantIP4ArpEventsReply struct { - Retval int32 -} - -func (*WantIP4ArpEventsReply) GetMessageName() string { - return "want_ip4_arp_events_reply" -} -func (*WantIP4ArpEventsReply) GetCrcString() string { - return "e8d4e804" -} -func (*WantIP4ArpEventsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// WantIP6NdEvents represents VPP binary API message 'want_ip6_nd_events': -type WantIP6NdEvents struct { - EnableDisable uint8 - PID uint32 - Address []byte `struc:"[16]byte"` -} - -func (*WantIP6NdEvents) GetMessageName() string { - return "want_ip6_nd_events" -} -func (*WantIP6NdEvents) GetCrcString() string { - return "1cf65fbb" -} -func (*WantIP6NdEvents) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// WantIP6NdEventsReply represents VPP binary API message 'want_ip6_nd_events_reply': -type WantIP6NdEventsReply struct { - Retval int32 -} - -func (*WantIP6NdEventsReply) GetMessageName() string { - return "want_ip6_nd_events_reply" -} -func (*WantIP6NdEventsReply) GetCrcString() string { - return "e8d4e804" -} -func (*WantIP6NdEventsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// WantIP6RaEvents represents VPP binary API message 'want_ip6_ra_events': -type WantIP6RaEvents struct { - EnableDisable uint8 - PID uint32 -} - -func (*WantIP6RaEvents) GetMessageName() string { - return "want_ip6_ra_events" -} -func (*WantIP6RaEvents) GetCrcString() string { - return "05b454b5" -} -func (*WantIP6RaEvents) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// WantIP6RaEventsReply represents VPP binary API message 'want_ip6_ra_events_reply': -type WantIP6RaEventsReply struct { - Retval int32 -} - -func (*WantIP6RaEventsReply) GetMessageName() string { - return "want_ip6_ra_events_reply" -} -func (*WantIP6RaEventsReply) GetCrcString() string { - return "e8d4e804" -} -func (*WantIP6RaEventsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func init() { - api.RegisterMessage((*IoamDisable)(nil), "ip.IoamDisable") - api.RegisterMessage((*IoamDisableReply)(nil), "ip.IoamDisableReply") - api.RegisterMessage((*IoamEnable)(nil), "ip.IoamEnable") - api.RegisterMessage((*IoamEnableReply)(nil), "ip.IoamEnableReply") - api.RegisterMessage((*IP4ArpEvent)(nil), "ip.IP4ArpEvent") - api.RegisterMessage((*IP6FibDetails)(nil), "ip.IP6FibDetails") - api.RegisterMessage((*IP6FibDump)(nil), "ip.IP6FibDump") - api.RegisterMessage((*IP6MfibDetails)(nil), "ip.IP6MfibDetails") - api.RegisterMessage((*IP6MfibDump)(nil), "ip.IP6MfibDump") - api.RegisterMessage((*IP6NdEvent)(nil), "ip.IP6NdEvent") - api.RegisterMessage((*IP6RaEvent)(nil), "ip.IP6RaEvent") - api.RegisterMessage((*IP6ndProxyAddDel)(nil), "ip.IP6ndProxyAddDel") - api.RegisterMessage((*IP6ndProxyAddDelReply)(nil), "ip.IP6ndProxyAddDelReply") - api.RegisterMessage((*IP6ndProxyDetails)(nil), "ip.IP6ndProxyDetails") - api.RegisterMessage((*IP6ndProxyDump)(nil), "ip.IP6ndProxyDump") - api.RegisterMessage((*IP6ndSendRouterSolicitation)(nil), "ip.IP6ndSendRouterSolicitation") - api.RegisterMessage((*IP6ndSendRouterSolicitationReply)(nil), "ip.IP6ndSendRouterSolicitationReply") - api.RegisterMessage((*IPAddDelRoute)(nil), "ip.IPAddDelRoute") - api.RegisterMessage((*IPAddDelRouteReply)(nil), "ip.IPAddDelRouteReply") - api.RegisterMessage((*IPAddressDetails)(nil), "ip.IPAddressDetails") - api.RegisterMessage((*IPAddressDump)(nil), "ip.IPAddressDump") - api.RegisterMessage((*IPContainerProxyAddDel)(nil), "ip.IPContainerProxyAddDel") - api.RegisterMessage((*IPContainerProxyAddDelReply)(nil), "ip.IPContainerProxyAddDelReply") - api.RegisterMessage((*IPDetails)(nil), "ip.IPDetails") - api.RegisterMessage((*IPDump)(nil), "ip.IPDump") - api.RegisterMessage((*IPFibDetails)(nil), "ip.IPFibDetails") - api.RegisterMessage((*IPFibDump)(nil), "ip.IPFibDump") - api.RegisterMessage((*IPMfibDetails)(nil), "ip.IPMfibDetails") - api.RegisterMessage((*IPMfibDump)(nil), "ip.IPMfibDump") - api.RegisterMessage((*IPMrouteAddDel)(nil), "ip.IPMrouteAddDel") - api.RegisterMessage((*IPMrouteAddDelReply)(nil), "ip.IPMrouteAddDelReply") - api.RegisterMessage((*IPNeighborAddDel)(nil), "ip.IPNeighborAddDel") - api.RegisterMessage((*IPNeighborAddDelReply)(nil), "ip.IPNeighborAddDelReply") - api.RegisterMessage((*IPNeighborDetails)(nil), "ip.IPNeighborDetails") - api.RegisterMessage((*IPNeighborDump)(nil), "ip.IPNeighborDump") - api.RegisterMessage((*IPProbeNeighbor)(nil), "ip.IPProbeNeighbor") - api.RegisterMessage((*IPProbeNeighborReply)(nil), "ip.IPProbeNeighborReply") - api.RegisterMessage((*IPPuntPolice)(nil), "ip.IPPuntPolice") - api.RegisterMessage((*IPPuntPoliceReply)(nil), "ip.IPPuntPoliceReply") - api.RegisterMessage((*IPPuntRedirect)(nil), "ip.IPPuntRedirect") - api.RegisterMessage((*IPPuntRedirectReply)(nil), "ip.IPPuntRedirectReply") - api.RegisterMessage((*IPReassemblyEnableDisable)(nil), "ip.IPReassemblyEnableDisable") - api.RegisterMessage((*IPReassemblyEnableDisableReply)(nil), "ip.IPReassemblyEnableDisableReply") - api.RegisterMessage((*IPReassemblyGet)(nil), "ip.IPReassemblyGet") - api.RegisterMessage((*IPReassemblyGetReply)(nil), "ip.IPReassemblyGetReply") - api.RegisterMessage((*IPReassemblySet)(nil), "ip.IPReassemblySet") - api.RegisterMessage((*IPReassemblySetReply)(nil), "ip.IPReassemblySetReply") - api.RegisterMessage((*IPScanNeighborEnableDisable)(nil), "ip.IPScanNeighborEnableDisable") - api.RegisterMessage((*IPScanNeighborEnableDisableReply)(nil), "ip.IPScanNeighborEnableDisableReply") - api.RegisterMessage((*IPSourceAndPortRangeCheckAddDel)(nil), "ip.IPSourceAndPortRangeCheckAddDel") - api.RegisterMessage((*IPSourceAndPortRangeCheckAddDelReply)(nil), "ip.IPSourceAndPortRangeCheckAddDelReply") - api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDel)(nil), "ip.IPSourceAndPortRangeCheckInterfaceAddDel") - api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil), "ip.IPSourceAndPortRangeCheckInterfaceAddDelReply") - api.RegisterMessage((*IPTableAddDel)(nil), "ip.IPTableAddDel") - api.RegisterMessage((*IPTableAddDelReply)(nil), "ip.IPTableAddDelReply") - api.RegisterMessage((*IPUnnumberedDetails)(nil), "ip.IPUnnumberedDetails") - api.RegisterMessage((*IPUnnumberedDump)(nil), "ip.IPUnnumberedDump") - api.RegisterMessage((*MfibSignalDetails)(nil), "ip.MfibSignalDetails") - api.RegisterMessage((*MfibSignalDump)(nil), "ip.MfibSignalDump") - api.RegisterMessage((*ProxyArpAddDel)(nil), "ip.ProxyArpAddDel") - api.RegisterMessage((*ProxyArpAddDelReply)(nil), "ip.ProxyArpAddDelReply") - api.RegisterMessage((*ProxyArpDetails)(nil), "ip.ProxyArpDetails") - api.RegisterMessage((*ProxyArpDump)(nil), "ip.ProxyArpDump") - api.RegisterMessage((*ProxyArpIntfcDetails)(nil), "ip.ProxyArpIntfcDetails") - api.RegisterMessage((*ProxyArpIntfcDump)(nil), "ip.ProxyArpIntfcDump") - api.RegisterMessage((*ProxyArpIntfcEnableDisable)(nil), "ip.ProxyArpIntfcEnableDisable") - api.RegisterMessage((*ProxyArpIntfcEnableDisableReply)(nil), "ip.ProxyArpIntfcEnableDisableReply") - api.RegisterMessage((*ResetFib)(nil), "ip.ResetFib") - api.RegisterMessage((*ResetFibReply)(nil), "ip.ResetFibReply") - api.RegisterMessage((*SetArpNeighborLimit)(nil), "ip.SetArpNeighborLimit") - api.RegisterMessage((*SetArpNeighborLimitReply)(nil), "ip.SetArpNeighborLimitReply") - api.RegisterMessage((*SetIPFlowHash)(nil), "ip.SetIPFlowHash") - api.RegisterMessage((*SetIPFlowHashReply)(nil), "ip.SetIPFlowHashReply") - api.RegisterMessage((*SwInterfaceIP6EnableDisable)(nil), "ip.SwInterfaceIP6EnableDisable") - api.RegisterMessage((*SwInterfaceIP6EnableDisableReply)(nil), "ip.SwInterfaceIP6EnableDisableReply") - api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddress)(nil), "ip.SwInterfaceIP6SetLinkLocalAddress") - api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddressReply)(nil), "ip.SwInterfaceIP6SetLinkLocalAddressReply") - api.RegisterMessage((*SwInterfaceIP6ndRaConfig)(nil), "ip.SwInterfaceIP6ndRaConfig") - api.RegisterMessage((*SwInterfaceIP6ndRaConfigReply)(nil), "ip.SwInterfaceIP6ndRaConfigReply") - api.RegisterMessage((*SwInterfaceIP6ndRaPrefix)(nil), "ip.SwInterfaceIP6ndRaPrefix") - api.RegisterMessage((*SwInterfaceIP6ndRaPrefixReply)(nil), "ip.SwInterfaceIP6ndRaPrefixReply") - api.RegisterMessage((*WantIP4ArpEvents)(nil), "ip.WantIP4ArpEvents") - api.RegisterMessage((*WantIP4ArpEventsReply)(nil), "ip.WantIP4ArpEventsReply") - api.RegisterMessage((*WantIP6NdEvents)(nil), "ip.WantIP6NdEvents") - api.RegisterMessage((*WantIP6NdEventsReply)(nil), "ip.WantIP6NdEventsReply") - api.RegisterMessage((*WantIP6RaEvents)(nil), "ip.WantIP6RaEvents") - api.RegisterMessage((*WantIP6RaEventsReply)(nil), "ip.WantIP6RaEventsReply") -} - -var Messages = []api.Message{ - (*IoamDisable)(nil), - (*IoamDisableReply)(nil), - (*IoamEnable)(nil), - (*IoamEnableReply)(nil), - (*IP4ArpEvent)(nil), - (*IP6FibDetails)(nil), - (*IP6FibDump)(nil), - (*IP6MfibDetails)(nil), - (*IP6MfibDump)(nil), - (*IP6NdEvent)(nil), - (*IP6RaEvent)(nil), - (*IP6ndProxyAddDel)(nil), - (*IP6ndProxyAddDelReply)(nil), - (*IP6ndProxyDetails)(nil), - (*IP6ndProxyDump)(nil), - (*IP6ndSendRouterSolicitation)(nil), - (*IP6ndSendRouterSolicitationReply)(nil), - (*IPAddDelRoute)(nil), - (*IPAddDelRouteReply)(nil), - (*IPAddressDetails)(nil), - (*IPAddressDump)(nil), - (*IPContainerProxyAddDel)(nil), - (*IPContainerProxyAddDelReply)(nil), - (*IPDetails)(nil), - (*IPDump)(nil), - (*IPFibDetails)(nil), - (*IPFibDump)(nil), - (*IPMfibDetails)(nil), - (*IPMfibDump)(nil), - (*IPMrouteAddDel)(nil), - (*IPMrouteAddDelReply)(nil), - (*IPNeighborAddDel)(nil), - (*IPNeighborAddDelReply)(nil), - (*IPNeighborDetails)(nil), - (*IPNeighborDump)(nil), - (*IPProbeNeighbor)(nil), - (*IPProbeNeighborReply)(nil), - (*IPPuntPolice)(nil), - (*IPPuntPoliceReply)(nil), - (*IPPuntRedirect)(nil), - (*IPPuntRedirectReply)(nil), - (*IPReassemblyEnableDisable)(nil), - (*IPReassemblyEnableDisableReply)(nil), - (*IPReassemblyGet)(nil), - (*IPReassemblyGetReply)(nil), - (*IPReassemblySet)(nil), - (*IPReassemblySetReply)(nil), - (*IPScanNeighborEnableDisable)(nil), - (*IPScanNeighborEnableDisableReply)(nil), - (*IPSourceAndPortRangeCheckAddDel)(nil), - (*IPSourceAndPortRangeCheckAddDelReply)(nil), - (*IPSourceAndPortRangeCheckInterfaceAddDel)(nil), - (*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil), - (*IPTableAddDel)(nil), - (*IPTableAddDelReply)(nil), - (*IPUnnumberedDetails)(nil), - (*IPUnnumberedDump)(nil), - (*MfibSignalDetails)(nil), - (*MfibSignalDump)(nil), - (*ProxyArpAddDel)(nil), - (*ProxyArpAddDelReply)(nil), - (*ProxyArpDetails)(nil), - (*ProxyArpDump)(nil), - (*ProxyArpIntfcDetails)(nil), - (*ProxyArpIntfcDump)(nil), - (*ProxyArpIntfcEnableDisable)(nil), - (*ProxyArpIntfcEnableDisableReply)(nil), - (*ResetFib)(nil), - (*ResetFibReply)(nil), - (*SetArpNeighborLimit)(nil), - (*SetArpNeighborLimitReply)(nil), - (*SetIPFlowHash)(nil), - (*SetIPFlowHashReply)(nil), - (*SwInterfaceIP6EnableDisable)(nil), - (*SwInterfaceIP6EnableDisableReply)(nil), - (*SwInterfaceIP6SetLinkLocalAddress)(nil), - (*SwInterfaceIP6SetLinkLocalAddressReply)(nil), - (*SwInterfaceIP6ndRaConfig)(nil), - (*SwInterfaceIP6ndRaConfigReply)(nil), - (*SwInterfaceIP6ndRaPrefix)(nil), - (*SwInterfaceIP6ndRaPrefixReply)(nil), - (*WantIP4ArpEvents)(nil), - (*WantIP4ArpEventsReply)(nil), - (*WantIP6NdEvents)(nil), - (*WantIP6NdEventsReply)(nil), - (*WantIP6RaEvents)(nil), - (*WantIP6RaEventsReply)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ipsec/ipsec.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ipsec/ipsec.ba.go deleted file mode 100644 index eb22f45e66..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ipsec/ipsec.ba.go +++ /dev/null @@ -1,1040 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/ipsec.api.json - -/* - Package ipsec is a generated from VPP binary API module 'ipsec'. - - It contains following objects: - 25 services - 50 messages -*/ -package ipsec - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpIpsecSa(*IpsecSaDump) ([]*IpsecSaDetails, error) - DumpIpsecSpd(*IpsecSpdDump) ([]*IpsecSpdDetails, error) - DumpIpsecSpdInterface(*IpsecSpdInterfaceDump) ([]*IpsecSpdInterfaceDetails, error) - DumpIpsecSpds(*IpsecSpdsDump) ([]*IpsecSpdsDetails, error) - Ikev2InitiateDelChildSa(*Ikev2InitiateDelChildSa) (*Ikev2InitiateDelChildSaReply, error) - Ikev2InitiateDelIkeSa(*Ikev2InitiateDelIkeSa) (*Ikev2InitiateDelIkeSaReply, error) - Ikev2InitiateRekeyChildSa(*Ikev2InitiateRekeyChildSa) (*Ikev2InitiateRekeyChildSaReply, error) - Ikev2InitiateSaInit(*Ikev2InitiateSaInit) (*Ikev2InitiateSaInitReply, error) - Ikev2ProfileAddDel(*Ikev2ProfileAddDel) (*Ikev2ProfileAddDelReply, error) - Ikev2ProfileSetAuth(*Ikev2ProfileSetAuth) (*Ikev2ProfileSetAuthReply, error) - Ikev2ProfileSetID(*Ikev2ProfileSetID) (*Ikev2ProfileSetIDReply, error) - Ikev2ProfileSetTs(*Ikev2ProfileSetTs) (*Ikev2ProfileSetTsReply, error) - Ikev2SetEspTransforms(*Ikev2SetEspTransforms) (*Ikev2SetEspTransformsReply, error) - Ikev2SetIkeTransforms(*Ikev2SetIkeTransforms) (*Ikev2SetIkeTransformsReply, error) - Ikev2SetLocalKey(*Ikev2SetLocalKey) (*Ikev2SetLocalKeyReply, error) - Ikev2SetResponder(*Ikev2SetResponder) (*Ikev2SetResponderReply, error) - Ikev2SetSaLifetime(*Ikev2SetSaLifetime) (*Ikev2SetSaLifetimeReply, error) - IpsecInterfaceAddDelSpd(*IpsecInterfaceAddDelSpd) (*IpsecInterfaceAddDelSpdReply, error) - IpsecSaSetKey(*IpsecSaSetKey) (*IpsecSaSetKeyReply, error) - IpsecSadAddDelEntry(*IpsecSadAddDelEntry) (*IpsecSadAddDelEntryReply, error) - IpsecSpdAddDel(*IpsecSpdAddDel) (*IpsecSpdAddDelReply, error) - IpsecSpdAddDelEntry(*IpsecSpdAddDelEntry) (*IpsecSpdAddDelEntryReply, error) - IpsecTunnelIfAddDel(*IpsecTunnelIfAddDel) (*IpsecTunnelIfAddDelReply, error) - IpsecTunnelIfSetKey(*IpsecTunnelIfSetKey) (*IpsecTunnelIfSetKeyReply, error) - IpsecTunnelIfSetSa(*IpsecTunnelIfSetSa) (*IpsecTunnelIfSetSaReply, error) -} - -/* Messages */ - -// Ikev2InitiateDelChildSa represents VPP binary API message 'ikev2_initiate_del_child_sa': -type Ikev2InitiateDelChildSa struct { - Ispi uint32 -} - -func (*Ikev2InitiateDelChildSa) GetMessageName() string { - return "ikev2_initiate_del_child_sa" -} -func (*Ikev2InitiateDelChildSa) GetCrcString() string { - return "7f004d2e" -} -func (*Ikev2InitiateDelChildSa) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Ikev2InitiateDelChildSaReply represents VPP binary API message 'ikev2_initiate_del_child_sa_reply': -type Ikev2InitiateDelChildSaReply struct { - Retval int32 -} - -func (*Ikev2InitiateDelChildSaReply) GetMessageName() string { - return "ikev2_initiate_del_child_sa_reply" -} -func (*Ikev2InitiateDelChildSaReply) GetCrcString() string { - return "e8d4e804" -} -func (*Ikev2InitiateDelChildSaReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Ikev2InitiateDelIkeSa represents VPP binary API message 'ikev2_initiate_del_ike_sa': -type Ikev2InitiateDelIkeSa struct { - Ispi uint64 -} - -func (*Ikev2InitiateDelIkeSa) GetMessageName() string { - return "ikev2_initiate_del_ike_sa" -} -func (*Ikev2InitiateDelIkeSa) GetCrcString() string { - return "8d125bdd" -} -func (*Ikev2InitiateDelIkeSa) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Ikev2InitiateDelIkeSaReply represents VPP binary API message 'ikev2_initiate_del_ike_sa_reply': -type Ikev2InitiateDelIkeSaReply struct { - Retval int32 -} - -func (*Ikev2InitiateDelIkeSaReply) GetMessageName() string { - return "ikev2_initiate_del_ike_sa_reply" -} -func (*Ikev2InitiateDelIkeSaReply) GetCrcString() string { - return "e8d4e804" -} -func (*Ikev2InitiateDelIkeSaReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Ikev2InitiateRekeyChildSa represents VPP binary API message 'ikev2_initiate_rekey_child_sa': -type Ikev2InitiateRekeyChildSa struct { - Ispi uint32 -} - -func (*Ikev2InitiateRekeyChildSa) GetMessageName() string { - return "ikev2_initiate_rekey_child_sa" -} -func (*Ikev2InitiateRekeyChildSa) GetCrcString() string { - return "7f004d2e" -} -func (*Ikev2InitiateRekeyChildSa) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Ikev2InitiateRekeyChildSaReply represents VPP binary API message 'ikev2_initiate_rekey_child_sa_reply': -type Ikev2InitiateRekeyChildSaReply struct { - Retval int32 -} - -func (*Ikev2InitiateRekeyChildSaReply) GetMessageName() string { - return "ikev2_initiate_rekey_child_sa_reply" -} -func (*Ikev2InitiateRekeyChildSaReply) GetCrcString() string { - return "e8d4e804" -} -func (*Ikev2InitiateRekeyChildSaReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Ikev2InitiateSaInit represents VPP binary API message 'ikev2_initiate_sa_init': -type Ikev2InitiateSaInit struct { - Name []byte `struc:"[64]byte"` -} - -func (*Ikev2InitiateSaInit) GetMessageName() string { - return "ikev2_initiate_sa_init" -} -func (*Ikev2InitiateSaInit) GetCrcString() string { - return "0cb71b0e" -} -func (*Ikev2InitiateSaInit) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Ikev2InitiateSaInitReply represents VPP binary API message 'ikev2_initiate_sa_init_reply': -type Ikev2InitiateSaInitReply struct { - Retval int32 -} - -func (*Ikev2InitiateSaInitReply) GetMessageName() string { - return "ikev2_initiate_sa_init_reply" -} -func (*Ikev2InitiateSaInitReply) GetCrcString() string { - return "e8d4e804" -} -func (*Ikev2InitiateSaInitReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Ikev2ProfileAddDel represents VPP binary API message 'ikev2_profile_add_del': -type Ikev2ProfileAddDel struct { - Name []byte `struc:"[64]byte"` - IsAdd uint8 -} - -func (*Ikev2ProfileAddDel) GetMessageName() string { - return "ikev2_profile_add_del" -} -func (*Ikev2ProfileAddDel) GetCrcString() string { - return "405b222e" -} -func (*Ikev2ProfileAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Ikev2ProfileAddDelReply represents VPP binary API message 'ikev2_profile_add_del_reply': -type Ikev2ProfileAddDelReply struct { - Retval int32 -} - -func (*Ikev2ProfileAddDelReply) GetMessageName() string { - return "ikev2_profile_add_del_reply" -} -func (*Ikev2ProfileAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*Ikev2ProfileAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Ikev2ProfileSetAuth represents VPP binary API message 'ikev2_profile_set_auth': -type Ikev2ProfileSetAuth struct { - Name []byte `struc:"[64]byte"` - AuthMethod uint8 - IsHex uint8 - DataLen uint32 `struc:"sizeof=Data"` - Data []byte -} - -func (*Ikev2ProfileSetAuth) GetMessageName() string { - return "ikev2_profile_set_auth" -} -func (*Ikev2ProfileSetAuth) GetCrcString() string { - return "bd76f369" -} -func (*Ikev2ProfileSetAuth) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Ikev2ProfileSetAuthReply represents VPP binary API message 'ikev2_profile_set_auth_reply': -type Ikev2ProfileSetAuthReply struct { - Retval int32 -} - -func (*Ikev2ProfileSetAuthReply) GetMessageName() string { - return "ikev2_profile_set_auth_reply" -} -func (*Ikev2ProfileSetAuthReply) GetCrcString() string { - return "e8d4e804" -} -func (*Ikev2ProfileSetAuthReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Ikev2ProfileSetID represents VPP binary API message 'ikev2_profile_set_id': -type Ikev2ProfileSetID struct { - Name []byte `struc:"[64]byte"` - IsLocal uint8 - IDType uint8 - DataLen uint32 `struc:"sizeof=Data"` - Data []byte -} - -func (*Ikev2ProfileSetID) GetMessageName() string { - return "ikev2_profile_set_id" -} -func (*Ikev2ProfileSetID) GetCrcString() string { - return "ca88c0ef" -} -func (*Ikev2ProfileSetID) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Ikev2ProfileSetIDReply represents VPP binary API message 'ikev2_profile_set_id_reply': -type Ikev2ProfileSetIDReply struct { - Retval int32 -} - -func (*Ikev2ProfileSetIDReply) GetMessageName() string { - return "ikev2_profile_set_id_reply" -} -func (*Ikev2ProfileSetIDReply) GetCrcString() string { - return "e8d4e804" -} -func (*Ikev2ProfileSetIDReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Ikev2ProfileSetTs represents VPP binary API message 'ikev2_profile_set_ts': -type Ikev2ProfileSetTs struct { - Name []byte `struc:"[64]byte"` - IsLocal uint8 - Proto uint8 - StartPort uint16 - EndPort uint16 - StartAddr uint32 - EndAddr uint32 -} - -func (*Ikev2ProfileSetTs) GetMessageName() string { - return "ikev2_profile_set_ts" -} -func (*Ikev2ProfileSetTs) GetCrcString() string { - return "481aad89" -} -func (*Ikev2ProfileSetTs) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Ikev2ProfileSetTsReply represents VPP binary API message 'ikev2_profile_set_ts_reply': -type Ikev2ProfileSetTsReply struct { - Retval int32 -} - -func (*Ikev2ProfileSetTsReply) GetMessageName() string { - return "ikev2_profile_set_ts_reply" -} -func (*Ikev2ProfileSetTsReply) GetCrcString() string { - return "e8d4e804" -} -func (*Ikev2ProfileSetTsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Ikev2SetEspTransforms represents VPP binary API message 'ikev2_set_esp_transforms': -type Ikev2SetEspTransforms struct { - Name []byte `struc:"[64]byte"` - CryptoAlg uint32 - CryptoKeySize uint32 - IntegAlg uint32 - DhGroup uint32 -} - -func (*Ikev2SetEspTransforms) GetMessageName() string { - return "ikev2_set_esp_transforms" -} -func (*Ikev2SetEspTransforms) GetCrcString() string { - return "919f5efd" -} -func (*Ikev2SetEspTransforms) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Ikev2SetEspTransformsReply represents VPP binary API message 'ikev2_set_esp_transforms_reply': -type Ikev2SetEspTransformsReply struct { - Retval int32 -} - -func (*Ikev2SetEspTransformsReply) GetMessageName() string { - return "ikev2_set_esp_transforms_reply" -} -func (*Ikev2SetEspTransformsReply) GetCrcString() string { - return "e8d4e804" -} -func (*Ikev2SetEspTransformsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Ikev2SetIkeTransforms represents VPP binary API message 'ikev2_set_ike_transforms': -type Ikev2SetIkeTransforms struct { - Name []byte `struc:"[64]byte"` - CryptoAlg uint32 - CryptoKeySize uint32 - IntegAlg uint32 - DhGroup uint32 -} - -func (*Ikev2SetIkeTransforms) GetMessageName() string { - return "ikev2_set_ike_transforms" -} -func (*Ikev2SetIkeTransforms) GetCrcString() string { - return "919f5efd" -} -func (*Ikev2SetIkeTransforms) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Ikev2SetIkeTransformsReply represents VPP binary API message 'ikev2_set_ike_transforms_reply': -type Ikev2SetIkeTransformsReply struct { - Retval int32 -} - -func (*Ikev2SetIkeTransformsReply) GetMessageName() string { - return "ikev2_set_ike_transforms_reply" -} -func (*Ikev2SetIkeTransformsReply) GetCrcString() string { - return "e8d4e804" -} -func (*Ikev2SetIkeTransformsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Ikev2SetLocalKey represents VPP binary API message 'ikev2_set_local_key': -type Ikev2SetLocalKey struct { - KeyFile []byte `struc:"[256]byte"` -} - -func (*Ikev2SetLocalKey) GetMessageName() string { - return "ikev2_set_local_key" -} -func (*Ikev2SetLocalKey) GetCrcString() string { - return "e4996cd5" -} -func (*Ikev2SetLocalKey) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Ikev2SetLocalKeyReply represents VPP binary API message 'ikev2_set_local_key_reply': -type Ikev2SetLocalKeyReply struct { - Retval int32 -} - -func (*Ikev2SetLocalKeyReply) GetMessageName() string { - return "ikev2_set_local_key_reply" -} -func (*Ikev2SetLocalKeyReply) GetCrcString() string { - return "e8d4e804" -} -func (*Ikev2SetLocalKeyReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Ikev2SetResponder represents VPP binary API message 'ikev2_set_responder': -type Ikev2SetResponder struct { - Name []byte `struc:"[64]byte"` - SwIfIndex uint32 - Address []byte `struc:"[4]byte"` -} - -func (*Ikev2SetResponder) GetMessageName() string { - return "ikev2_set_responder" -} -func (*Ikev2SetResponder) GetCrcString() string { - return "a99996f3" -} -func (*Ikev2SetResponder) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Ikev2SetResponderReply represents VPP binary API message 'ikev2_set_responder_reply': -type Ikev2SetResponderReply struct { - Retval int32 -} - -func (*Ikev2SetResponderReply) GetMessageName() string { - return "ikev2_set_responder_reply" -} -func (*Ikev2SetResponderReply) GetCrcString() string { - return "e8d4e804" -} -func (*Ikev2SetResponderReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Ikev2SetSaLifetime represents VPP binary API message 'ikev2_set_sa_lifetime': -type Ikev2SetSaLifetime struct { - Name []byte `struc:"[64]byte"` - Lifetime uint64 - LifetimeJitter uint32 - Handover uint32 - LifetimeMaxdata uint64 -} - -func (*Ikev2SetSaLifetime) GetMessageName() string { - return "ikev2_set_sa_lifetime" -} -func (*Ikev2SetSaLifetime) GetCrcString() string { - return "46d31203" -} -func (*Ikev2SetSaLifetime) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Ikev2SetSaLifetimeReply represents VPP binary API message 'ikev2_set_sa_lifetime_reply': -type Ikev2SetSaLifetimeReply struct { - Retval int32 -} - -func (*Ikev2SetSaLifetimeReply) GetMessageName() string { - return "ikev2_set_sa_lifetime_reply" -} -func (*Ikev2SetSaLifetimeReply) GetCrcString() string { - return "e8d4e804" -} -func (*Ikev2SetSaLifetimeReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IpsecInterfaceAddDelSpd represents VPP binary API message 'ipsec_interface_add_del_spd': -type IpsecInterfaceAddDelSpd struct { - IsAdd uint8 - SwIfIndex uint32 - SpdID uint32 -} - -func (*IpsecInterfaceAddDelSpd) GetMessageName() string { - return "ipsec_interface_add_del_spd" -} -func (*IpsecInterfaceAddDelSpd) GetCrcString() string { - return "1e3b8286" -} -func (*IpsecInterfaceAddDelSpd) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IpsecInterfaceAddDelSpdReply represents VPP binary API message 'ipsec_interface_add_del_spd_reply': -type IpsecInterfaceAddDelSpdReply struct { - Retval int32 -} - -func (*IpsecInterfaceAddDelSpdReply) GetMessageName() string { - return "ipsec_interface_add_del_spd_reply" -} -func (*IpsecInterfaceAddDelSpdReply) GetCrcString() string { - return "e8d4e804" -} -func (*IpsecInterfaceAddDelSpdReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IpsecSaDetails represents VPP binary API message 'ipsec_sa_details': -type IpsecSaDetails struct { - SaID uint32 - SwIfIndex uint32 - Spi uint32 - Protocol uint8 - CryptoAlg uint8 - CryptoKeyLen uint8 - CryptoKey []byte `struc:"[128]byte"` - IntegAlg uint8 - IntegKeyLen uint8 - IntegKey []byte `struc:"[128]byte"` - UseEsn uint8 - UseAntiReplay uint8 - IsTunnel uint8 - IsTunnelIP6 uint8 - TunnelSrcAddr []byte `struc:"[16]byte"` - TunnelDstAddr []byte `struc:"[16]byte"` - Salt uint32 - SeqOutbound uint64 - LastSeqInbound uint64 - ReplayWindow uint64 - TotalDataSize uint64 - UDPEncap uint8 -} - -func (*IpsecSaDetails) GetMessageName() string { - return "ipsec_sa_details" -} -func (*IpsecSaDetails) GetCrcString() string { - return "dc927a3b" -} -func (*IpsecSaDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IpsecSaDump represents VPP binary API message 'ipsec_sa_dump': -type IpsecSaDump struct { - SaID uint32 -} - -func (*IpsecSaDump) GetMessageName() string { - return "ipsec_sa_dump" -} -func (*IpsecSaDump) GetCrcString() string { - return "2076c2f4" -} -func (*IpsecSaDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IpsecSaSetKey represents VPP binary API message 'ipsec_sa_set_key': -type IpsecSaSetKey struct { - SaID uint32 - CryptoKeyLength uint8 - CryptoKey []byte `struc:"[128]byte"` - IntegrityKeyLength uint8 - IntegrityKey []byte `struc:"[128]byte"` -} - -func (*IpsecSaSetKey) GetMessageName() string { - return "ipsec_sa_set_key" -} -func (*IpsecSaSetKey) GetCrcString() string { - return "93b4f08a" -} -func (*IpsecSaSetKey) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IpsecSaSetKeyReply represents VPP binary API message 'ipsec_sa_set_key_reply': -type IpsecSaSetKeyReply struct { - Retval int32 -} - -func (*IpsecSaSetKeyReply) GetMessageName() string { - return "ipsec_sa_set_key_reply" -} -func (*IpsecSaSetKeyReply) GetCrcString() string { - return "e8d4e804" -} -func (*IpsecSaSetKeyReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IpsecSadAddDelEntry represents VPP binary API message 'ipsec_sad_add_del_entry': -type IpsecSadAddDelEntry struct { - IsAdd uint8 - SadID uint32 - Spi uint32 - Protocol uint8 - CryptoAlgorithm uint8 - CryptoKeyLength uint8 - CryptoKey []byte `struc:"[128]byte"` - IntegrityAlgorithm uint8 - IntegrityKeyLength uint8 - IntegrityKey []byte `struc:"[128]byte"` - UseExtendedSequenceNumber uint8 - UseAntiReplay uint8 - IsTunnel uint8 - IsTunnelIPv6 uint8 - TunnelSrcAddress []byte `struc:"[16]byte"` - TunnelDstAddress []byte `struc:"[16]byte"` - UDPEncap uint8 -} - -func (*IpsecSadAddDelEntry) GetMessageName() string { - return "ipsec_sad_add_del_entry" -} -func (*IpsecSadAddDelEntry) GetCrcString() string { - return "306782b4" -} -func (*IpsecSadAddDelEntry) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IpsecSadAddDelEntryReply represents VPP binary API message 'ipsec_sad_add_del_entry_reply': -type IpsecSadAddDelEntryReply struct { - Retval int32 -} - -func (*IpsecSadAddDelEntryReply) GetMessageName() string { - return "ipsec_sad_add_del_entry_reply" -} -func (*IpsecSadAddDelEntryReply) GetCrcString() string { - return "e8d4e804" -} -func (*IpsecSadAddDelEntryReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IpsecSpdAddDel represents VPP binary API message 'ipsec_spd_add_del': -type IpsecSpdAddDel struct { - IsAdd uint8 - SpdID uint32 -} - -func (*IpsecSpdAddDel) GetMessageName() string { - return "ipsec_spd_add_del" -} -func (*IpsecSpdAddDel) GetCrcString() string { - return "9ffdf5da" -} -func (*IpsecSpdAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IpsecSpdAddDelEntry represents VPP binary API message 'ipsec_spd_add_del_entry': -type IpsecSpdAddDelEntry struct { - IsAdd uint8 - SpdID uint32 - Priority int32 - IsOutbound uint8 - IsIPv6 uint8 - IsIPAny uint8 - RemoteAddressStart []byte `struc:"[16]byte"` - RemoteAddressStop []byte `struc:"[16]byte"` - LocalAddressStart []byte `struc:"[16]byte"` - LocalAddressStop []byte `struc:"[16]byte"` - Protocol uint8 - RemotePortStart uint16 - RemotePortStop uint16 - LocalPortStart uint16 - LocalPortStop uint16 - Policy uint8 - SaID uint32 -} - -func (*IpsecSpdAddDelEntry) GetMessageName() string { - return "ipsec_spd_add_del_entry" -} -func (*IpsecSpdAddDelEntry) GetCrcString() string { - return "7687a364" -} -func (*IpsecSpdAddDelEntry) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IpsecSpdAddDelEntryReply represents VPP binary API message 'ipsec_spd_add_del_entry_reply': -type IpsecSpdAddDelEntryReply struct { - Retval int32 -} - -func (*IpsecSpdAddDelEntryReply) GetMessageName() string { - return "ipsec_spd_add_del_entry_reply" -} -func (*IpsecSpdAddDelEntryReply) GetCrcString() string { - return "e8d4e804" -} -func (*IpsecSpdAddDelEntryReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IpsecSpdAddDelReply represents VPP binary API message 'ipsec_spd_add_del_reply': -type IpsecSpdAddDelReply struct { - Retval int32 -} - -func (*IpsecSpdAddDelReply) GetMessageName() string { - return "ipsec_spd_add_del_reply" -} -func (*IpsecSpdAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*IpsecSpdAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IpsecSpdDetails represents VPP binary API message 'ipsec_spd_details': -type IpsecSpdDetails struct { - SpdID uint32 - Priority int32 - IsOutbound uint8 - IsIPv6 uint8 - LocalStartAddr []byte `struc:"[16]byte"` - LocalStopAddr []byte `struc:"[16]byte"` - LocalStartPort uint16 - LocalStopPort uint16 - RemoteStartAddr []byte `struc:"[16]byte"` - RemoteStopAddr []byte `struc:"[16]byte"` - RemoteStartPort uint16 - RemoteStopPort uint16 - Protocol uint8 - Policy uint8 - SaID uint32 - Bytes uint64 - Packets uint64 -} - -func (*IpsecSpdDetails) GetMessageName() string { - return "ipsec_spd_details" -} -func (*IpsecSpdDetails) GetCrcString() string { - return "1560895d" -} -func (*IpsecSpdDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IpsecSpdDump represents VPP binary API message 'ipsec_spd_dump': -type IpsecSpdDump struct { - SpdID uint32 - SaID uint32 -} - -func (*IpsecSpdDump) GetMessageName() string { - return "ipsec_spd_dump" -} -func (*IpsecSpdDump) GetCrcString() string { - return "afefbf7d" -} -func (*IpsecSpdDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IpsecSpdInterfaceDetails represents VPP binary API message 'ipsec_spd_interface_details': -type IpsecSpdInterfaceDetails struct { - SpdIndex uint32 - SwIfIndex uint32 -} - -func (*IpsecSpdInterfaceDetails) GetMessageName() string { - return "ipsec_spd_interface_details" -} -func (*IpsecSpdInterfaceDetails) GetCrcString() string { - return "2c54296d" -} -func (*IpsecSpdInterfaceDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IpsecSpdInterfaceDump represents VPP binary API message 'ipsec_spd_interface_dump': -type IpsecSpdInterfaceDump struct { - SpdIndex uint32 - SpdIndexValid uint8 -} - -func (*IpsecSpdInterfaceDump) GetMessageName() string { - return "ipsec_spd_interface_dump" -} -func (*IpsecSpdInterfaceDump) GetCrcString() string { - return "8971de19" -} -func (*IpsecSpdInterfaceDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IpsecSpdsDetails represents VPP binary API message 'ipsec_spds_details': -type IpsecSpdsDetails struct { - SpdID uint32 - Npolicies uint32 -} - -func (*IpsecSpdsDetails) GetMessageName() string { - return "ipsec_spds_details" -} -func (*IpsecSpdsDetails) GetCrcString() string { - return "a04bb254" -} -func (*IpsecSpdsDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IpsecSpdsDump represents VPP binary API message 'ipsec_spds_dump': -type IpsecSpdsDump struct{} - -func (*IpsecSpdsDump) GetMessageName() string { - return "ipsec_spds_dump" -} -func (*IpsecSpdsDump) GetCrcString() string { - return "51077d14" -} -func (*IpsecSpdsDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IpsecTunnelIfAddDel represents VPP binary API message 'ipsec_tunnel_if_add_del': -type IpsecTunnelIfAddDel struct { - IsAdd uint8 - Esn uint8 - AntiReplay uint8 - LocalIP []byte `struc:"[4]byte"` - RemoteIP []byte `struc:"[4]byte"` - LocalSpi uint32 - RemoteSpi uint32 - CryptoAlg uint8 - LocalCryptoKeyLen uint8 - LocalCryptoKey []byte `struc:"[128]byte"` - RemoteCryptoKeyLen uint8 - RemoteCryptoKey []byte `struc:"[128]byte"` - IntegAlg uint8 - LocalIntegKeyLen uint8 - LocalIntegKey []byte `struc:"[128]byte"` - RemoteIntegKeyLen uint8 - RemoteIntegKey []byte `struc:"[128]byte"` - Renumber uint8 - ShowInstance uint32 - UDPEncap uint8 -} - -func (*IpsecTunnelIfAddDel) GetMessageName() string { - return "ipsec_tunnel_if_add_del" -} -func (*IpsecTunnelIfAddDel) GetCrcString() string { - return "2ee1da12" -} -func (*IpsecTunnelIfAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IpsecTunnelIfAddDelReply represents VPP binary API message 'ipsec_tunnel_if_add_del_reply': -type IpsecTunnelIfAddDelReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*IpsecTunnelIfAddDelReply) GetMessageName() string { - return "ipsec_tunnel_if_add_del_reply" -} -func (*IpsecTunnelIfAddDelReply) GetCrcString() string { - return "fda5941f" -} -func (*IpsecTunnelIfAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IpsecTunnelIfSetKey represents VPP binary API message 'ipsec_tunnel_if_set_key': -type IpsecTunnelIfSetKey struct { - SwIfIndex uint32 - KeyType uint8 - Alg uint8 - KeyLen uint8 - Key []byte `struc:"[128]byte"` -} - -func (*IpsecTunnelIfSetKey) GetMessageName() string { - return "ipsec_tunnel_if_set_key" -} -func (*IpsecTunnelIfSetKey) GetCrcString() string { - return "326169a8" -} -func (*IpsecTunnelIfSetKey) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IpsecTunnelIfSetKeyReply represents VPP binary API message 'ipsec_tunnel_if_set_key_reply': -type IpsecTunnelIfSetKeyReply struct { - Retval int32 -} - -func (*IpsecTunnelIfSetKeyReply) GetMessageName() string { - return "ipsec_tunnel_if_set_key_reply" -} -func (*IpsecTunnelIfSetKeyReply) GetCrcString() string { - return "e8d4e804" -} -func (*IpsecTunnelIfSetKeyReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// IpsecTunnelIfSetSa represents VPP binary API message 'ipsec_tunnel_if_set_sa': -type IpsecTunnelIfSetSa struct { - SwIfIndex uint32 - SaID uint32 - IsOutbound uint8 -} - -func (*IpsecTunnelIfSetSa) GetMessageName() string { - return "ipsec_tunnel_if_set_sa" -} -func (*IpsecTunnelIfSetSa) GetCrcString() string { - return "6ab567f2" -} -func (*IpsecTunnelIfSetSa) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// IpsecTunnelIfSetSaReply represents VPP binary API message 'ipsec_tunnel_if_set_sa_reply': -type IpsecTunnelIfSetSaReply struct { - Retval int32 -} - -func (*IpsecTunnelIfSetSaReply) GetMessageName() string { - return "ipsec_tunnel_if_set_sa_reply" -} -func (*IpsecTunnelIfSetSaReply) GetCrcString() string { - return "e8d4e804" -} -func (*IpsecTunnelIfSetSaReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func init() { - api.RegisterMessage((*Ikev2InitiateDelChildSa)(nil), "ipsec.Ikev2InitiateDelChildSa") - api.RegisterMessage((*Ikev2InitiateDelChildSaReply)(nil), "ipsec.Ikev2InitiateDelChildSaReply") - api.RegisterMessage((*Ikev2InitiateDelIkeSa)(nil), "ipsec.Ikev2InitiateDelIkeSa") - api.RegisterMessage((*Ikev2InitiateDelIkeSaReply)(nil), "ipsec.Ikev2InitiateDelIkeSaReply") - api.RegisterMessage((*Ikev2InitiateRekeyChildSa)(nil), "ipsec.Ikev2InitiateRekeyChildSa") - api.RegisterMessage((*Ikev2InitiateRekeyChildSaReply)(nil), "ipsec.Ikev2InitiateRekeyChildSaReply") - api.RegisterMessage((*Ikev2InitiateSaInit)(nil), "ipsec.Ikev2InitiateSaInit") - api.RegisterMessage((*Ikev2InitiateSaInitReply)(nil), "ipsec.Ikev2InitiateSaInitReply") - api.RegisterMessage((*Ikev2ProfileAddDel)(nil), "ipsec.Ikev2ProfileAddDel") - api.RegisterMessage((*Ikev2ProfileAddDelReply)(nil), "ipsec.Ikev2ProfileAddDelReply") - api.RegisterMessage((*Ikev2ProfileSetAuth)(nil), "ipsec.Ikev2ProfileSetAuth") - api.RegisterMessage((*Ikev2ProfileSetAuthReply)(nil), "ipsec.Ikev2ProfileSetAuthReply") - api.RegisterMessage((*Ikev2ProfileSetID)(nil), "ipsec.Ikev2ProfileSetID") - api.RegisterMessage((*Ikev2ProfileSetIDReply)(nil), "ipsec.Ikev2ProfileSetIDReply") - api.RegisterMessage((*Ikev2ProfileSetTs)(nil), "ipsec.Ikev2ProfileSetTs") - api.RegisterMessage((*Ikev2ProfileSetTsReply)(nil), "ipsec.Ikev2ProfileSetTsReply") - api.RegisterMessage((*Ikev2SetEspTransforms)(nil), "ipsec.Ikev2SetEspTransforms") - api.RegisterMessage((*Ikev2SetEspTransformsReply)(nil), "ipsec.Ikev2SetEspTransformsReply") - api.RegisterMessage((*Ikev2SetIkeTransforms)(nil), "ipsec.Ikev2SetIkeTransforms") - api.RegisterMessage((*Ikev2SetIkeTransformsReply)(nil), "ipsec.Ikev2SetIkeTransformsReply") - api.RegisterMessage((*Ikev2SetLocalKey)(nil), "ipsec.Ikev2SetLocalKey") - api.RegisterMessage((*Ikev2SetLocalKeyReply)(nil), "ipsec.Ikev2SetLocalKeyReply") - api.RegisterMessage((*Ikev2SetResponder)(nil), "ipsec.Ikev2SetResponder") - api.RegisterMessage((*Ikev2SetResponderReply)(nil), "ipsec.Ikev2SetResponderReply") - api.RegisterMessage((*Ikev2SetSaLifetime)(nil), "ipsec.Ikev2SetSaLifetime") - api.RegisterMessage((*Ikev2SetSaLifetimeReply)(nil), "ipsec.Ikev2SetSaLifetimeReply") - api.RegisterMessage((*IpsecInterfaceAddDelSpd)(nil), "ipsec.IpsecInterfaceAddDelSpd") - api.RegisterMessage((*IpsecInterfaceAddDelSpdReply)(nil), "ipsec.IpsecInterfaceAddDelSpdReply") - api.RegisterMessage((*IpsecSaDetails)(nil), "ipsec.IpsecSaDetails") - api.RegisterMessage((*IpsecSaDump)(nil), "ipsec.IpsecSaDump") - api.RegisterMessage((*IpsecSaSetKey)(nil), "ipsec.IpsecSaSetKey") - api.RegisterMessage((*IpsecSaSetKeyReply)(nil), "ipsec.IpsecSaSetKeyReply") - api.RegisterMessage((*IpsecSadAddDelEntry)(nil), "ipsec.IpsecSadAddDelEntry") - api.RegisterMessage((*IpsecSadAddDelEntryReply)(nil), "ipsec.IpsecSadAddDelEntryReply") - api.RegisterMessage((*IpsecSpdAddDel)(nil), "ipsec.IpsecSpdAddDel") - api.RegisterMessage((*IpsecSpdAddDelEntry)(nil), "ipsec.IpsecSpdAddDelEntry") - api.RegisterMessage((*IpsecSpdAddDelEntryReply)(nil), "ipsec.IpsecSpdAddDelEntryReply") - api.RegisterMessage((*IpsecSpdAddDelReply)(nil), "ipsec.IpsecSpdAddDelReply") - api.RegisterMessage((*IpsecSpdDetails)(nil), "ipsec.IpsecSpdDetails") - api.RegisterMessage((*IpsecSpdDump)(nil), "ipsec.IpsecSpdDump") - api.RegisterMessage((*IpsecSpdInterfaceDetails)(nil), "ipsec.IpsecSpdInterfaceDetails") - api.RegisterMessage((*IpsecSpdInterfaceDump)(nil), "ipsec.IpsecSpdInterfaceDump") - api.RegisterMessage((*IpsecSpdsDetails)(nil), "ipsec.IpsecSpdsDetails") - api.RegisterMessage((*IpsecSpdsDump)(nil), "ipsec.IpsecSpdsDump") - api.RegisterMessage((*IpsecTunnelIfAddDel)(nil), "ipsec.IpsecTunnelIfAddDel") - api.RegisterMessage((*IpsecTunnelIfAddDelReply)(nil), "ipsec.IpsecTunnelIfAddDelReply") - api.RegisterMessage((*IpsecTunnelIfSetKey)(nil), "ipsec.IpsecTunnelIfSetKey") - api.RegisterMessage((*IpsecTunnelIfSetKeyReply)(nil), "ipsec.IpsecTunnelIfSetKeyReply") - api.RegisterMessage((*IpsecTunnelIfSetSa)(nil), "ipsec.IpsecTunnelIfSetSa") - api.RegisterMessage((*IpsecTunnelIfSetSaReply)(nil), "ipsec.IpsecTunnelIfSetSaReply") -} - -var Messages = []api.Message{ - (*Ikev2InitiateDelChildSa)(nil), - (*Ikev2InitiateDelChildSaReply)(nil), - (*Ikev2InitiateDelIkeSa)(nil), - (*Ikev2InitiateDelIkeSaReply)(nil), - (*Ikev2InitiateRekeyChildSa)(nil), - (*Ikev2InitiateRekeyChildSaReply)(nil), - (*Ikev2InitiateSaInit)(nil), - (*Ikev2InitiateSaInitReply)(nil), - (*Ikev2ProfileAddDel)(nil), - (*Ikev2ProfileAddDelReply)(nil), - (*Ikev2ProfileSetAuth)(nil), - (*Ikev2ProfileSetAuthReply)(nil), - (*Ikev2ProfileSetID)(nil), - (*Ikev2ProfileSetIDReply)(nil), - (*Ikev2ProfileSetTs)(nil), - (*Ikev2ProfileSetTsReply)(nil), - (*Ikev2SetEspTransforms)(nil), - (*Ikev2SetEspTransformsReply)(nil), - (*Ikev2SetIkeTransforms)(nil), - (*Ikev2SetIkeTransformsReply)(nil), - (*Ikev2SetLocalKey)(nil), - (*Ikev2SetLocalKeyReply)(nil), - (*Ikev2SetResponder)(nil), - (*Ikev2SetResponderReply)(nil), - (*Ikev2SetSaLifetime)(nil), - (*Ikev2SetSaLifetimeReply)(nil), - (*IpsecInterfaceAddDelSpd)(nil), - (*IpsecInterfaceAddDelSpdReply)(nil), - (*IpsecSaDetails)(nil), - (*IpsecSaDump)(nil), - (*IpsecSaSetKey)(nil), - (*IpsecSaSetKeyReply)(nil), - (*IpsecSadAddDelEntry)(nil), - (*IpsecSadAddDelEntryReply)(nil), - (*IpsecSpdAddDel)(nil), - (*IpsecSpdAddDelEntry)(nil), - (*IpsecSpdAddDelEntryReply)(nil), - (*IpsecSpdAddDelReply)(nil), - (*IpsecSpdDetails)(nil), - (*IpsecSpdDump)(nil), - (*IpsecSpdInterfaceDetails)(nil), - (*IpsecSpdInterfaceDump)(nil), - (*IpsecSpdsDetails)(nil), - (*IpsecSpdsDump)(nil), - (*IpsecTunnelIfAddDel)(nil), - (*IpsecTunnelIfAddDelReply)(nil), - (*IpsecTunnelIfSetKey)(nil), - (*IpsecTunnelIfSetKeyReply)(nil), - (*IpsecTunnelIfSetSa)(nil), - (*IpsecTunnelIfSetSaReply)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/l2/l2.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/l2/l2.ba.go deleted file mode 100644 index 251bb88569..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/l2/l2.ba.go +++ /dev/null @@ -1,939 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/l2.api.json - -/* - Package l2 is a generated from VPP binary API module 'l2'. - - It contains following objects: - 22 services - 2 enums - 2 types - 45 messages -*/ -package l2 - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpBdIPMac(*BdIPMacDump) ([]*BdIPMacDetails, error) - DumpBridgeDomain(*BridgeDomainDump) ([]*BridgeDomainDetails, error) - DumpL2FibTable(*L2FibTableDump) ([]*L2FibTableDetails, error) - DumpL2Xconnect(*L2XconnectDump) ([]*L2XconnectDetails, error) - BdIPMacAddDel(*BdIPMacAddDel) (*BdIPMacAddDelReply, error) - BridgeDomainAddDel(*BridgeDomainAddDel) (*BridgeDomainAddDelReply, error) - BridgeDomainSetMacAge(*BridgeDomainSetMacAge) (*BridgeDomainSetMacAgeReply, error) - BridgeFlags(*BridgeFlags) (*BridgeFlagsReply, error) - L2FibClearTable(*L2FibClearTable) (*L2FibClearTableReply, error) - L2Flags(*L2Flags) (*L2FlagsReply, error) - L2InterfaceEfpFilter(*L2InterfaceEfpFilter) (*L2InterfaceEfpFilterReply, error) - L2InterfacePbbTagRewrite(*L2InterfacePbbTagRewrite) (*L2InterfacePbbTagRewriteReply, error) - L2InterfaceVlanTagRewrite(*L2InterfaceVlanTagRewrite) (*L2InterfaceVlanTagRewriteReply, error) - L2PatchAddDel(*L2PatchAddDel) (*L2PatchAddDelReply, error) - L2fibAddDel(*L2fibAddDel) (*L2fibAddDelReply, error) - L2fibFlushAll(*L2fibFlushAll) (*L2fibFlushAllReply, error) - L2fibFlushBd(*L2fibFlushBd) (*L2fibFlushBdReply, error) - L2fibFlushInt(*L2fibFlushInt) (*L2fibFlushIntReply, error) - SwInterfaceSetL2Bridge(*SwInterfaceSetL2Bridge) (*SwInterfaceSetL2BridgeReply, error) - SwInterfaceSetL2Xconnect(*SwInterfaceSetL2Xconnect) (*SwInterfaceSetL2XconnectReply, error) - SwInterfaceSetVpath(*SwInterfaceSetVpath) (*SwInterfaceSetVpathReply, error) - WantL2MacsEvents(*WantL2MacsEvents) (*WantL2MacsEventsReply, error) -} - -/* Enums */ - -// BdFlags represents VPP binary API enum 'bd_flags': -type BdFlags uint32 - -const ( - BRIDGE_API_FLAG_LEARN BdFlags = 1 - BRIDGE_API_FLAG_FWD BdFlags = 2 - BRIDGE_API_FLAG_FLOOD BdFlags = 4 - BRIDGE_API_FLAG_UU_FLOOD BdFlags = 8 - BRIDGE_API_FLAG_ARP_TERM BdFlags = 16 -) - -// L2PortType represents VPP binary API enum 'l2_port_type': -type L2PortType uint32 - -const ( - L2_API_PORT_TYPE_NORMAL L2PortType = 0 - L2_API_PORT_TYPE_BVI L2PortType = 1 - L2_API_PORT_TYPE_UU_FWD L2PortType = 2 -) - -/* Types */ - -// BridgeDomainSwIf represents VPP binary API type 'bridge_domain_sw_if': -type BridgeDomainSwIf struct { - Context uint32 - SwIfIndex uint32 - Shg uint8 -} - -func (*BridgeDomainSwIf) GetTypeName() string { - return "bridge_domain_sw_if" -} -func (*BridgeDomainSwIf) GetCrcString() string { - return "a06dd426" -} - -// MacEntry represents VPP binary API type 'mac_entry': -type MacEntry struct { - SwIfIndex uint32 - MacAddr []byte `struc:"[6]byte"` - Action uint8 - Flags uint8 -} - -func (*MacEntry) GetTypeName() string { - return "mac_entry" -} -func (*MacEntry) GetCrcString() string { - return "971135b8" -} - -/* Messages */ - -// BdIPMacAddDel represents VPP binary API message 'bd_ip_mac_add_del': -type BdIPMacAddDel struct { - BdID uint32 - IsAdd uint8 - IsIPv6 uint8 - IPAddress []byte `struc:"[16]byte"` - MacAddress []byte `struc:"[6]byte"` -} - -func (*BdIPMacAddDel) GetMessageName() string { - return "bd_ip_mac_add_del" -} -func (*BdIPMacAddDel) GetCrcString() string { - return "79f42817" -} -func (*BdIPMacAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// BdIPMacAddDelReply represents VPP binary API message 'bd_ip_mac_add_del_reply': -type BdIPMacAddDelReply struct { - Retval int32 -} - -func (*BdIPMacAddDelReply) GetMessageName() string { - return "bd_ip_mac_add_del_reply" -} -func (*BdIPMacAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*BdIPMacAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// BdIPMacDetails represents VPP binary API message 'bd_ip_mac_details': -type BdIPMacDetails struct { - BdID uint32 - IsIPv6 uint8 - IPAddress []byte `struc:"[16]byte"` - MacAddress []byte `struc:"[6]byte"` -} - -func (*BdIPMacDetails) GetMessageName() string { - return "bd_ip_mac_details" -} -func (*BdIPMacDetails) GetCrcString() string { - return "d3184eda" -} -func (*BdIPMacDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// BdIPMacDump represents VPP binary API message 'bd_ip_mac_dump': -type BdIPMacDump struct { - BdID uint32 -} - -func (*BdIPMacDump) GetMessageName() string { - return "bd_ip_mac_dump" -} -func (*BdIPMacDump) GetCrcString() string { - return "c25fdce6" -} -func (*BdIPMacDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// BridgeDomainAddDel represents VPP binary API message 'bridge_domain_add_del': -type BridgeDomainAddDel struct { - BdID uint32 - Flood uint8 - UuFlood uint8 - Forward uint8 - Learn uint8 - ArpTerm uint8 - MacAge uint8 - BdTag []byte `struc:"[64]byte"` - IsAdd uint8 -} - -func (*BridgeDomainAddDel) GetMessageName() string { - return "bridge_domain_add_del" -} -func (*BridgeDomainAddDel) GetCrcString() string { - return "6f668fd9" -} -func (*BridgeDomainAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// BridgeDomainAddDelReply represents VPP binary API message 'bridge_domain_add_del_reply': -type BridgeDomainAddDelReply struct { - Retval int32 -} - -func (*BridgeDomainAddDelReply) GetMessageName() string { - return "bridge_domain_add_del_reply" -} -func (*BridgeDomainAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*BridgeDomainAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// BridgeDomainDetails represents VPP binary API message 'bridge_domain_details': -type BridgeDomainDetails struct { - BdID uint32 - Flood uint8 - UuFlood uint8 - Forward uint8 - Learn uint8 - ArpTerm uint8 - MacAge uint8 - BdTag []byte `struc:"[64]byte"` - BviSwIfIndex uint32 - UuFwdSwIfIndex uint32 - NSwIfs uint32 `struc:"sizeof=SwIfDetails"` - SwIfDetails []BridgeDomainSwIf -} - -func (*BridgeDomainDetails) GetMessageName() string { - return "bridge_domain_details" -} -func (*BridgeDomainDetails) GetCrcString() string { - return "b2134997" -} -func (*BridgeDomainDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// BridgeDomainDump represents VPP binary API message 'bridge_domain_dump': -type BridgeDomainDump struct { - BdID uint32 -} - -func (*BridgeDomainDump) GetMessageName() string { - return "bridge_domain_dump" -} -func (*BridgeDomainDump) GetCrcString() string { - return "c25fdce6" -} -func (*BridgeDomainDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// BridgeDomainSetMacAge represents VPP binary API message 'bridge_domain_set_mac_age': -type BridgeDomainSetMacAge struct { - BdID uint32 - MacAge uint8 -} - -func (*BridgeDomainSetMacAge) GetMessageName() string { - return "bridge_domain_set_mac_age" -} -func (*BridgeDomainSetMacAge) GetCrcString() string { - return "b537ad7b" -} -func (*BridgeDomainSetMacAge) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// BridgeDomainSetMacAgeReply represents VPP binary API message 'bridge_domain_set_mac_age_reply': -type BridgeDomainSetMacAgeReply struct { - Retval int32 -} - -func (*BridgeDomainSetMacAgeReply) GetMessageName() string { - return "bridge_domain_set_mac_age_reply" -} -func (*BridgeDomainSetMacAgeReply) GetCrcString() string { - return "e8d4e804" -} -func (*BridgeDomainSetMacAgeReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// BridgeFlags represents VPP binary API message 'bridge_flags': -type BridgeFlags struct { - BdID uint32 - IsSet uint8 - Flags BdFlags -} - -func (*BridgeFlags) GetMessageName() string { - return "bridge_flags" -} -func (*BridgeFlags) GetCrcString() string { - return "8563d406" -} -func (*BridgeFlags) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// BridgeFlagsReply represents VPP binary API message 'bridge_flags_reply': -type BridgeFlagsReply struct { - Retval int32 - ResultingFeatureBitmap uint32 -} - -func (*BridgeFlagsReply) GetMessageName() string { - return "bridge_flags_reply" -} -func (*BridgeFlagsReply) GetCrcString() string { - return "29b2a2b3" -} -func (*BridgeFlagsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// L2FibClearTable represents VPP binary API message 'l2_fib_clear_table': -type L2FibClearTable struct{} - -func (*L2FibClearTable) GetMessageName() string { - return "l2_fib_clear_table" -} -func (*L2FibClearTable) GetCrcString() string { - return "51077d14" -} -func (*L2FibClearTable) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// L2FibClearTableReply represents VPP binary API message 'l2_fib_clear_table_reply': -type L2FibClearTableReply struct { - Retval int32 -} - -func (*L2FibClearTableReply) GetMessageName() string { - return "l2_fib_clear_table_reply" -} -func (*L2FibClearTableReply) GetCrcString() string { - return "e8d4e804" -} -func (*L2FibClearTableReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// L2FibTableDetails represents VPP binary API message 'l2_fib_table_details': -type L2FibTableDetails struct { - BdID uint32 - Mac []byte `struc:"[6]byte"` - SwIfIndex uint32 - StaticMac uint8 - FilterMac uint8 - BviMac uint8 -} - -func (*L2FibTableDetails) GetMessageName() string { - return "l2_fib_table_details" -} -func (*L2FibTableDetails) GetCrcString() string { - return "c7392706" -} -func (*L2FibTableDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// L2FibTableDump represents VPP binary API message 'l2_fib_table_dump': -type L2FibTableDump struct { - BdID uint32 -} - -func (*L2FibTableDump) GetMessageName() string { - return "l2_fib_table_dump" -} -func (*L2FibTableDump) GetCrcString() string { - return "c25fdce6" -} -func (*L2FibTableDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// L2Flags represents VPP binary API message 'l2_flags': -type L2Flags struct { - SwIfIndex uint32 - IsSet uint8 - FeatureBitmap uint32 -} - -func (*L2Flags) GetMessageName() string { - return "l2_flags" -} -func (*L2Flags) GetCrcString() string { - return "0e889fb9" -} -func (*L2Flags) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// L2FlagsReply represents VPP binary API message 'l2_flags_reply': -type L2FlagsReply struct { - Retval int32 - ResultingFeatureBitmap uint32 -} - -func (*L2FlagsReply) GetMessageName() string { - return "l2_flags_reply" -} -func (*L2FlagsReply) GetCrcString() string { - return "29b2a2b3" -} -func (*L2FlagsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// L2InterfaceEfpFilter represents VPP binary API message 'l2_interface_efp_filter': -type L2InterfaceEfpFilter struct { - SwIfIndex uint32 - EnableDisable uint8 -} - -func (*L2InterfaceEfpFilter) GetMessageName() string { - return "l2_interface_efp_filter" -} -func (*L2InterfaceEfpFilter) GetCrcString() string { - return "69d24598" -} -func (*L2InterfaceEfpFilter) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// L2InterfaceEfpFilterReply represents VPP binary API message 'l2_interface_efp_filter_reply': -type L2InterfaceEfpFilterReply struct { - Retval int32 -} - -func (*L2InterfaceEfpFilterReply) GetMessageName() string { - return "l2_interface_efp_filter_reply" -} -func (*L2InterfaceEfpFilterReply) GetCrcString() string { - return "e8d4e804" -} -func (*L2InterfaceEfpFilterReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// L2InterfacePbbTagRewrite represents VPP binary API message 'l2_interface_pbb_tag_rewrite': -type L2InterfacePbbTagRewrite struct { - SwIfIndex uint32 - VtrOp uint32 - OuterTag uint16 - BDmac []byte `struc:"[6]byte"` - BSmac []byte `struc:"[6]byte"` - BVlanid uint16 - ISid uint32 -} - -func (*L2InterfacePbbTagRewrite) GetMessageName() string { - return "l2_interface_pbb_tag_rewrite" -} -func (*L2InterfacePbbTagRewrite) GetCrcString() string { - return "6cf815f9" -} -func (*L2InterfacePbbTagRewrite) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// L2InterfacePbbTagRewriteReply represents VPP binary API message 'l2_interface_pbb_tag_rewrite_reply': -type L2InterfacePbbTagRewriteReply struct { - Retval int32 -} - -func (*L2InterfacePbbTagRewriteReply) GetMessageName() string { - return "l2_interface_pbb_tag_rewrite_reply" -} -func (*L2InterfacePbbTagRewriteReply) GetCrcString() string { - return "e8d4e804" -} -func (*L2InterfacePbbTagRewriteReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// L2InterfaceVlanTagRewrite represents VPP binary API message 'l2_interface_vlan_tag_rewrite': -type L2InterfaceVlanTagRewrite struct { - SwIfIndex uint32 - VtrOp uint32 - PushDot1q uint32 - Tag1 uint32 - Tag2 uint32 -} - -func (*L2InterfaceVlanTagRewrite) GetMessageName() string { - return "l2_interface_vlan_tag_rewrite" -} -func (*L2InterfaceVlanTagRewrite) GetCrcString() string { - return "b90be6b4" -} -func (*L2InterfaceVlanTagRewrite) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// L2InterfaceVlanTagRewriteReply represents VPP binary API message 'l2_interface_vlan_tag_rewrite_reply': -type L2InterfaceVlanTagRewriteReply struct { - Retval int32 -} - -func (*L2InterfaceVlanTagRewriteReply) GetMessageName() string { - return "l2_interface_vlan_tag_rewrite_reply" -} -func (*L2InterfaceVlanTagRewriteReply) GetCrcString() string { - return "e8d4e804" -} -func (*L2InterfaceVlanTagRewriteReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// L2MacsEvent represents VPP binary API message 'l2_macs_event': -type L2MacsEvent struct { - PID uint32 - NMacs uint32 `struc:"sizeof=Mac"` - Mac []MacEntry -} - -func (*L2MacsEvent) GetMessageName() string { - return "l2_macs_event" -} -func (*L2MacsEvent) GetCrcString() string { - return "4e5ab0c8" -} -func (*L2MacsEvent) GetMessageType() api.MessageType { - return api.EventMessage -} - -// L2PatchAddDel represents VPP binary API message 'l2_patch_add_del': -type L2PatchAddDel struct { - RxSwIfIndex uint32 - TxSwIfIndex uint32 - IsAdd uint8 -} - -func (*L2PatchAddDel) GetMessageName() string { - return "l2_patch_add_del" -} -func (*L2PatchAddDel) GetCrcString() string { - return "62506e63" -} -func (*L2PatchAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// L2PatchAddDelReply represents VPP binary API message 'l2_patch_add_del_reply': -type L2PatchAddDelReply struct { - Retval int32 -} - -func (*L2PatchAddDelReply) GetMessageName() string { - return "l2_patch_add_del_reply" -} -func (*L2PatchAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*L2PatchAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// L2XconnectDetails represents VPP binary API message 'l2_xconnect_details': -type L2XconnectDetails struct { - RxSwIfIndex uint32 - TxSwIfIndex uint32 -} - -func (*L2XconnectDetails) GetMessageName() string { - return "l2_xconnect_details" -} -func (*L2XconnectDetails) GetCrcString() string { - return "722e2378" -} -func (*L2XconnectDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// L2XconnectDump represents VPP binary API message 'l2_xconnect_dump': -type L2XconnectDump struct{} - -func (*L2XconnectDump) GetMessageName() string { - return "l2_xconnect_dump" -} -func (*L2XconnectDump) GetCrcString() string { - return "51077d14" -} -func (*L2XconnectDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// L2fibAddDel represents VPP binary API message 'l2fib_add_del': -type L2fibAddDel struct { - Mac []byte `struc:"[6]byte"` - BdID uint32 - SwIfIndex uint32 - IsAdd uint8 - StaticMac uint8 - FilterMac uint8 - BviMac uint8 -} - -func (*L2fibAddDel) GetMessageName() string { - return "l2fib_add_del" -} -func (*L2fibAddDel) GetCrcString() string { - return "34ced3eb" -} -func (*L2fibAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// L2fibAddDelReply represents VPP binary API message 'l2fib_add_del_reply': -type L2fibAddDelReply struct { - Retval int32 -} - -func (*L2fibAddDelReply) GetMessageName() string { - return "l2fib_add_del_reply" -} -func (*L2fibAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*L2fibAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// L2fibFlushAll represents VPP binary API message 'l2fib_flush_all': -type L2fibFlushAll struct{} - -func (*L2fibFlushAll) GetMessageName() string { - return "l2fib_flush_all" -} -func (*L2fibFlushAll) GetCrcString() string { - return "51077d14" -} -func (*L2fibFlushAll) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// L2fibFlushAllReply represents VPP binary API message 'l2fib_flush_all_reply': -type L2fibFlushAllReply struct { - Retval int32 -} - -func (*L2fibFlushAllReply) GetMessageName() string { - return "l2fib_flush_all_reply" -} -func (*L2fibFlushAllReply) GetCrcString() string { - return "e8d4e804" -} -func (*L2fibFlushAllReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// L2fibFlushBd represents VPP binary API message 'l2fib_flush_bd': -type L2fibFlushBd struct { - BdID uint32 -} - -func (*L2fibFlushBd) GetMessageName() string { - return "l2fib_flush_bd" -} -func (*L2fibFlushBd) GetCrcString() string { - return "c25fdce6" -} -func (*L2fibFlushBd) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// L2fibFlushBdReply represents VPP binary API message 'l2fib_flush_bd_reply': -type L2fibFlushBdReply struct { - Retval int32 -} - -func (*L2fibFlushBdReply) GetMessageName() string { - return "l2fib_flush_bd_reply" -} -func (*L2fibFlushBdReply) GetCrcString() string { - return "e8d4e804" -} -func (*L2fibFlushBdReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// L2fibFlushInt represents VPP binary API message 'l2fib_flush_int': -type L2fibFlushInt struct { - SwIfIndex uint32 -} - -func (*L2fibFlushInt) GetMessageName() string { - return "l2fib_flush_int" -} -func (*L2fibFlushInt) GetCrcString() string { - return "529cb13f" -} -func (*L2fibFlushInt) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// L2fibFlushIntReply represents VPP binary API message 'l2fib_flush_int_reply': -type L2fibFlushIntReply struct { - Retval int32 -} - -func (*L2fibFlushIntReply) GetMessageName() string { - return "l2fib_flush_int_reply" -} -func (*L2fibFlushIntReply) GetCrcString() string { - return "e8d4e804" -} -func (*L2fibFlushIntReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceSetL2Bridge represents VPP binary API message 'sw_interface_set_l2_bridge': -type SwInterfaceSetL2Bridge struct { - RxSwIfIndex uint32 - BdID uint32 - PortType L2PortType - Shg uint8 - Enable uint8 -} - -func (*SwInterfaceSetL2Bridge) GetMessageName() string { - return "sw_interface_set_l2_bridge" -} -func (*SwInterfaceSetL2Bridge) GetCrcString() string { - return "2af7795e" -} -func (*SwInterfaceSetL2Bridge) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSetL2BridgeReply represents VPP binary API message 'sw_interface_set_l2_bridge_reply': -type SwInterfaceSetL2BridgeReply struct { - Retval int32 -} - -func (*SwInterfaceSetL2BridgeReply) GetMessageName() string { - return "sw_interface_set_l2_bridge_reply" -} -func (*SwInterfaceSetL2BridgeReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceSetL2BridgeReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceSetL2Xconnect represents VPP binary API message 'sw_interface_set_l2_xconnect': -type SwInterfaceSetL2Xconnect struct { - RxSwIfIndex uint32 - TxSwIfIndex uint32 - Enable uint8 -} - -func (*SwInterfaceSetL2Xconnect) GetMessageName() string { - return "sw_interface_set_l2_xconnect" -} -func (*SwInterfaceSetL2Xconnect) GetCrcString() string { - return "95de3988" -} -func (*SwInterfaceSetL2Xconnect) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSetL2XconnectReply represents VPP binary API message 'sw_interface_set_l2_xconnect_reply': -type SwInterfaceSetL2XconnectReply struct { - Retval int32 -} - -func (*SwInterfaceSetL2XconnectReply) GetMessageName() string { - return "sw_interface_set_l2_xconnect_reply" -} -func (*SwInterfaceSetL2XconnectReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceSetL2XconnectReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceSetVpath represents VPP binary API message 'sw_interface_set_vpath': -type SwInterfaceSetVpath struct { - SwIfIndex uint32 - Enable uint8 -} - -func (*SwInterfaceSetVpath) GetMessageName() string { - return "sw_interface_set_vpath" -} -func (*SwInterfaceSetVpath) GetCrcString() string { - return "a36fadc0" -} -func (*SwInterfaceSetVpath) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSetVpathReply represents VPP binary API message 'sw_interface_set_vpath_reply': -type SwInterfaceSetVpathReply struct { - Retval int32 -} - -func (*SwInterfaceSetVpathReply) GetMessageName() string { - return "sw_interface_set_vpath_reply" -} -func (*SwInterfaceSetVpathReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceSetVpathReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// WantL2MacsEvents represents VPP binary API message 'want_l2_macs_events': -type WantL2MacsEvents struct { - LearnLimit uint32 - ScanDelay uint8 - MaxMacsInEvent uint8 - EnableDisable uint8 - PID uint32 -} - -func (*WantL2MacsEvents) GetMessageName() string { - return "want_l2_macs_events" -} -func (*WantL2MacsEvents) GetCrcString() string { - return "94e63394" -} -func (*WantL2MacsEvents) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// WantL2MacsEventsReply represents VPP binary API message 'want_l2_macs_events_reply': -type WantL2MacsEventsReply struct { - Retval int32 -} - -func (*WantL2MacsEventsReply) GetMessageName() string { - return "want_l2_macs_events_reply" -} -func (*WantL2MacsEventsReply) GetCrcString() string { - return "e8d4e804" -} -func (*WantL2MacsEventsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func init() { - api.RegisterMessage((*BdIPMacAddDel)(nil), "l2.BdIPMacAddDel") - api.RegisterMessage((*BdIPMacAddDelReply)(nil), "l2.BdIPMacAddDelReply") - api.RegisterMessage((*BdIPMacDetails)(nil), "l2.BdIPMacDetails") - api.RegisterMessage((*BdIPMacDump)(nil), "l2.BdIPMacDump") - api.RegisterMessage((*BridgeDomainAddDel)(nil), "l2.BridgeDomainAddDel") - api.RegisterMessage((*BridgeDomainAddDelReply)(nil), "l2.BridgeDomainAddDelReply") - api.RegisterMessage((*BridgeDomainDetails)(nil), "l2.BridgeDomainDetails") - api.RegisterMessage((*BridgeDomainDump)(nil), "l2.BridgeDomainDump") - api.RegisterMessage((*BridgeDomainSetMacAge)(nil), "l2.BridgeDomainSetMacAge") - api.RegisterMessage((*BridgeDomainSetMacAgeReply)(nil), "l2.BridgeDomainSetMacAgeReply") - api.RegisterMessage((*BridgeFlags)(nil), "l2.BridgeFlags") - api.RegisterMessage((*BridgeFlagsReply)(nil), "l2.BridgeFlagsReply") - api.RegisterMessage((*L2FibClearTable)(nil), "l2.L2FibClearTable") - api.RegisterMessage((*L2FibClearTableReply)(nil), "l2.L2FibClearTableReply") - api.RegisterMessage((*L2FibTableDetails)(nil), "l2.L2FibTableDetails") - api.RegisterMessage((*L2FibTableDump)(nil), "l2.L2FibTableDump") - api.RegisterMessage((*L2Flags)(nil), "l2.L2Flags") - api.RegisterMessage((*L2FlagsReply)(nil), "l2.L2FlagsReply") - api.RegisterMessage((*L2InterfaceEfpFilter)(nil), "l2.L2InterfaceEfpFilter") - api.RegisterMessage((*L2InterfaceEfpFilterReply)(nil), "l2.L2InterfaceEfpFilterReply") - api.RegisterMessage((*L2InterfacePbbTagRewrite)(nil), "l2.L2InterfacePbbTagRewrite") - api.RegisterMessage((*L2InterfacePbbTagRewriteReply)(nil), "l2.L2InterfacePbbTagRewriteReply") - api.RegisterMessage((*L2InterfaceVlanTagRewrite)(nil), "l2.L2InterfaceVlanTagRewrite") - api.RegisterMessage((*L2InterfaceVlanTagRewriteReply)(nil), "l2.L2InterfaceVlanTagRewriteReply") - api.RegisterMessage((*L2MacsEvent)(nil), "l2.L2MacsEvent") - api.RegisterMessage((*L2PatchAddDel)(nil), "l2.L2PatchAddDel") - api.RegisterMessage((*L2PatchAddDelReply)(nil), "l2.L2PatchAddDelReply") - api.RegisterMessage((*L2XconnectDetails)(nil), "l2.L2XconnectDetails") - api.RegisterMessage((*L2XconnectDump)(nil), "l2.L2XconnectDump") - api.RegisterMessage((*L2fibAddDel)(nil), "l2.L2fibAddDel") - api.RegisterMessage((*L2fibAddDelReply)(nil), "l2.L2fibAddDelReply") - api.RegisterMessage((*L2fibFlushAll)(nil), "l2.L2fibFlushAll") - api.RegisterMessage((*L2fibFlushAllReply)(nil), "l2.L2fibFlushAllReply") - api.RegisterMessage((*L2fibFlushBd)(nil), "l2.L2fibFlushBd") - api.RegisterMessage((*L2fibFlushBdReply)(nil), "l2.L2fibFlushBdReply") - api.RegisterMessage((*L2fibFlushInt)(nil), "l2.L2fibFlushInt") - api.RegisterMessage((*L2fibFlushIntReply)(nil), "l2.L2fibFlushIntReply") - api.RegisterMessage((*SwInterfaceSetL2Bridge)(nil), "l2.SwInterfaceSetL2Bridge") - api.RegisterMessage((*SwInterfaceSetL2BridgeReply)(nil), "l2.SwInterfaceSetL2BridgeReply") - api.RegisterMessage((*SwInterfaceSetL2Xconnect)(nil), "l2.SwInterfaceSetL2Xconnect") - api.RegisterMessage((*SwInterfaceSetL2XconnectReply)(nil), "l2.SwInterfaceSetL2XconnectReply") - api.RegisterMessage((*SwInterfaceSetVpath)(nil), "l2.SwInterfaceSetVpath") - api.RegisterMessage((*SwInterfaceSetVpathReply)(nil), "l2.SwInterfaceSetVpathReply") - api.RegisterMessage((*WantL2MacsEvents)(nil), "l2.WantL2MacsEvents") - api.RegisterMessage((*WantL2MacsEventsReply)(nil), "l2.WantL2MacsEventsReply") -} - -var Messages = []api.Message{ - (*BdIPMacAddDel)(nil), - (*BdIPMacAddDelReply)(nil), - (*BdIPMacDetails)(nil), - (*BdIPMacDump)(nil), - (*BridgeDomainAddDel)(nil), - (*BridgeDomainAddDelReply)(nil), - (*BridgeDomainDetails)(nil), - (*BridgeDomainDump)(nil), - (*BridgeDomainSetMacAge)(nil), - (*BridgeDomainSetMacAgeReply)(nil), - (*BridgeFlags)(nil), - (*BridgeFlagsReply)(nil), - (*L2FibClearTable)(nil), - (*L2FibClearTableReply)(nil), - (*L2FibTableDetails)(nil), - (*L2FibTableDump)(nil), - (*L2Flags)(nil), - (*L2FlagsReply)(nil), - (*L2InterfaceEfpFilter)(nil), - (*L2InterfaceEfpFilterReply)(nil), - (*L2InterfacePbbTagRewrite)(nil), - (*L2InterfacePbbTagRewriteReply)(nil), - (*L2InterfaceVlanTagRewrite)(nil), - (*L2InterfaceVlanTagRewriteReply)(nil), - (*L2MacsEvent)(nil), - (*L2PatchAddDel)(nil), - (*L2PatchAddDelReply)(nil), - (*L2XconnectDetails)(nil), - (*L2XconnectDump)(nil), - (*L2fibAddDel)(nil), - (*L2fibAddDelReply)(nil), - (*L2fibFlushAll)(nil), - (*L2fibFlushAllReply)(nil), - (*L2fibFlushBd)(nil), - (*L2fibFlushBdReply)(nil), - (*L2fibFlushInt)(nil), - (*L2fibFlushIntReply)(nil), - (*SwInterfaceSetL2Bridge)(nil), - (*SwInterfaceSetL2BridgeReply)(nil), - (*SwInterfaceSetL2Xconnect)(nil), - (*SwInterfaceSetL2XconnectReply)(nil), - (*SwInterfaceSetVpath)(nil), - (*SwInterfaceSetVpathReply)(nil), - (*WantL2MacsEvents)(nil), - (*WantL2MacsEventsReply)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/memclnt/memclnt.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/memclnt/memclnt.ba.go deleted file mode 100644 index 9230e0cdaa..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/memclnt/memclnt.ba.go +++ /dev/null @@ -1,469 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/memclnt.api.json - -/* - Package memclnt is a generated from VPP binary API module 'memclnt'. - - It contains following objects: - 13 services - 2 types - 22 messages -*/ -package memclnt - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - APIVersions(*APIVersions) (*APIVersionsReply, error) - GetFirstMsgID(*GetFirstMsgID) (*GetFirstMsgIDReply, error) - MemclntCreate(*MemclntCreate) (*MemclntCreateReply, error) - MemclntDelete(*MemclntDelete) (*MemclntDeleteReply, error) - MemclntKeepalive(*MemclntKeepalive) (*MemclntKeepaliveReply, error) - MemclntReadTimeout(*MemclntReadTimeout) error - MemclntRxThreadSuspend(*MemclntRxThreadSuspend) error - RPCCall(*RPCCall) (*RPCCallReply, error) - RxThreadExit(*RxThreadExit) error - SockInitShm(*SockInitShm) (*SockInitShmReply, error) - SockclntCreate(*SockclntCreate) (*SockclntCreateReply, error) - SockclntDelete(*SockclntDelete) (*SockclntDeleteReply, error) - TracePluginMsgIds(*TracePluginMsgIds) error -} - -/* Types */ - -// MessageTableEntry represents VPP binary API type 'message_table_entry': -type MessageTableEntry struct { - Index uint16 - Name []byte `struc:"[64]byte"` -} - -func (*MessageTableEntry) GetTypeName() string { - return "message_table_entry" -} -func (*MessageTableEntry) GetCrcString() string { - return "913bf1c6" -} - -// ModuleVersion represents VPP binary API type 'module_version': -type ModuleVersion struct { - Major uint32 - Minor uint32 - Patch uint32 - Name []byte `struc:"[64]byte"` -} - -func (*ModuleVersion) GetTypeName() string { - return "module_version" -} -func (*ModuleVersion) GetCrcString() string { - return "4b6da11a" -} - -/* Messages */ - -// APIVersions represents VPP binary API message 'api_versions': -type APIVersions struct{} - -func (*APIVersions) GetMessageName() string { - return "api_versions" -} -func (*APIVersions) GetCrcString() string { - return "51077d14" -} -func (*APIVersions) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// APIVersionsReply represents VPP binary API message 'api_versions_reply': -type APIVersionsReply struct { - Retval int32 - Count uint32 `struc:"sizeof=APIVersions"` - APIVersions []ModuleVersion -} - -func (*APIVersionsReply) GetMessageName() string { - return "api_versions_reply" -} -func (*APIVersionsReply) GetCrcString() string { - return "90a39195" -} -func (*APIVersionsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// GetFirstMsgID represents VPP binary API message 'get_first_msg_id': -type GetFirstMsgID struct { - Name []byte `struc:"[64]byte"` -} - -func (*GetFirstMsgID) GetMessageName() string { - return "get_first_msg_id" -} -func (*GetFirstMsgID) GetCrcString() string { - return "0cb71b0e" -} -func (*GetFirstMsgID) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// GetFirstMsgIDReply represents VPP binary API message 'get_first_msg_id_reply': -type GetFirstMsgIDReply struct { - Retval int32 - FirstMsgID uint16 -} - -func (*GetFirstMsgIDReply) GetMessageName() string { - return "get_first_msg_id_reply" -} -func (*GetFirstMsgIDReply) GetCrcString() string { - return "7d337472" -} -func (*GetFirstMsgIDReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MemclntCreate represents VPP binary API message 'memclnt_create': -type MemclntCreate struct { - CtxQuota int32 - InputQueue uint64 - Name []byte `struc:"[64]byte"` - APIVersions []uint32 `struc:"[8]uint32"` -} - -func (*MemclntCreate) GetMessageName() string { - return "memclnt_create" -} -func (*MemclntCreate) GetCrcString() string { - return "6d33c5ea" -} -func (*MemclntCreate) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MemclntCreateReply represents VPP binary API message 'memclnt_create_reply': -type MemclntCreateReply struct { - Response int32 - Handle uint64 - Index uint32 - MessageTable uint64 -} - -func (*MemclntCreateReply) GetMessageName() string { - return "memclnt_create_reply" -} -func (*MemclntCreateReply) GetCrcString() string { - return "42ec4560" -} -func (*MemclntCreateReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MemclntDelete represents VPP binary API message 'memclnt_delete': -type MemclntDelete struct { - Index uint32 - Handle uint64 -} - -func (*MemclntDelete) GetMessageName() string { - return "memclnt_delete" -} -func (*MemclntDelete) GetCrcString() string { - return "73240f13" -} -func (*MemclntDelete) GetMessageType() api.MessageType { - return api.OtherMessage -} - -// MemclntDeleteReply represents VPP binary API message 'memclnt_delete_reply': -type MemclntDeleteReply struct { - Response int32 - Handle uint64 -} - -func (*MemclntDeleteReply) GetMessageName() string { - return "memclnt_delete_reply" -} -func (*MemclntDeleteReply) GetCrcString() string { - return "3d3b6312" -} -func (*MemclntDeleteReply) GetMessageType() api.MessageType { - return api.OtherMessage -} - -// MemclntKeepalive represents VPP binary API message 'memclnt_keepalive': -type MemclntKeepalive struct{} - -func (*MemclntKeepalive) GetMessageName() string { - return "memclnt_keepalive" -} -func (*MemclntKeepalive) GetCrcString() string { - return "51077d14" -} -func (*MemclntKeepalive) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// MemclntKeepaliveReply represents VPP binary API message 'memclnt_keepalive_reply': -type MemclntKeepaliveReply struct { - Retval int32 -} - -func (*MemclntKeepaliveReply) GetMessageName() string { - return "memclnt_keepalive_reply" -} -func (*MemclntKeepaliveReply) GetCrcString() string { - return "e8d4e804" -} -func (*MemclntKeepaliveReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MemclntReadTimeout represents VPP binary API message 'memclnt_read_timeout': -type MemclntReadTimeout struct { - Dummy uint8 -} - -func (*MemclntReadTimeout) GetMessageName() string { - return "memclnt_read_timeout" -} -func (*MemclntReadTimeout) GetCrcString() string { - return "c3a3a452" -} -func (*MemclntReadTimeout) GetMessageType() api.MessageType { - return api.OtherMessage -} - -// MemclntRxThreadSuspend represents VPP binary API message 'memclnt_rx_thread_suspend': -type MemclntRxThreadSuspend struct { - Dummy uint8 -} - -func (*MemclntRxThreadSuspend) GetMessageName() string { - return "memclnt_rx_thread_suspend" -} -func (*MemclntRxThreadSuspend) GetCrcString() string { - return "c3a3a452" -} -func (*MemclntRxThreadSuspend) GetMessageType() api.MessageType { - return api.OtherMessage -} - -// RPCCall represents VPP binary API message 'rpc_call': -type RPCCall struct { - Function uint64 - Multicast uint8 - NeedBarrierSync uint8 - SendReply uint8 - DataLen uint32 `struc:"sizeof=Data"` - Data []byte -} - -func (*RPCCall) GetMessageName() string { - return "rpc_call" -} -func (*RPCCall) GetCrcString() string { - return "7e8a2c95" -} -func (*RPCCall) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// RPCCallReply represents VPP binary API message 'rpc_call_reply': -type RPCCallReply struct { - Retval int32 -} - -func (*RPCCallReply) GetMessageName() string { - return "rpc_call_reply" -} -func (*RPCCallReply) GetCrcString() string { - return "e8d4e804" -} -func (*RPCCallReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// RxThreadExit represents VPP binary API message 'rx_thread_exit': -type RxThreadExit struct { - Dummy uint8 -} - -func (*RxThreadExit) GetMessageName() string { - return "rx_thread_exit" -} -func (*RxThreadExit) GetCrcString() string { - return "c3a3a452" -} -func (*RxThreadExit) GetMessageType() api.MessageType { - return api.OtherMessage -} - -// SockInitShm represents VPP binary API message 'sock_init_shm': -type SockInitShm struct { - RequestedSize uint32 - Nitems uint8 `struc:"sizeof=Configs"` - Configs []uint64 -} - -func (*SockInitShm) GetMessageName() string { - return "sock_init_shm" -} -func (*SockInitShm) GetCrcString() string { - return "51646d92" -} -func (*SockInitShm) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SockInitShmReply represents VPP binary API message 'sock_init_shm_reply': -type SockInitShmReply struct { - Retval int32 -} - -func (*SockInitShmReply) GetMessageName() string { - return "sock_init_shm_reply" -} -func (*SockInitShmReply) GetCrcString() string { - return "e8d4e804" -} -func (*SockInitShmReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SockclntCreate represents VPP binary API message 'sockclnt_create': -type SockclntCreate struct { - Name []byte `struc:"[64]byte"` -} - -func (*SockclntCreate) GetMessageName() string { - return "sockclnt_create" -} -func (*SockclntCreate) GetCrcString() string { - return "df2cf94d" -} -func (*SockclntCreate) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SockclntCreateReply represents VPP binary API message 'sockclnt_create_reply': -type SockclntCreateReply struct { - Response int32 - Index uint32 - Count uint16 `struc:"sizeof=MessageTable"` - MessageTable []MessageTableEntry -} - -func (*SockclntCreateReply) GetMessageName() string { - return "sockclnt_create_reply" -} -func (*SockclntCreateReply) GetCrcString() string { - return "a134a8a8" -} -func (*SockclntCreateReply) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SockclntDelete represents VPP binary API message 'sockclnt_delete': -type SockclntDelete struct { - Index uint32 -} - -func (*SockclntDelete) GetMessageName() string { - return "sockclnt_delete" -} -func (*SockclntDelete) GetCrcString() string { - return "8ac76db6" -} -func (*SockclntDelete) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SockclntDeleteReply represents VPP binary API message 'sockclnt_delete_reply': -type SockclntDeleteReply struct { - Response int32 -} - -func (*SockclntDeleteReply) GetMessageName() string { - return "sockclnt_delete_reply" -} -func (*SockclntDeleteReply) GetCrcString() string { - return "8f38b1ee" -} -func (*SockclntDeleteReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// TracePluginMsgIds represents VPP binary API message 'trace_plugin_msg_ids': -type TracePluginMsgIds struct { - PluginName []byte `struc:"[128]byte"` - FirstMsgID uint16 - LastMsgID uint16 -} - -func (*TracePluginMsgIds) GetMessageName() string { - return "trace_plugin_msg_ids" -} -func (*TracePluginMsgIds) GetCrcString() string { - return "64af79f9" -} -func (*TracePluginMsgIds) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func init() { - api.RegisterMessage((*APIVersions)(nil), "memclnt.APIVersions") - api.RegisterMessage((*APIVersionsReply)(nil), "memclnt.APIVersionsReply") - api.RegisterMessage((*GetFirstMsgID)(nil), "memclnt.GetFirstMsgID") - api.RegisterMessage((*GetFirstMsgIDReply)(nil), "memclnt.GetFirstMsgIDReply") - api.RegisterMessage((*MemclntCreate)(nil), "memclnt.MemclntCreate") - api.RegisterMessage((*MemclntCreateReply)(nil), "memclnt.MemclntCreateReply") - api.RegisterMessage((*MemclntDelete)(nil), "memclnt.MemclntDelete") - api.RegisterMessage((*MemclntDeleteReply)(nil), "memclnt.MemclntDeleteReply") - api.RegisterMessage((*MemclntKeepalive)(nil), "memclnt.MemclntKeepalive") - api.RegisterMessage((*MemclntKeepaliveReply)(nil), "memclnt.MemclntKeepaliveReply") - api.RegisterMessage((*MemclntReadTimeout)(nil), "memclnt.MemclntReadTimeout") - api.RegisterMessage((*MemclntRxThreadSuspend)(nil), "memclnt.MemclntRxThreadSuspend") - api.RegisterMessage((*RPCCall)(nil), "memclnt.RPCCall") - api.RegisterMessage((*RPCCallReply)(nil), "memclnt.RPCCallReply") - api.RegisterMessage((*RxThreadExit)(nil), "memclnt.RxThreadExit") - api.RegisterMessage((*SockInitShm)(nil), "memclnt.SockInitShm") - api.RegisterMessage((*SockInitShmReply)(nil), "memclnt.SockInitShmReply") - api.RegisterMessage((*SockclntCreate)(nil), "memclnt.SockclntCreate") - api.RegisterMessage((*SockclntCreateReply)(nil), "memclnt.SockclntCreateReply") - api.RegisterMessage((*SockclntDelete)(nil), "memclnt.SockclntDelete") - api.RegisterMessage((*SockclntDeleteReply)(nil), "memclnt.SockclntDeleteReply") - api.RegisterMessage((*TracePluginMsgIds)(nil), "memclnt.TracePluginMsgIds") -} - -var Messages = []api.Message{ - (*APIVersions)(nil), - (*APIVersionsReply)(nil), - (*GetFirstMsgID)(nil), - (*GetFirstMsgIDReply)(nil), - (*MemclntCreate)(nil), - (*MemclntCreateReply)(nil), - (*MemclntDelete)(nil), - (*MemclntDeleteReply)(nil), - (*MemclntKeepalive)(nil), - (*MemclntKeepaliveReply)(nil), - (*MemclntReadTimeout)(nil), - (*MemclntRxThreadSuspend)(nil), - (*RPCCall)(nil), - (*RPCCallReply)(nil), - (*RxThreadExit)(nil), - (*SockInitShm)(nil), - (*SockInitShmReply)(nil), - (*SockclntCreate)(nil), - (*SockclntCreateReply)(nil), - (*SockclntDelete)(nil), - (*SockclntDeleteReply)(nil), - (*TracePluginMsgIds)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/memif/memif.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/memif/memif.ba.go deleted file mode 100644 index 6f1c027649..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/memif/memif.ba.go +++ /dev/null @@ -1,226 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/memif.api.json - -/* - Package memif is a generated from VPP binary API module 'memif'. - - It contains following objects: - 5 services - 10 messages -*/ -package memif - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpMemif(*MemifDump) ([]*MemifDetails, error) - DumpMemifSocketFilename(*MemifSocketFilenameDump) ([]*MemifSocketFilenameDetails, error) - MemifCreate(*MemifCreate) (*MemifCreateReply, error) - MemifDelete(*MemifDelete) (*MemifDeleteReply, error) - MemifSocketFilenameAddDel(*MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error) -} - -/* Messages */ - -// MemifCreate represents VPP binary API message 'memif_create': -type MemifCreate struct { - Role uint8 - Mode uint8 - RxQueues uint8 - TxQueues uint8 - ID uint32 - SocketID uint32 - Secret []byte `struc:"[24]byte"` - RingSize uint32 - BufferSize uint16 - HwAddr []byte `struc:"[6]byte"` -} - -func (*MemifCreate) GetMessageName() string { - return "memif_create" -} -func (*MemifCreate) GetCrcString() string { - return "6597cdb2" -} -func (*MemifCreate) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// MemifCreateReply represents VPP binary API message 'memif_create_reply': -type MemifCreateReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*MemifCreateReply) GetMessageName() string { - return "memif_create_reply" -} -func (*MemifCreateReply) GetCrcString() string { - return "fda5941f" -} -func (*MemifCreateReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MemifDelete represents VPP binary API message 'memif_delete': -type MemifDelete struct { - SwIfIndex uint32 -} - -func (*MemifDelete) GetMessageName() string { - return "memif_delete" -} -func (*MemifDelete) GetCrcString() string { - return "529cb13f" -} -func (*MemifDelete) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// MemifDeleteReply represents VPP binary API message 'memif_delete_reply': -type MemifDeleteReply struct { - Retval int32 -} - -func (*MemifDeleteReply) GetMessageName() string { - return "memif_delete_reply" -} -func (*MemifDeleteReply) GetCrcString() string { - return "e8d4e804" -} -func (*MemifDeleteReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MemifDetails represents VPP binary API message 'memif_details': -type MemifDetails struct { - SwIfIndex uint32 - IfName []byte `struc:"[64]byte"` - HwAddr []byte `struc:"[6]byte"` - ID uint32 - Role uint8 - Mode uint8 - SocketID uint32 - RingSize uint32 - BufferSize uint16 - AdminUpDown uint8 - LinkUpDown uint8 -} - -func (*MemifDetails) GetMessageName() string { - return "memif_details" -} -func (*MemifDetails) GetCrcString() string { - return "4f5a3397" -} -func (*MemifDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MemifDump represents VPP binary API message 'memif_dump': -type MemifDump struct{} - -func (*MemifDump) GetMessageName() string { - return "memif_dump" -} -func (*MemifDump) GetCrcString() string { - return "51077d14" -} -func (*MemifDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// MemifSocketFilenameAddDel represents VPP binary API message 'memif_socket_filename_add_del': -type MemifSocketFilenameAddDel struct { - IsAdd uint8 - SocketID uint32 - SocketFilename []byte `struc:"[128]byte"` -} - -func (*MemifSocketFilenameAddDel) GetMessageName() string { - return "memif_socket_filename_add_del" -} -func (*MemifSocketFilenameAddDel) GetCrcString() string { - return "30e3929d" -} -func (*MemifSocketFilenameAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// MemifSocketFilenameAddDelReply represents VPP binary API message 'memif_socket_filename_add_del_reply': -type MemifSocketFilenameAddDelReply struct { - Retval int32 -} - -func (*MemifSocketFilenameAddDelReply) GetMessageName() string { - return "memif_socket_filename_add_del_reply" -} -func (*MemifSocketFilenameAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*MemifSocketFilenameAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MemifSocketFilenameDetails represents VPP binary API message 'memif_socket_filename_details': -type MemifSocketFilenameDetails struct { - SocketID uint32 - SocketFilename []byte `struc:"[128]byte"` -} - -func (*MemifSocketFilenameDetails) GetMessageName() string { - return "memif_socket_filename_details" -} -func (*MemifSocketFilenameDetails) GetCrcString() string { - return "e347e32f" -} -func (*MemifSocketFilenameDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// MemifSocketFilenameDump represents VPP binary API message 'memif_socket_filename_dump': -type MemifSocketFilenameDump struct{} - -func (*MemifSocketFilenameDump) GetMessageName() string { - return "memif_socket_filename_dump" -} -func (*MemifSocketFilenameDump) GetCrcString() string { - return "51077d14" -} -func (*MemifSocketFilenameDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func init() { - api.RegisterMessage((*MemifCreate)(nil), "memif.MemifCreate") - api.RegisterMessage((*MemifCreateReply)(nil), "memif.MemifCreateReply") - api.RegisterMessage((*MemifDelete)(nil), "memif.MemifDelete") - api.RegisterMessage((*MemifDeleteReply)(nil), "memif.MemifDeleteReply") - api.RegisterMessage((*MemifDetails)(nil), "memif.MemifDetails") - api.RegisterMessage((*MemifDump)(nil), "memif.MemifDump") - api.RegisterMessage((*MemifSocketFilenameAddDel)(nil), "memif.MemifSocketFilenameAddDel") - api.RegisterMessage((*MemifSocketFilenameAddDelReply)(nil), "memif.MemifSocketFilenameAddDelReply") - api.RegisterMessage((*MemifSocketFilenameDetails)(nil), "memif.MemifSocketFilenameDetails") - api.RegisterMessage((*MemifSocketFilenameDump)(nil), "memif.MemifSocketFilenameDump") -} - -var Messages = []api.Message{ - (*MemifCreate)(nil), - (*MemifCreateReply)(nil), - (*MemifDelete)(nil), - (*MemifDeleteReply)(nil), - (*MemifDetails)(nil), - (*MemifDump)(nil), - (*MemifSocketFilenameAddDel)(nil), - (*MemifSocketFilenameAddDelReply)(nil), - (*MemifSocketFilenameDetails)(nil), - (*MemifSocketFilenameDump)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/nat/nat.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/nat/nat.ba.go deleted file mode 100644 index b3750788b1..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/nat/nat.ba.go +++ /dev/null @@ -1,2340 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/nat.api.json - -/* - Package nat is a generated from VPP binary API module 'nat'. - - It contains following objects: - 60 services - 1 type - 120 messages -*/ -package nat - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpDsliteAddress(*DsliteAddressDump) ([]*DsliteAddressDetails, error) - DumpNat44Address(*Nat44AddressDump) ([]*Nat44AddressDetails, error) - DumpNat44IdentityMapping(*Nat44IdentityMappingDump) ([]*Nat44IdentityMappingDetails, error) - DumpNat44InterfaceAddr(*Nat44InterfaceAddrDump) ([]*Nat44InterfaceAddrDetails, error) - DumpNat44Interface(*Nat44InterfaceDump) ([]*Nat44InterfaceDetails, error) - DumpNat44InterfaceOutputFeature(*Nat44InterfaceOutputFeatureDump) ([]*Nat44InterfaceOutputFeatureDetails, error) - DumpNat44LbStaticMapping(*Nat44LbStaticMappingDump) ([]*Nat44LbStaticMappingDetails, error) - DumpNat44StaticMapping(*Nat44StaticMappingDump) ([]*Nat44StaticMappingDetails, error) - DumpNat44User(*Nat44UserDump) ([]*Nat44UserDetails, error) - DumpNat44UserSession(*Nat44UserSessionDump) ([]*Nat44UserSessionDetails, error) - DumpNat64Bib(*Nat64BibDump) ([]*Nat64BibDetails, error) - DumpNat64Interface(*Nat64InterfaceDump) ([]*Nat64InterfaceDetails, error) - DumpNat64PoolAddr(*Nat64PoolAddrDump) ([]*Nat64PoolAddrDetails, error) - DumpNat64Prefix(*Nat64PrefixDump) ([]*Nat64PrefixDetails, error) - DumpNat64St(*Nat64StDump) ([]*Nat64StDetails, error) - DumpNat66Interface(*Nat66InterfaceDump) ([]*Nat66InterfaceDetails, error) - DumpNat66StaticMapping(*Nat66StaticMappingDump) ([]*Nat66StaticMappingDetails, error) - DumpNatDetMap(*NatDetMapDump) ([]*NatDetMapDetails, error) - DumpNatDetSession(*NatDetSessionDump) ([]*NatDetSessionDetails, error) - DumpNatReass(*NatReassDump) ([]*NatReassDetails, error) - DumpNatWorker(*NatWorkerDump) ([]*NatWorkerDetails, error) - DsliteAddDelPoolAddrRange(*DsliteAddDelPoolAddrRange) (*DsliteAddDelPoolAddrRangeReply, error) - DsliteGetAftrAddr(*DsliteGetAftrAddr) (*DsliteGetAftrAddrReply, error) - DsliteGetB4Addr(*DsliteGetB4Addr) (*DsliteGetB4AddrReply, error) - DsliteSetAftrAddr(*DsliteSetAftrAddr) (*DsliteSetAftrAddrReply, error) - DsliteSetB4Addr(*DsliteSetB4Addr) (*DsliteSetB4AddrReply, error) - Nat44AddDelAddressRange(*Nat44AddDelAddressRange) (*Nat44AddDelAddressRangeReply, error) - Nat44AddDelIdentityMapping(*Nat44AddDelIdentityMapping) (*Nat44AddDelIdentityMappingReply, error) - Nat44AddDelInterfaceAddr(*Nat44AddDelInterfaceAddr) (*Nat44AddDelInterfaceAddrReply, error) - Nat44AddDelLbStaticMapping(*Nat44AddDelLbStaticMapping) (*Nat44AddDelLbStaticMappingReply, error) - Nat44AddDelStaticMapping(*Nat44AddDelStaticMapping) (*Nat44AddDelStaticMappingReply, error) - Nat44DelSession(*Nat44DelSession) (*Nat44DelSessionReply, error) - Nat44ForwardingEnableDisable(*Nat44ForwardingEnableDisable) (*Nat44ForwardingEnableDisableReply, error) - Nat44ForwardingIsEnabled(*Nat44ForwardingIsEnabled) (*Nat44ForwardingIsEnabledReply, error) - Nat44InterfaceAddDelFeature(*Nat44InterfaceAddDelFeature) (*Nat44InterfaceAddDelFeatureReply, error) - Nat44InterfaceAddDelOutputFeature(*Nat44InterfaceAddDelOutputFeature) (*Nat44InterfaceAddDelOutputFeatureReply, error) - Nat64AddDelInterface(*Nat64AddDelInterface) (*Nat64AddDelInterfaceReply, error) - Nat64AddDelInterfaceAddr(*Nat64AddDelInterfaceAddr) (*Nat64AddDelInterfaceAddrReply, error) - Nat64AddDelPoolAddrRange(*Nat64AddDelPoolAddrRange) (*Nat64AddDelPoolAddrRangeReply, error) - Nat64AddDelPrefix(*Nat64AddDelPrefix) (*Nat64AddDelPrefixReply, error) - Nat64AddDelStaticBib(*Nat64AddDelStaticBib) (*Nat64AddDelStaticBibReply, error) - Nat66AddDelInterface(*Nat66AddDelInterface) (*Nat66AddDelInterfaceReply, error) - Nat66AddDelStaticMapping(*Nat66AddDelStaticMapping) (*Nat66AddDelStaticMappingReply, error) - NatControlPing(*NatControlPing) (*NatControlPingReply, error) - NatDetAddDelMap(*NatDetAddDelMap) (*NatDetAddDelMapReply, error) - NatDetCloseSessionIn(*NatDetCloseSessionIn) (*NatDetCloseSessionInReply, error) - NatDetCloseSessionOut(*NatDetCloseSessionOut) (*NatDetCloseSessionOutReply, error) - NatDetForward(*NatDetForward) (*NatDetForwardReply, error) - NatDetReverse(*NatDetReverse) (*NatDetReverseReply, error) - NatGetAddrAndPortAllocAlg(*NatGetAddrAndPortAllocAlg) (*NatGetAddrAndPortAllocAlgReply, error) - NatGetMssClamping(*NatGetMssClamping) (*NatGetMssClampingReply, error) - NatGetReass(*NatGetReass) (*NatGetReassReply, error) - NatGetTimeouts(*NatGetTimeouts) (*NatGetTimeoutsReply, error) - NatIpfixEnableDisable(*NatIpfixEnableDisable) (*NatIpfixEnableDisableReply, error) - NatSetAddrAndPortAllocAlg(*NatSetAddrAndPortAllocAlg) (*NatSetAddrAndPortAllocAlgReply, error) - NatSetMssClamping(*NatSetMssClamping) (*NatSetMssClampingReply, error) - NatSetReass(*NatSetReass) (*NatSetReassReply, error) - NatSetTimeouts(*NatSetTimeouts) (*NatSetTimeoutsReply, error) - NatSetWorkers(*NatSetWorkers) (*NatSetWorkersReply, error) - NatShowConfig(*NatShowConfig) (*NatShowConfigReply, error) -} - -/* Types */ - -// Nat44LbAddrPort represents VPP binary API type 'nat44_lb_addr_port': -type Nat44LbAddrPort struct { - Addr []byte `struc:"[4]byte"` - Port uint16 - Probability uint8 - VrfID uint32 -} - -func (*Nat44LbAddrPort) GetTypeName() string { - return "nat44_lb_addr_port" -} -func (*Nat44LbAddrPort) GetCrcString() string { - return "15ce9cd1" -} - -/* Messages */ - -// DsliteAddDelPoolAddrRange represents VPP binary API message 'dslite_add_del_pool_addr_range': -type DsliteAddDelPoolAddrRange struct { - StartAddr []byte `struc:"[4]byte"` - EndAddr []byte `struc:"[4]byte"` - IsAdd uint8 -} - -func (*DsliteAddDelPoolAddrRange) GetMessageName() string { - return "dslite_add_del_pool_addr_range" -} -func (*DsliteAddDelPoolAddrRange) GetCrcString() string { - return "258bff2a" -} -func (*DsliteAddDelPoolAddrRange) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DsliteAddDelPoolAddrRangeReply represents VPP binary API message 'dslite_add_del_pool_addr_range_reply': -type DsliteAddDelPoolAddrRangeReply struct { - Retval int32 -} - -func (*DsliteAddDelPoolAddrRangeReply) GetMessageName() string { - return "dslite_add_del_pool_addr_range_reply" -} -func (*DsliteAddDelPoolAddrRangeReply) GetCrcString() string { - return "e8d4e804" -} -func (*DsliteAddDelPoolAddrRangeReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DsliteAddressDetails represents VPP binary API message 'dslite_address_details': -type DsliteAddressDetails struct { - IPAddress []byte `struc:"[4]byte"` -} - -func (*DsliteAddressDetails) GetMessageName() string { - return "dslite_address_details" -} -func (*DsliteAddressDetails) GetCrcString() string { - return "ade70e23" -} -func (*DsliteAddressDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DsliteAddressDump represents VPP binary API message 'dslite_address_dump': -type DsliteAddressDump struct{} - -func (*DsliteAddressDump) GetMessageName() string { - return "dslite_address_dump" -} -func (*DsliteAddressDump) GetCrcString() string { - return "51077d14" -} -func (*DsliteAddressDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DsliteGetAftrAddr represents VPP binary API message 'dslite_get_aftr_addr': -type DsliteGetAftrAddr struct{} - -func (*DsliteGetAftrAddr) GetMessageName() string { - return "dslite_get_aftr_addr" -} -func (*DsliteGetAftrAddr) GetCrcString() string { - return "51077d14" -} -func (*DsliteGetAftrAddr) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DsliteGetAftrAddrReply represents VPP binary API message 'dslite_get_aftr_addr_reply': -type DsliteGetAftrAddrReply struct { - Retval int32 - IP4Addr []byte `struc:"[4]byte"` - IP6Addr []byte `struc:"[16]byte"` -} - -func (*DsliteGetAftrAddrReply) GetMessageName() string { - return "dslite_get_aftr_addr_reply" -} -func (*DsliteGetAftrAddrReply) GetCrcString() string { - return "2c4c3037" -} -func (*DsliteGetAftrAddrReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DsliteGetB4Addr represents VPP binary API message 'dslite_get_b4_addr': -type DsliteGetB4Addr struct{} - -func (*DsliteGetB4Addr) GetMessageName() string { - return "dslite_get_b4_addr" -} -func (*DsliteGetB4Addr) GetCrcString() string { - return "51077d14" -} -func (*DsliteGetB4Addr) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DsliteGetB4AddrReply represents VPP binary API message 'dslite_get_b4_addr_reply': -type DsliteGetB4AddrReply struct { - Retval int32 - IP4Addr []byte `struc:"[4]byte"` - IP6Addr []byte `struc:"[16]byte"` -} - -func (*DsliteGetB4AddrReply) GetMessageName() string { - return "dslite_get_b4_addr_reply" -} -func (*DsliteGetB4AddrReply) GetCrcString() string { - return "2c4c3037" -} -func (*DsliteGetB4AddrReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DsliteSetAftrAddr represents VPP binary API message 'dslite_set_aftr_addr': -type DsliteSetAftrAddr struct { - IP4Addr []byte `struc:"[4]byte"` - IP6Addr []byte `struc:"[16]byte"` -} - -func (*DsliteSetAftrAddr) GetMessageName() string { - return "dslite_set_aftr_addr" -} -func (*DsliteSetAftrAddr) GetCrcString() string { - return "2e9c01ef" -} -func (*DsliteSetAftrAddr) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DsliteSetAftrAddrReply represents VPP binary API message 'dslite_set_aftr_addr_reply': -type DsliteSetAftrAddrReply struct { - Retval int32 -} - -func (*DsliteSetAftrAddrReply) GetMessageName() string { - return "dslite_set_aftr_addr_reply" -} -func (*DsliteSetAftrAddrReply) GetCrcString() string { - return "e8d4e804" -} -func (*DsliteSetAftrAddrReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// DsliteSetB4Addr represents VPP binary API message 'dslite_set_b4_addr': -type DsliteSetB4Addr struct { - IP4Addr []byte `struc:"[4]byte"` - IP6Addr []byte `struc:"[16]byte"` -} - -func (*DsliteSetB4Addr) GetMessageName() string { - return "dslite_set_b4_addr" -} -func (*DsliteSetB4Addr) GetCrcString() string { - return "2e9c01ef" -} -func (*DsliteSetB4Addr) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// DsliteSetB4AddrReply represents VPP binary API message 'dslite_set_b4_addr_reply': -type DsliteSetB4AddrReply struct { - Retval int32 -} - -func (*DsliteSetB4AddrReply) GetMessageName() string { - return "dslite_set_b4_addr_reply" -} -func (*DsliteSetB4AddrReply) GetCrcString() string { - return "e8d4e804" -} -func (*DsliteSetB4AddrReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44AddDelAddressRange represents VPP binary API message 'nat44_add_del_address_range': -type Nat44AddDelAddressRange struct { - FirstIPAddress []byte `struc:"[4]byte"` - LastIPAddress []byte `struc:"[4]byte"` - VrfID uint32 - TwiceNat uint8 - IsAdd uint8 -} - -func (*Nat44AddDelAddressRange) GetMessageName() string { - return "nat44_add_del_address_range" -} -func (*Nat44AddDelAddressRange) GetCrcString() string { - return "4a7d5c11" -} -func (*Nat44AddDelAddressRange) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44AddDelAddressRangeReply represents VPP binary API message 'nat44_add_del_address_range_reply': -type Nat44AddDelAddressRangeReply struct { - Retval int32 -} - -func (*Nat44AddDelAddressRangeReply) GetMessageName() string { - return "nat44_add_del_address_range_reply" -} -func (*Nat44AddDelAddressRangeReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat44AddDelAddressRangeReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44AddDelIdentityMapping represents VPP binary API message 'nat44_add_del_identity_mapping': -type Nat44AddDelIdentityMapping struct { - IsAdd uint8 - AddrOnly uint8 - IPAddress []byte `struc:"[4]byte"` - Protocol uint8 - Port uint16 - SwIfIndex uint32 - VrfID uint32 - Tag []byte `struc:"[64]byte"` -} - -func (*Nat44AddDelIdentityMapping) GetMessageName() string { - return "nat44_add_del_identity_mapping" -} -func (*Nat44AddDelIdentityMapping) GetCrcString() string { - return "8ead5659" -} -func (*Nat44AddDelIdentityMapping) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44AddDelIdentityMappingReply represents VPP binary API message 'nat44_add_del_identity_mapping_reply': -type Nat44AddDelIdentityMappingReply struct { - Retval int32 -} - -func (*Nat44AddDelIdentityMappingReply) GetMessageName() string { - return "nat44_add_del_identity_mapping_reply" -} -func (*Nat44AddDelIdentityMappingReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat44AddDelIdentityMappingReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44AddDelInterfaceAddr represents VPP binary API message 'nat44_add_del_interface_addr': -type Nat44AddDelInterfaceAddr struct { - IsAdd uint8 - TwiceNat uint8 - SwIfIndex uint32 -} - -func (*Nat44AddDelInterfaceAddr) GetMessageName() string { - return "nat44_add_del_interface_addr" -} -func (*Nat44AddDelInterfaceAddr) GetCrcString() string { - return "61105dfa" -} -func (*Nat44AddDelInterfaceAddr) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44AddDelInterfaceAddrReply represents VPP binary API message 'nat44_add_del_interface_addr_reply': -type Nat44AddDelInterfaceAddrReply struct { - Retval int32 -} - -func (*Nat44AddDelInterfaceAddrReply) GetMessageName() string { - return "nat44_add_del_interface_addr_reply" -} -func (*Nat44AddDelInterfaceAddrReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat44AddDelInterfaceAddrReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44AddDelLbStaticMapping represents VPP binary API message 'nat44_add_del_lb_static_mapping': -type Nat44AddDelLbStaticMapping struct { - IsAdd uint8 - ExternalAddr []byte `struc:"[4]byte"` - ExternalPort uint16 - Protocol uint8 - TwiceNat uint8 - SelfTwiceNat uint8 - Out2inOnly uint8 - Tag []byte `struc:"[64]byte"` - Affinity uint32 - LocalNum uint8 `struc:"sizeof=Locals"` - Locals []Nat44LbAddrPort -} - -func (*Nat44AddDelLbStaticMapping) GetMessageName() string { - return "nat44_add_del_lb_static_mapping" -} -func (*Nat44AddDelLbStaticMapping) GetCrcString() string { - return "135f5f3a" -} -func (*Nat44AddDelLbStaticMapping) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44AddDelLbStaticMappingReply represents VPP binary API message 'nat44_add_del_lb_static_mapping_reply': -type Nat44AddDelLbStaticMappingReply struct { - Retval int32 -} - -func (*Nat44AddDelLbStaticMappingReply) GetMessageName() string { - return "nat44_add_del_lb_static_mapping_reply" -} -func (*Nat44AddDelLbStaticMappingReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat44AddDelLbStaticMappingReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44AddDelStaticMapping represents VPP binary API message 'nat44_add_del_static_mapping': -type Nat44AddDelStaticMapping struct { - IsAdd uint8 - AddrOnly uint8 - LocalIPAddress []byte `struc:"[4]byte"` - ExternalIPAddress []byte `struc:"[4]byte"` - Protocol uint8 - LocalPort uint16 - ExternalPort uint16 - ExternalSwIfIndex uint32 - VrfID uint32 - TwiceNat uint8 - SelfTwiceNat uint8 - Out2inOnly uint8 - Tag []byte `struc:"[64]byte"` -} - -func (*Nat44AddDelStaticMapping) GetMessageName() string { - return "nat44_add_del_static_mapping" -} -func (*Nat44AddDelStaticMapping) GetCrcString() string { - return "9f35331e" -} -func (*Nat44AddDelStaticMapping) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44AddDelStaticMappingReply represents VPP binary API message 'nat44_add_del_static_mapping_reply': -type Nat44AddDelStaticMappingReply struct { - Retval int32 -} - -func (*Nat44AddDelStaticMappingReply) GetMessageName() string { - return "nat44_add_del_static_mapping_reply" -} -func (*Nat44AddDelStaticMappingReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat44AddDelStaticMappingReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44AddressDetails represents VPP binary API message 'nat44_address_details': -type Nat44AddressDetails struct { - IPAddress []byte `struc:"[4]byte"` - TwiceNat uint8 - VrfID uint32 -} - -func (*Nat44AddressDetails) GetMessageName() string { - return "nat44_address_details" -} -func (*Nat44AddressDetails) GetCrcString() string { - return "512feae8" -} -func (*Nat44AddressDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44AddressDump represents VPP binary API message 'nat44_address_dump': -type Nat44AddressDump struct{} - -func (*Nat44AddressDump) GetMessageName() string { - return "nat44_address_dump" -} -func (*Nat44AddressDump) GetCrcString() string { - return "51077d14" -} -func (*Nat44AddressDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44DelSession represents VPP binary API message 'nat44_del_session': -type Nat44DelSession struct { - IsIn uint8 - Address []byte `struc:"[4]byte"` - Protocol uint8 - Port uint16 - VrfID uint32 - ExtHostValid uint8 - ExtHostAddress []byte `struc:"[4]byte"` - ExtHostPort uint16 -} - -func (*Nat44DelSession) GetMessageName() string { - return "nat44_del_session" -} -func (*Nat44DelSession) GetCrcString() string { - return "04154d0c" -} -func (*Nat44DelSession) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44DelSessionReply represents VPP binary API message 'nat44_del_session_reply': -type Nat44DelSessionReply struct { - Retval int32 -} - -func (*Nat44DelSessionReply) GetMessageName() string { - return "nat44_del_session_reply" -} -func (*Nat44DelSessionReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat44DelSessionReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44ForwardingEnableDisable represents VPP binary API message 'nat44_forwarding_enable_disable': -type Nat44ForwardingEnableDisable struct { - Enable uint8 -} - -func (*Nat44ForwardingEnableDisable) GetMessageName() string { - return "nat44_forwarding_enable_disable" -} -func (*Nat44ForwardingEnableDisable) GetCrcString() string { - return "8050327d" -} -func (*Nat44ForwardingEnableDisable) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44ForwardingEnableDisableReply represents VPP binary API message 'nat44_forwarding_enable_disable_reply': -type Nat44ForwardingEnableDisableReply struct { - Retval int32 -} - -func (*Nat44ForwardingEnableDisableReply) GetMessageName() string { - return "nat44_forwarding_enable_disable_reply" -} -func (*Nat44ForwardingEnableDisableReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat44ForwardingEnableDisableReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44ForwardingIsEnabled represents VPP binary API message 'nat44_forwarding_is_enabled': -type Nat44ForwardingIsEnabled struct{} - -func (*Nat44ForwardingIsEnabled) GetMessageName() string { - return "nat44_forwarding_is_enabled" -} -func (*Nat44ForwardingIsEnabled) GetCrcString() string { - return "51077d14" -} -func (*Nat44ForwardingIsEnabled) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44ForwardingIsEnabledReply represents VPP binary API message 'nat44_forwarding_is_enabled_reply': -type Nat44ForwardingIsEnabledReply struct { - Enabled uint8 -} - -func (*Nat44ForwardingIsEnabledReply) GetMessageName() string { - return "nat44_forwarding_is_enabled_reply" -} -func (*Nat44ForwardingIsEnabledReply) GetCrcString() string { - return "9c4a7828" -} -func (*Nat44ForwardingIsEnabledReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44IdentityMappingDetails represents VPP binary API message 'nat44_identity_mapping_details': -type Nat44IdentityMappingDetails struct { - AddrOnly uint8 - IPAddress []byte `struc:"[4]byte"` - Protocol uint8 - Port uint16 - SwIfIndex uint32 - VrfID uint32 - Tag []byte `struc:"[64]byte"` -} - -func (*Nat44IdentityMappingDetails) GetMessageName() string { - return "nat44_identity_mapping_details" -} -func (*Nat44IdentityMappingDetails) GetCrcString() string { - return "1f1d00d6" -} -func (*Nat44IdentityMappingDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44IdentityMappingDump represents VPP binary API message 'nat44_identity_mapping_dump': -type Nat44IdentityMappingDump struct{} - -func (*Nat44IdentityMappingDump) GetMessageName() string { - return "nat44_identity_mapping_dump" -} -func (*Nat44IdentityMappingDump) GetCrcString() string { - return "51077d14" -} -func (*Nat44IdentityMappingDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44InterfaceAddDelFeature represents VPP binary API message 'nat44_interface_add_del_feature': -type Nat44InterfaceAddDelFeature struct { - IsAdd uint8 - IsInside uint8 - SwIfIndex uint32 -} - -func (*Nat44InterfaceAddDelFeature) GetMessageName() string { - return "nat44_interface_add_del_feature" -} -func (*Nat44InterfaceAddDelFeature) GetCrcString() string { - return "9b1ac600" -} -func (*Nat44InterfaceAddDelFeature) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44InterfaceAddDelFeatureReply represents VPP binary API message 'nat44_interface_add_del_feature_reply': -type Nat44InterfaceAddDelFeatureReply struct { - Retval int32 -} - -func (*Nat44InterfaceAddDelFeatureReply) GetMessageName() string { - return "nat44_interface_add_del_feature_reply" -} -func (*Nat44InterfaceAddDelFeatureReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat44InterfaceAddDelFeatureReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44InterfaceAddDelOutputFeature represents VPP binary API message 'nat44_interface_add_del_output_feature': -type Nat44InterfaceAddDelOutputFeature struct { - IsAdd uint8 - IsInside uint8 - SwIfIndex uint32 -} - -func (*Nat44InterfaceAddDelOutputFeature) GetMessageName() string { - return "nat44_interface_add_del_output_feature" -} -func (*Nat44InterfaceAddDelOutputFeature) GetCrcString() string { - return "9b1ac600" -} -func (*Nat44InterfaceAddDelOutputFeature) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44InterfaceAddDelOutputFeatureReply represents VPP binary API message 'nat44_interface_add_del_output_feature_reply': -type Nat44InterfaceAddDelOutputFeatureReply struct { - Retval int32 -} - -func (*Nat44InterfaceAddDelOutputFeatureReply) GetMessageName() string { - return "nat44_interface_add_del_output_feature_reply" -} -func (*Nat44InterfaceAddDelOutputFeatureReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat44InterfaceAddDelOutputFeatureReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44InterfaceAddrDetails represents VPP binary API message 'nat44_interface_addr_details': -type Nat44InterfaceAddrDetails struct { - SwIfIndex uint32 - TwiceNat uint8 -} - -func (*Nat44InterfaceAddrDetails) GetMessageName() string { - return "nat44_interface_addr_details" -} -func (*Nat44InterfaceAddrDetails) GetCrcString() string { - return "4cdc575d" -} -func (*Nat44InterfaceAddrDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44InterfaceAddrDump represents VPP binary API message 'nat44_interface_addr_dump': -type Nat44InterfaceAddrDump struct{} - -func (*Nat44InterfaceAddrDump) GetMessageName() string { - return "nat44_interface_addr_dump" -} -func (*Nat44InterfaceAddrDump) GetCrcString() string { - return "51077d14" -} -func (*Nat44InterfaceAddrDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44InterfaceDetails represents VPP binary API message 'nat44_interface_details': -type Nat44InterfaceDetails struct { - IsInside uint8 - SwIfIndex uint32 -} - -func (*Nat44InterfaceDetails) GetMessageName() string { - return "nat44_interface_details" -} -func (*Nat44InterfaceDetails) GetCrcString() string { - return "2b15e8e4" -} -func (*Nat44InterfaceDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44InterfaceDump represents VPP binary API message 'nat44_interface_dump': -type Nat44InterfaceDump struct{} - -func (*Nat44InterfaceDump) GetMessageName() string { - return "nat44_interface_dump" -} -func (*Nat44InterfaceDump) GetCrcString() string { - return "51077d14" -} -func (*Nat44InterfaceDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44InterfaceOutputFeatureDetails represents VPP binary API message 'nat44_interface_output_feature_details': -type Nat44InterfaceOutputFeatureDetails struct { - IsInside uint8 - SwIfIndex uint32 -} - -func (*Nat44InterfaceOutputFeatureDetails) GetMessageName() string { - return "nat44_interface_output_feature_details" -} -func (*Nat44InterfaceOutputFeatureDetails) GetCrcString() string { - return "2b15e8e4" -} -func (*Nat44InterfaceOutputFeatureDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44InterfaceOutputFeatureDump represents VPP binary API message 'nat44_interface_output_feature_dump': -type Nat44InterfaceOutputFeatureDump struct{} - -func (*Nat44InterfaceOutputFeatureDump) GetMessageName() string { - return "nat44_interface_output_feature_dump" -} -func (*Nat44InterfaceOutputFeatureDump) GetCrcString() string { - return "51077d14" -} -func (*Nat44InterfaceOutputFeatureDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44LbStaticMappingDetails represents VPP binary API message 'nat44_lb_static_mapping_details': -type Nat44LbStaticMappingDetails struct { - ExternalAddr []byte `struc:"[4]byte"` - ExternalPort uint16 - Protocol uint8 - TwiceNat uint8 - SelfTwiceNat uint8 - Out2inOnly uint8 - Tag []byte `struc:"[64]byte"` - Affinity uint32 - LocalNum uint8 `struc:"sizeof=Locals"` - Locals []Nat44LbAddrPort -} - -func (*Nat44LbStaticMappingDetails) GetMessageName() string { - return "nat44_lb_static_mapping_details" -} -func (*Nat44LbStaticMappingDetails) GetCrcString() string { - return "e5aba6bb" -} -func (*Nat44LbStaticMappingDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44LbStaticMappingDump represents VPP binary API message 'nat44_lb_static_mapping_dump': -type Nat44LbStaticMappingDump struct{} - -func (*Nat44LbStaticMappingDump) GetMessageName() string { - return "nat44_lb_static_mapping_dump" -} -func (*Nat44LbStaticMappingDump) GetCrcString() string { - return "51077d14" -} -func (*Nat44LbStaticMappingDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44StaticMappingDetails represents VPP binary API message 'nat44_static_mapping_details': -type Nat44StaticMappingDetails struct { - AddrOnly uint8 - LocalIPAddress []byte `struc:"[4]byte"` - ExternalIPAddress []byte `struc:"[4]byte"` - Protocol uint8 - LocalPort uint16 - ExternalPort uint16 - ExternalSwIfIndex uint32 - VrfID uint32 - TwiceNat uint8 - SelfTwiceNat uint8 - Out2inOnly uint8 - Tag []byte `struc:"[64]byte"` -} - -func (*Nat44StaticMappingDetails) GetMessageName() string { - return "nat44_static_mapping_details" -} -func (*Nat44StaticMappingDetails) GetCrcString() string { - return "cf257b56" -} -func (*Nat44StaticMappingDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44StaticMappingDump represents VPP binary API message 'nat44_static_mapping_dump': -type Nat44StaticMappingDump struct{} - -func (*Nat44StaticMappingDump) GetMessageName() string { - return "nat44_static_mapping_dump" -} -func (*Nat44StaticMappingDump) GetCrcString() string { - return "51077d14" -} -func (*Nat44StaticMappingDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44UserDetails represents VPP binary API message 'nat44_user_details': -type Nat44UserDetails struct { - VrfID uint32 - IPAddress []byte `struc:"[4]byte"` - Nsessions uint32 - Nstaticsessions uint32 -} - -func (*Nat44UserDetails) GetMessageName() string { - return "nat44_user_details" -} -func (*Nat44UserDetails) GetCrcString() string { - return "abb91460" -} -func (*Nat44UserDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44UserDump represents VPP binary API message 'nat44_user_dump': -type Nat44UserDump struct{} - -func (*Nat44UserDump) GetMessageName() string { - return "nat44_user_dump" -} -func (*Nat44UserDump) GetCrcString() string { - return "51077d14" -} -func (*Nat44UserDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat44UserSessionDetails represents VPP binary API message 'nat44_user_session_details': -type Nat44UserSessionDetails struct { - OutsideIPAddress []byte `struc:"[4]byte"` - OutsidePort uint16 - InsideIPAddress []byte `struc:"[4]byte"` - InsidePort uint16 - Protocol uint16 - IsStatic uint8 - LastHeard uint64 - TotalBytes uint64 - TotalPkts uint32 - IsTwicenat uint8 - ExtHostValid uint8 - ExtHostAddress []byte `struc:"[4]byte"` - ExtHostPort uint16 - ExtHostNatAddress []byte `struc:"[4]byte"` - ExtHostNatPort uint16 -} - -func (*Nat44UserSessionDetails) GetMessageName() string { - return "nat44_user_session_details" -} -func (*Nat44UserSessionDetails) GetCrcString() string { - return "2250ec64" -} -func (*Nat44UserSessionDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat44UserSessionDump represents VPP binary API message 'nat44_user_session_dump': -type Nat44UserSessionDump struct { - IPAddress []byte `struc:"[4]byte"` - VrfID uint32 -} - -func (*Nat44UserSessionDump) GetMessageName() string { - return "nat44_user_session_dump" -} -func (*Nat44UserSessionDump) GetCrcString() string { - return "bca4d2c2" -} -func (*Nat44UserSessionDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat64AddDelInterface represents VPP binary API message 'nat64_add_del_interface': -type Nat64AddDelInterface struct { - SwIfIndex uint32 - IsInside uint8 - IsAdd uint8 -} - -func (*Nat64AddDelInterface) GetMessageName() string { - return "nat64_add_del_interface" -} -func (*Nat64AddDelInterface) GetCrcString() string { - return "efbda9ce" -} -func (*Nat64AddDelInterface) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat64AddDelInterfaceAddr represents VPP binary API message 'nat64_add_del_interface_addr': -type Nat64AddDelInterfaceAddr struct { - IsAdd uint8 - IsInside uint8 - SwIfIndex uint32 -} - -func (*Nat64AddDelInterfaceAddr) GetMessageName() string { - return "nat64_add_del_interface_addr" -} -func (*Nat64AddDelInterfaceAddr) GetCrcString() string { - return "9b1ac600" -} -func (*Nat64AddDelInterfaceAddr) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat64AddDelInterfaceAddrReply represents VPP binary API message 'nat64_add_del_interface_addr_reply': -type Nat64AddDelInterfaceAddrReply struct { - Retval int32 -} - -func (*Nat64AddDelInterfaceAddrReply) GetMessageName() string { - return "nat64_add_del_interface_addr_reply" -} -func (*Nat64AddDelInterfaceAddrReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat64AddDelInterfaceAddrReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat64AddDelInterfaceReply represents VPP binary API message 'nat64_add_del_interface_reply': -type Nat64AddDelInterfaceReply struct { - Retval int32 -} - -func (*Nat64AddDelInterfaceReply) GetMessageName() string { - return "nat64_add_del_interface_reply" -} -func (*Nat64AddDelInterfaceReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat64AddDelInterfaceReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat64AddDelPoolAddrRange represents VPP binary API message 'nat64_add_del_pool_addr_range': -type Nat64AddDelPoolAddrRange struct { - StartAddr []byte `struc:"[4]byte"` - EndAddr []byte `struc:"[4]byte"` - VrfID uint32 - IsAdd uint8 -} - -func (*Nat64AddDelPoolAddrRange) GetMessageName() string { - return "nat64_add_del_pool_addr_range" -} -func (*Nat64AddDelPoolAddrRange) GetCrcString() string { - return "5eb50214" -} -func (*Nat64AddDelPoolAddrRange) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat64AddDelPoolAddrRangeReply represents VPP binary API message 'nat64_add_del_pool_addr_range_reply': -type Nat64AddDelPoolAddrRangeReply struct { - Retval int32 -} - -func (*Nat64AddDelPoolAddrRangeReply) GetMessageName() string { - return "nat64_add_del_pool_addr_range_reply" -} -func (*Nat64AddDelPoolAddrRangeReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat64AddDelPoolAddrRangeReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat64AddDelPrefix represents VPP binary API message 'nat64_add_del_prefix': -type Nat64AddDelPrefix struct { - Prefix []byte `struc:"[16]byte"` - PrefixLen uint8 - VrfID uint32 - IsAdd uint8 -} - -func (*Nat64AddDelPrefix) GetMessageName() string { - return "nat64_add_del_prefix" -} -func (*Nat64AddDelPrefix) GetCrcString() string { - return "f4ae7173" -} -func (*Nat64AddDelPrefix) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat64AddDelPrefixReply represents VPP binary API message 'nat64_add_del_prefix_reply': -type Nat64AddDelPrefixReply struct { - Retval int32 -} - -func (*Nat64AddDelPrefixReply) GetMessageName() string { - return "nat64_add_del_prefix_reply" -} -func (*Nat64AddDelPrefixReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat64AddDelPrefixReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat64AddDelStaticBib represents VPP binary API message 'nat64_add_del_static_bib': -type Nat64AddDelStaticBib struct { - IAddr []byte `struc:"[16]byte"` - OAddr []byte `struc:"[4]byte"` - IPort uint16 - OPort uint16 - VrfID uint32 - Proto uint8 - IsAdd uint8 -} - -func (*Nat64AddDelStaticBib) GetMessageName() string { - return "nat64_add_del_static_bib" -} -func (*Nat64AddDelStaticBib) GetCrcString() string { - return "e36c7813" -} -func (*Nat64AddDelStaticBib) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat64AddDelStaticBibReply represents VPP binary API message 'nat64_add_del_static_bib_reply': -type Nat64AddDelStaticBibReply struct { - Retval int32 -} - -func (*Nat64AddDelStaticBibReply) GetMessageName() string { - return "nat64_add_del_static_bib_reply" -} -func (*Nat64AddDelStaticBibReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat64AddDelStaticBibReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat64BibDetails represents VPP binary API message 'nat64_bib_details': -type Nat64BibDetails struct { - IAddr []byte `struc:"[16]byte"` - OAddr []byte `struc:"[4]byte"` - IPort uint16 - OPort uint16 - VrfID uint32 - Proto uint8 - IsStatic uint8 - SesNum uint32 -} - -func (*Nat64BibDetails) GetMessageName() string { - return "nat64_bib_details" -} -func (*Nat64BibDetails) GetCrcString() string { - return "372e7a98" -} -func (*Nat64BibDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat64BibDump represents VPP binary API message 'nat64_bib_dump': -type Nat64BibDump struct { - Proto uint8 -} - -func (*Nat64BibDump) GetMessageName() string { - return "nat64_bib_dump" -} -func (*Nat64BibDump) GetCrcString() string { - return "cfcb6b75" -} -func (*Nat64BibDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat64InterfaceDetails represents VPP binary API message 'nat64_interface_details': -type Nat64InterfaceDetails struct { - IsInside uint8 - SwIfIndex uint32 -} - -func (*Nat64InterfaceDetails) GetMessageName() string { - return "nat64_interface_details" -} -func (*Nat64InterfaceDetails) GetCrcString() string { - return "2b15e8e4" -} -func (*Nat64InterfaceDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat64InterfaceDump represents VPP binary API message 'nat64_interface_dump': -type Nat64InterfaceDump struct{} - -func (*Nat64InterfaceDump) GetMessageName() string { - return "nat64_interface_dump" -} -func (*Nat64InterfaceDump) GetCrcString() string { - return "51077d14" -} -func (*Nat64InterfaceDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat64PoolAddrDetails represents VPP binary API message 'nat64_pool_addr_details': -type Nat64PoolAddrDetails struct { - Address []byte `struc:"[4]byte"` - VrfID uint32 -} - -func (*Nat64PoolAddrDetails) GetMessageName() string { - return "nat64_pool_addr_details" -} -func (*Nat64PoolAddrDetails) GetCrcString() string { - return "8d10231c" -} -func (*Nat64PoolAddrDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat64PoolAddrDump represents VPP binary API message 'nat64_pool_addr_dump': -type Nat64PoolAddrDump struct{} - -func (*Nat64PoolAddrDump) GetMessageName() string { - return "nat64_pool_addr_dump" -} -func (*Nat64PoolAddrDump) GetCrcString() string { - return "51077d14" -} -func (*Nat64PoolAddrDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat64PrefixDetails represents VPP binary API message 'nat64_prefix_details': -type Nat64PrefixDetails struct { - Prefix []byte `struc:"[16]byte"` - PrefixLen uint8 - VrfID uint32 -} - -func (*Nat64PrefixDetails) GetMessageName() string { - return "nat64_prefix_details" -} -func (*Nat64PrefixDetails) GetCrcString() string { - return "fb08875c" -} -func (*Nat64PrefixDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat64PrefixDump represents VPP binary API message 'nat64_prefix_dump': -type Nat64PrefixDump struct{} - -func (*Nat64PrefixDump) GetMessageName() string { - return "nat64_prefix_dump" -} -func (*Nat64PrefixDump) GetCrcString() string { - return "51077d14" -} -func (*Nat64PrefixDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat64StDetails represents VPP binary API message 'nat64_st_details': -type Nat64StDetails struct { - IlAddr []byte `struc:"[16]byte"` - OlAddr []byte `struc:"[4]byte"` - IlPort uint16 - OlPort uint16 - IrAddr []byte `struc:"[16]byte"` - OrAddr []byte `struc:"[4]byte"` - RPort uint16 - VrfID uint32 - Proto uint8 -} - -func (*Nat64StDetails) GetMessageName() string { - return "nat64_st_details" -} -func (*Nat64StDetails) GetCrcString() string { - return "1aaf4631" -} -func (*Nat64StDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat64StDump represents VPP binary API message 'nat64_st_dump': -type Nat64StDump struct { - Proto uint8 -} - -func (*Nat64StDump) GetMessageName() string { - return "nat64_st_dump" -} -func (*Nat64StDump) GetCrcString() string { - return "cfcb6b75" -} -func (*Nat64StDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat66AddDelInterface represents VPP binary API message 'nat66_add_del_interface': -type Nat66AddDelInterface struct { - IsAdd uint8 - IsInside uint8 - SwIfIndex uint32 -} - -func (*Nat66AddDelInterface) GetMessageName() string { - return "nat66_add_del_interface" -} -func (*Nat66AddDelInterface) GetCrcString() string { - return "9b1ac600" -} -func (*Nat66AddDelInterface) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat66AddDelInterfaceReply represents VPP binary API message 'nat66_add_del_interface_reply': -type Nat66AddDelInterfaceReply struct { - Retval int32 -} - -func (*Nat66AddDelInterfaceReply) GetMessageName() string { - return "nat66_add_del_interface_reply" -} -func (*Nat66AddDelInterfaceReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat66AddDelInterfaceReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat66AddDelStaticMapping represents VPP binary API message 'nat66_add_del_static_mapping': -type Nat66AddDelStaticMapping struct { - IsAdd uint8 - LocalIPAddress []byte `struc:"[16]byte"` - ExternalIPAddress []byte `struc:"[16]byte"` - VrfID uint32 -} - -func (*Nat66AddDelStaticMapping) GetMessageName() string { - return "nat66_add_del_static_mapping" -} -func (*Nat66AddDelStaticMapping) GetCrcString() string { - return "67a1dbe1" -} -func (*Nat66AddDelStaticMapping) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat66AddDelStaticMappingReply represents VPP binary API message 'nat66_add_del_static_mapping_reply': -type Nat66AddDelStaticMappingReply struct { - Retval int32 -} - -func (*Nat66AddDelStaticMappingReply) GetMessageName() string { - return "nat66_add_del_static_mapping_reply" -} -func (*Nat66AddDelStaticMappingReply) GetCrcString() string { - return "e8d4e804" -} -func (*Nat66AddDelStaticMappingReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat66InterfaceDetails represents VPP binary API message 'nat66_interface_details': -type Nat66InterfaceDetails struct { - IsInside uint8 - SwIfIndex uint32 -} - -func (*Nat66InterfaceDetails) GetMessageName() string { - return "nat66_interface_details" -} -func (*Nat66InterfaceDetails) GetCrcString() string { - return "2b15e8e4" -} -func (*Nat66InterfaceDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat66InterfaceDump represents VPP binary API message 'nat66_interface_dump': -type Nat66InterfaceDump struct{} - -func (*Nat66InterfaceDump) GetMessageName() string { - return "nat66_interface_dump" -} -func (*Nat66InterfaceDump) GetCrcString() string { - return "51077d14" -} -func (*Nat66InterfaceDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Nat66StaticMappingDetails represents VPP binary API message 'nat66_static_mapping_details': -type Nat66StaticMappingDetails struct { - LocalIPAddress []byte `struc:"[16]byte"` - ExternalIPAddress []byte `struc:"[16]byte"` - VrfID uint32 - TotalBytes uint64 - TotalPkts uint64 -} - -func (*Nat66StaticMappingDetails) GetMessageName() string { - return "nat66_static_mapping_details" -} -func (*Nat66StaticMappingDetails) GetCrcString() string { - return "f61e499a" -} -func (*Nat66StaticMappingDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Nat66StaticMappingDump represents VPP binary API message 'nat66_static_mapping_dump': -type Nat66StaticMappingDump struct{} - -func (*Nat66StaticMappingDump) GetMessageName() string { - return "nat66_static_mapping_dump" -} -func (*Nat66StaticMappingDump) GetCrcString() string { - return "51077d14" -} -func (*Nat66StaticMappingDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatControlPing represents VPP binary API message 'nat_control_ping': -type NatControlPing struct{} - -func (*NatControlPing) GetMessageName() string { - return "nat_control_ping" -} -func (*NatControlPing) GetCrcString() string { - return "51077d14" -} -func (*NatControlPing) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatControlPingReply represents VPP binary API message 'nat_control_ping_reply': -type NatControlPingReply struct { - Retval int32 - ClientIndex uint32 - VpePID uint32 -} - -func (*NatControlPingReply) GetMessageName() string { - return "nat_control_ping_reply" -} -func (*NatControlPingReply) GetCrcString() string { - return "f6b0b8ca" -} -func (*NatControlPingReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatDetAddDelMap represents VPP binary API message 'nat_det_add_del_map': -type NatDetAddDelMap struct { - IsAdd uint8 - IsNat44 uint8 - AddrOnly uint8 - InAddr []byte `struc:"[16]byte"` - InPlen uint8 - OutAddr []byte `struc:"[4]byte"` - OutPlen uint8 -} - -func (*NatDetAddDelMap) GetMessageName() string { - return "nat_det_add_del_map" -} -func (*NatDetAddDelMap) GetCrcString() string { - return "5bd37d5b" -} -func (*NatDetAddDelMap) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatDetAddDelMapReply represents VPP binary API message 'nat_det_add_del_map_reply': -type NatDetAddDelMapReply struct { - Retval int32 -} - -func (*NatDetAddDelMapReply) GetMessageName() string { - return "nat_det_add_del_map_reply" -} -func (*NatDetAddDelMapReply) GetCrcString() string { - return "e8d4e804" -} -func (*NatDetAddDelMapReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatDetCloseSessionIn represents VPP binary API message 'nat_det_close_session_in': -type NatDetCloseSessionIn struct { - IsNat44 uint8 - InAddr []byte `struc:"[16]byte"` - InPort uint16 - ExtAddr []byte `struc:"[16]byte"` - ExtPort uint16 -} - -func (*NatDetCloseSessionIn) GetMessageName() string { - return "nat_det_close_session_in" -} -func (*NatDetCloseSessionIn) GetCrcString() string { - return "147e430c" -} -func (*NatDetCloseSessionIn) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatDetCloseSessionInReply represents VPP binary API message 'nat_det_close_session_in_reply': -type NatDetCloseSessionInReply struct { - Retval int32 -} - -func (*NatDetCloseSessionInReply) GetMessageName() string { - return "nat_det_close_session_in_reply" -} -func (*NatDetCloseSessionInReply) GetCrcString() string { - return "e8d4e804" -} -func (*NatDetCloseSessionInReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatDetCloseSessionOut represents VPP binary API message 'nat_det_close_session_out': -type NatDetCloseSessionOut struct { - OutAddr []byte `struc:"[4]byte"` - OutPort uint16 - ExtAddr []byte `struc:"[4]byte"` - ExtPort uint16 -} - -func (*NatDetCloseSessionOut) GetMessageName() string { - return "nat_det_close_session_out" -} -func (*NatDetCloseSessionOut) GetCrcString() string { - return "2e165938" -} -func (*NatDetCloseSessionOut) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatDetCloseSessionOutReply represents VPP binary API message 'nat_det_close_session_out_reply': -type NatDetCloseSessionOutReply struct { - Retval int32 -} - -func (*NatDetCloseSessionOutReply) GetMessageName() string { - return "nat_det_close_session_out_reply" -} -func (*NatDetCloseSessionOutReply) GetCrcString() string { - return "e8d4e804" -} -func (*NatDetCloseSessionOutReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatDetForward represents VPP binary API message 'nat_det_forward': -type NatDetForward struct { - IsNat44 uint8 - InAddr []byte `struc:"[16]byte"` -} - -func (*NatDetForward) GetMessageName() string { - return "nat_det_forward" -} -func (*NatDetForward) GetCrcString() string { - return "037d399b" -} -func (*NatDetForward) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatDetForwardReply represents VPP binary API message 'nat_det_forward_reply': -type NatDetForwardReply struct { - Retval int32 - OutPortLo uint16 - OutPortHi uint16 - OutAddr []byte `struc:"[4]byte"` -} - -func (*NatDetForwardReply) GetMessageName() string { - return "nat_det_forward_reply" -} -func (*NatDetForwardReply) GetCrcString() string { - return "bf9b96ea" -} -func (*NatDetForwardReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatDetMapDetails represents VPP binary API message 'nat_det_map_details': -type NatDetMapDetails struct { - IsNat44 uint8 - InAddr []byte `struc:"[16]byte"` - InPlen uint8 - OutAddr []byte `struc:"[4]byte"` - OutPlen uint8 - SharingRatio uint32 - PortsPerHost uint16 - SesNum uint32 -} - -func (*NatDetMapDetails) GetMessageName() string { - return "nat_det_map_details" -} -func (*NatDetMapDetails) GetCrcString() string { - return "886138a8" -} -func (*NatDetMapDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatDetMapDump represents VPP binary API message 'nat_det_map_dump': -type NatDetMapDump struct{} - -func (*NatDetMapDump) GetMessageName() string { - return "nat_det_map_dump" -} -func (*NatDetMapDump) GetCrcString() string { - return "51077d14" -} -func (*NatDetMapDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatDetReverse represents VPP binary API message 'nat_det_reverse': -type NatDetReverse struct { - OutPort uint16 - OutAddr []byte `struc:"[4]byte"` -} - -func (*NatDetReverse) GetMessageName() string { - return "nat_det_reverse" -} -func (*NatDetReverse) GetCrcString() string { - return "80ab12d2" -} -func (*NatDetReverse) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatDetReverseReply represents VPP binary API message 'nat_det_reverse_reply': -type NatDetReverseReply struct { - Retval int32 - IsNat44 uint8 - InAddr []byte `struc:"[16]byte"` -} - -func (*NatDetReverseReply) GetMessageName() string { - return "nat_det_reverse_reply" -} -func (*NatDetReverseReply) GetCrcString() string { - return "26139a2f" -} -func (*NatDetReverseReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatDetSessionDetails represents VPP binary API message 'nat_det_session_details': -type NatDetSessionDetails struct { - InPort uint16 - ExtAddr []byte `struc:"[4]byte"` - ExtPort uint16 - OutPort uint16 - State uint8 - Expire uint32 -} - -func (*NatDetSessionDetails) GetMessageName() string { - return "nat_det_session_details" -} -func (*NatDetSessionDetails) GetCrcString() string { - return "f620a631" -} -func (*NatDetSessionDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatDetSessionDump represents VPP binary API message 'nat_det_session_dump': -type NatDetSessionDump struct { - IsNat44 uint8 - UserAddr []byte `struc:"[16]byte"` -} - -func (*NatDetSessionDump) GetMessageName() string { - return "nat_det_session_dump" -} -func (*NatDetSessionDump) GetCrcString() string { - return "ddfb6b28" -} -func (*NatDetSessionDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatGetAddrAndPortAllocAlg represents VPP binary API message 'nat_get_addr_and_port_alloc_alg': -type NatGetAddrAndPortAllocAlg struct{} - -func (*NatGetAddrAndPortAllocAlg) GetMessageName() string { - return "nat_get_addr_and_port_alloc_alg" -} -func (*NatGetAddrAndPortAllocAlg) GetCrcString() string { - return "51077d14" -} -func (*NatGetAddrAndPortAllocAlg) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatGetAddrAndPortAllocAlgReply represents VPP binary API message 'nat_get_addr_and_port_alloc_alg_reply': -type NatGetAddrAndPortAllocAlgReply struct { - Retval int32 - Alg uint8 - PsidOffset uint8 - PsidLength uint8 - Psid uint16 - StartPort uint16 - EndPort uint16 -} - -func (*NatGetAddrAndPortAllocAlgReply) GetMessageName() string { - return "nat_get_addr_and_port_alloc_alg_reply" -} -func (*NatGetAddrAndPortAllocAlgReply) GetCrcString() string { - return "3607a7d0" -} -func (*NatGetAddrAndPortAllocAlgReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatGetMssClamping represents VPP binary API message 'nat_get_mss_clamping': -type NatGetMssClamping struct{} - -func (*NatGetMssClamping) GetMessageName() string { - return "nat_get_mss_clamping" -} -func (*NatGetMssClamping) GetCrcString() string { - return "51077d14" -} -func (*NatGetMssClamping) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatGetMssClampingReply represents VPP binary API message 'nat_get_mss_clamping_reply': -type NatGetMssClampingReply struct { - Retval int32 - MssValue uint16 - Enable uint8 -} - -func (*NatGetMssClampingReply) GetMessageName() string { - return "nat_get_mss_clamping_reply" -} -func (*NatGetMssClampingReply) GetCrcString() string { - return "f7bd89f5" -} -func (*NatGetMssClampingReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatGetReass represents VPP binary API message 'nat_get_reass': -type NatGetReass struct{} - -func (*NatGetReass) GetMessageName() string { - return "nat_get_reass" -} -func (*NatGetReass) GetCrcString() string { - return "51077d14" -} -func (*NatGetReass) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatGetReassReply represents VPP binary API message 'nat_get_reass_reply': -type NatGetReassReply struct { - Retval int32 - IP4Timeout uint32 - IP4MaxReass uint16 - IP4MaxFrag uint8 - IP4DropFrag uint8 - IP6Timeout uint32 - IP6MaxReass uint16 - IP6MaxFrag uint8 - IP6DropFrag uint8 -} - -func (*NatGetReassReply) GetMessageName() string { - return "nat_get_reass_reply" -} -func (*NatGetReassReply) GetCrcString() string { - return "8102a0fb" -} -func (*NatGetReassReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatGetTimeouts represents VPP binary API message 'nat_get_timeouts': -type NatGetTimeouts struct{} - -func (*NatGetTimeouts) GetMessageName() string { - return "nat_get_timeouts" -} -func (*NatGetTimeouts) GetCrcString() string { - return "51077d14" -} -func (*NatGetTimeouts) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatGetTimeoutsReply represents VPP binary API message 'nat_get_timeouts_reply': -type NatGetTimeoutsReply struct { - Retval int32 - UDP uint32 - TCPEstablished uint32 - TCPTransitory uint32 - ICMP uint32 -} - -func (*NatGetTimeoutsReply) GetMessageName() string { - return "nat_get_timeouts_reply" -} -func (*NatGetTimeoutsReply) GetCrcString() string { - return "3c4df4e1" -} -func (*NatGetTimeoutsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatIpfixEnableDisable represents VPP binary API message 'nat_ipfix_enable_disable': -type NatIpfixEnableDisable struct { - DomainID uint32 - SrcPort uint16 - Enable uint8 -} - -func (*NatIpfixEnableDisable) GetMessageName() string { - return "nat_ipfix_enable_disable" -} -func (*NatIpfixEnableDisable) GetCrcString() string { - return "745dd24b" -} -func (*NatIpfixEnableDisable) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatIpfixEnableDisableReply represents VPP binary API message 'nat_ipfix_enable_disable_reply': -type NatIpfixEnableDisableReply struct { - Retval int32 -} - -func (*NatIpfixEnableDisableReply) GetMessageName() string { - return "nat_ipfix_enable_disable_reply" -} -func (*NatIpfixEnableDisableReply) GetCrcString() string { - return "e8d4e804" -} -func (*NatIpfixEnableDisableReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatReassDetails represents VPP binary API message 'nat_reass_details': -type NatReassDetails struct { - IsIP4 uint8 - SrcAddr []byte `struc:"[16]byte"` - DstAddr []byte `struc:"[16]byte"` - FragID uint32 - Proto uint8 - FragN uint8 -} - -func (*NatReassDetails) GetMessageName() string { - return "nat_reass_details" -} -func (*NatReassDetails) GetCrcString() string { - return "ee46e2d4" -} -func (*NatReassDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatReassDump represents VPP binary API message 'nat_reass_dump': -type NatReassDump struct{} - -func (*NatReassDump) GetMessageName() string { - return "nat_reass_dump" -} -func (*NatReassDump) GetCrcString() string { - return "51077d14" -} -func (*NatReassDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatSetAddrAndPortAllocAlg represents VPP binary API message 'nat_set_addr_and_port_alloc_alg': -type NatSetAddrAndPortAllocAlg struct { - Alg uint8 - PsidOffset uint8 - PsidLength uint8 - Psid uint16 - StartPort uint16 - EndPort uint16 -} - -func (*NatSetAddrAndPortAllocAlg) GetMessageName() string { - return "nat_set_addr_and_port_alloc_alg" -} -func (*NatSetAddrAndPortAllocAlg) GetCrcString() string { - return "deeb746f" -} -func (*NatSetAddrAndPortAllocAlg) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatSetAddrAndPortAllocAlgReply represents VPP binary API message 'nat_set_addr_and_port_alloc_alg_reply': -type NatSetAddrAndPortAllocAlgReply struct { - Retval int32 -} - -func (*NatSetAddrAndPortAllocAlgReply) GetMessageName() string { - return "nat_set_addr_and_port_alloc_alg_reply" -} -func (*NatSetAddrAndPortAllocAlgReply) GetCrcString() string { - return "e8d4e804" -} -func (*NatSetAddrAndPortAllocAlgReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatSetMssClamping represents VPP binary API message 'nat_set_mss_clamping': -type NatSetMssClamping struct { - MssValue uint16 - Enable uint8 -} - -func (*NatSetMssClamping) GetMessageName() string { - return "nat_set_mss_clamping" -} -func (*NatSetMssClamping) GetCrcString() string { - return "6a2472be" -} -func (*NatSetMssClamping) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatSetMssClampingReply represents VPP binary API message 'nat_set_mss_clamping_reply': -type NatSetMssClampingReply struct { - Retval int32 -} - -func (*NatSetMssClampingReply) GetMessageName() string { - return "nat_set_mss_clamping_reply" -} -func (*NatSetMssClampingReply) GetCrcString() string { - return "e8d4e804" -} -func (*NatSetMssClampingReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatSetReass represents VPP binary API message 'nat_set_reass': -type NatSetReass struct { - Timeout uint32 - MaxReass uint16 - MaxFrag uint8 - DropFrag uint8 - IsIP6 uint8 -} - -func (*NatSetReass) GetMessageName() string { - return "nat_set_reass" -} -func (*NatSetReass) GetCrcString() string { - return "cb126174" -} -func (*NatSetReass) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatSetReassReply represents VPP binary API message 'nat_set_reass_reply': -type NatSetReassReply struct { - Retval int32 -} - -func (*NatSetReassReply) GetMessageName() string { - return "nat_set_reass_reply" -} -func (*NatSetReassReply) GetCrcString() string { - return "e8d4e804" -} -func (*NatSetReassReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatSetTimeouts represents VPP binary API message 'nat_set_timeouts': -type NatSetTimeouts struct { - UDP uint32 - TCPEstablished uint32 - TCPTransitory uint32 - ICMP uint32 -} - -func (*NatSetTimeouts) GetMessageName() string { - return "nat_set_timeouts" -} -func (*NatSetTimeouts) GetCrcString() string { - return "d4746b16" -} -func (*NatSetTimeouts) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatSetTimeoutsReply represents VPP binary API message 'nat_set_timeouts_reply': -type NatSetTimeoutsReply struct { - Retval int32 -} - -func (*NatSetTimeoutsReply) GetMessageName() string { - return "nat_set_timeouts_reply" -} -func (*NatSetTimeoutsReply) GetCrcString() string { - return "e8d4e804" -} -func (*NatSetTimeoutsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatSetWorkers represents VPP binary API message 'nat_set_workers': -type NatSetWorkers struct { - WorkerMask uint64 -} - -func (*NatSetWorkers) GetMessageName() string { - return "nat_set_workers" -} -func (*NatSetWorkers) GetCrcString() string { - return "da926638" -} -func (*NatSetWorkers) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatSetWorkersReply represents VPP binary API message 'nat_set_workers_reply': -type NatSetWorkersReply struct { - Retval int32 -} - -func (*NatSetWorkersReply) GetMessageName() string { - return "nat_set_workers_reply" -} -func (*NatSetWorkersReply) GetCrcString() string { - return "e8d4e804" -} -func (*NatSetWorkersReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatShowConfig represents VPP binary API message 'nat_show_config': -type NatShowConfig struct{} - -func (*NatShowConfig) GetMessageName() string { - return "nat_show_config" -} -func (*NatShowConfig) GetCrcString() string { - return "51077d14" -} -func (*NatShowConfig) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// NatShowConfigReply represents VPP binary API message 'nat_show_config_reply': -type NatShowConfigReply struct { - Retval int32 - StaticMappingOnly uint8 - StaticMappingConnectionTracking uint8 - Deterministic uint8 - EndpointDependent uint8 - Out2inDpo uint8 - TranslationBuckets uint32 - TranslationMemorySize uint32 - UserBuckets uint32 - UserMemorySize uint32 - MaxTranslationsPerUser uint32 - OutsideVrfID uint32 - InsideVrfID uint32 - DsliteCe uint8 - Nat64BibBuckets uint32 - Nat64BibMemorySize uint32 - Nat64StBuckets uint32 - Nat64StMemorySize uint32 -} - -func (*NatShowConfigReply) GetMessageName() string { - return "nat_show_config_reply" -} -func (*NatShowConfigReply) GetCrcString() string { - return "ef8a2bbe" -} -func (*NatShowConfigReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatWorkerDetails represents VPP binary API message 'nat_worker_details': -type NatWorkerDetails struct { - WorkerIndex uint32 - LcoreID uint32 - Name []byte `struc:"[64]byte"` -} - -func (*NatWorkerDetails) GetMessageName() string { - return "nat_worker_details" -} -func (*NatWorkerDetails) GetCrcString() string { - return "2e3f9d4b" -} -func (*NatWorkerDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// NatWorkerDump represents VPP binary API message 'nat_worker_dump': -type NatWorkerDump struct{} - -func (*NatWorkerDump) GetMessageName() string { - return "nat_worker_dump" -} -func (*NatWorkerDump) GetCrcString() string { - return "51077d14" -} -func (*NatWorkerDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func init() { - api.RegisterMessage((*DsliteAddDelPoolAddrRange)(nil), "nat.DsliteAddDelPoolAddrRange") - api.RegisterMessage((*DsliteAddDelPoolAddrRangeReply)(nil), "nat.DsliteAddDelPoolAddrRangeReply") - api.RegisterMessage((*DsliteAddressDetails)(nil), "nat.DsliteAddressDetails") - api.RegisterMessage((*DsliteAddressDump)(nil), "nat.DsliteAddressDump") - api.RegisterMessage((*DsliteGetAftrAddr)(nil), "nat.DsliteGetAftrAddr") - api.RegisterMessage((*DsliteGetAftrAddrReply)(nil), "nat.DsliteGetAftrAddrReply") - api.RegisterMessage((*DsliteGetB4Addr)(nil), "nat.DsliteGetB4Addr") - api.RegisterMessage((*DsliteGetB4AddrReply)(nil), "nat.DsliteGetB4AddrReply") - api.RegisterMessage((*DsliteSetAftrAddr)(nil), "nat.DsliteSetAftrAddr") - api.RegisterMessage((*DsliteSetAftrAddrReply)(nil), "nat.DsliteSetAftrAddrReply") - api.RegisterMessage((*DsliteSetB4Addr)(nil), "nat.DsliteSetB4Addr") - api.RegisterMessage((*DsliteSetB4AddrReply)(nil), "nat.DsliteSetB4AddrReply") - api.RegisterMessage((*Nat44AddDelAddressRange)(nil), "nat.Nat44AddDelAddressRange") - api.RegisterMessage((*Nat44AddDelAddressRangeReply)(nil), "nat.Nat44AddDelAddressRangeReply") - api.RegisterMessage((*Nat44AddDelIdentityMapping)(nil), "nat.Nat44AddDelIdentityMapping") - api.RegisterMessage((*Nat44AddDelIdentityMappingReply)(nil), "nat.Nat44AddDelIdentityMappingReply") - api.RegisterMessage((*Nat44AddDelInterfaceAddr)(nil), "nat.Nat44AddDelInterfaceAddr") - api.RegisterMessage((*Nat44AddDelInterfaceAddrReply)(nil), "nat.Nat44AddDelInterfaceAddrReply") - api.RegisterMessage((*Nat44AddDelLbStaticMapping)(nil), "nat.Nat44AddDelLbStaticMapping") - api.RegisterMessage((*Nat44AddDelLbStaticMappingReply)(nil), "nat.Nat44AddDelLbStaticMappingReply") - api.RegisterMessage((*Nat44AddDelStaticMapping)(nil), "nat.Nat44AddDelStaticMapping") - api.RegisterMessage((*Nat44AddDelStaticMappingReply)(nil), "nat.Nat44AddDelStaticMappingReply") - api.RegisterMessage((*Nat44AddressDetails)(nil), "nat.Nat44AddressDetails") - api.RegisterMessage((*Nat44AddressDump)(nil), "nat.Nat44AddressDump") - api.RegisterMessage((*Nat44DelSession)(nil), "nat.Nat44DelSession") - api.RegisterMessage((*Nat44DelSessionReply)(nil), "nat.Nat44DelSessionReply") - api.RegisterMessage((*Nat44ForwardingEnableDisable)(nil), "nat.Nat44ForwardingEnableDisable") - api.RegisterMessage((*Nat44ForwardingEnableDisableReply)(nil), "nat.Nat44ForwardingEnableDisableReply") - api.RegisterMessage((*Nat44ForwardingIsEnabled)(nil), "nat.Nat44ForwardingIsEnabled") - api.RegisterMessage((*Nat44ForwardingIsEnabledReply)(nil), "nat.Nat44ForwardingIsEnabledReply") - api.RegisterMessage((*Nat44IdentityMappingDetails)(nil), "nat.Nat44IdentityMappingDetails") - api.RegisterMessage((*Nat44IdentityMappingDump)(nil), "nat.Nat44IdentityMappingDump") - api.RegisterMessage((*Nat44InterfaceAddDelFeature)(nil), "nat.Nat44InterfaceAddDelFeature") - api.RegisterMessage((*Nat44InterfaceAddDelFeatureReply)(nil), "nat.Nat44InterfaceAddDelFeatureReply") - api.RegisterMessage((*Nat44InterfaceAddDelOutputFeature)(nil), "nat.Nat44InterfaceAddDelOutputFeature") - api.RegisterMessage((*Nat44InterfaceAddDelOutputFeatureReply)(nil), "nat.Nat44InterfaceAddDelOutputFeatureReply") - api.RegisterMessage((*Nat44InterfaceAddrDetails)(nil), "nat.Nat44InterfaceAddrDetails") - api.RegisterMessage((*Nat44InterfaceAddrDump)(nil), "nat.Nat44InterfaceAddrDump") - api.RegisterMessage((*Nat44InterfaceDetails)(nil), "nat.Nat44InterfaceDetails") - api.RegisterMessage((*Nat44InterfaceDump)(nil), "nat.Nat44InterfaceDump") - api.RegisterMessage((*Nat44InterfaceOutputFeatureDetails)(nil), "nat.Nat44InterfaceOutputFeatureDetails") - api.RegisterMessage((*Nat44InterfaceOutputFeatureDump)(nil), "nat.Nat44InterfaceOutputFeatureDump") - api.RegisterMessage((*Nat44LbStaticMappingDetails)(nil), "nat.Nat44LbStaticMappingDetails") - api.RegisterMessage((*Nat44LbStaticMappingDump)(nil), "nat.Nat44LbStaticMappingDump") - api.RegisterMessage((*Nat44StaticMappingDetails)(nil), "nat.Nat44StaticMappingDetails") - api.RegisterMessage((*Nat44StaticMappingDump)(nil), "nat.Nat44StaticMappingDump") - api.RegisterMessage((*Nat44UserDetails)(nil), "nat.Nat44UserDetails") - api.RegisterMessage((*Nat44UserDump)(nil), "nat.Nat44UserDump") - api.RegisterMessage((*Nat44UserSessionDetails)(nil), "nat.Nat44UserSessionDetails") - api.RegisterMessage((*Nat44UserSessionDump)(nil), "nat.Nat44UserSessionDump") - api.RegisterMessage((*Nat64AddDelInterface)(nil), "nat.Nat64AddDelInterface") - api.RegisterMessage((*Nat64AddDelInterfaceAddr)(nil), "nat.Nat64AddDelInterfaceAddr") - api.RegisterMessage((*Nat64AddDelInterfaceAddrReply)(nil), "nat.Nat64AddDelInterfaceAddrReply") - api.RegisterMessage((*Nat64AddDelInterfaceReply)(nil), "nat.Nat64AddDelInterfaceReply") - api.RegisterMessage((*Nat64AddDelPoolAddrRange)(nil), "nat.Nat64AddDelPoolAddrRange") - api.RegisterMessage((*Nat64AddDelPoolAddrRangeReply)(nil), "nat.Nat64AddDelPoolAddrRangeReply") - api.RegisterMessage((*Nat64AddDelPrefix)(nil), "nat.Nat64AddDelPrefix") - api.RegisterMessage((*Nat64AddDelPrefixReply)(nil), "nat.Nat64AddDelPrefixReply") - api.RegisterMessage((*Nat64AddDelStaticBib)(nil), "nat.Nat64AddDelStaticBib") - api.RegisterMessage((*Nat64AddDelStaticBibReply)(nil), "nat.Nat64AddDelStaticBibReply") - api.RegisterMessage((*Nat64BibDetails)(nil), "nat.Nat64BibDetails") - api.RegisterMessage((*Nat64BibDump)(nil), "nat.Nat64BibDump") - api.RegisterMessage((*Nat64InterfaceDetails)(nil), "nat.Nat64InterfaceDetails") - api.RegisterMessage((*Nat64InterfaceDump)(nil), "nat.Nat64InterfaceDump") - api.RegisterMessage((*Nat64PoolAddrDetails)(nil), "nat.Nat64PoolAddrDetails") - api.RegisterMessage((*Nat64PoolAddrDump)(nil), "nat.Nat64PoolAddrDump") - api.RegisterMessage((*Nat64PrefixDetails)(nil), "nat.Nat64PrefixDetails") - api.RegisterMessage((*Nat64PrefixDump)(nil), "nat.Nat64PrefixDump") - api.RegisterMessage((*Nat64StDetails)(nil), "nat.Nat64StDetails") - api.RegisterMessage((*Nat64StDump)(nil), "nat.Nat64StDump") - api.RegisterMessage((*Nat66AddDelInterface)(nil), "nat.Nat66AddDelInterface") - api.RegisterMessage((*Nat66AddDelInterfaceReply)(nil), "nat.Nat66AddDelInterfaceReply") - api.RegisterMessage((*Nat66AddDelStaticMapping)(nil), "nat.Nat66AddDelStaticMapping") - api.RegisterMessage((*Nat66AddDelStaticMappingReply)(nil), "nat.Nat66AddDelStaticMappingReply") - api.RegisterMessage((*Nat66InterfaceDetails)(nil), "nat.Nat66InterfaceDetails") - api.RegisterMessage((*Nat66InterfaceDump)(nil), "nat.Nat66InterfaceDump") - api.RegisterMessage((*Nat66StaticMappingDetails)(nil), "nat.Nat66StaticMappingDetails") - api.RegisterMessage((*Nat66StaticMappingDump)(nil), "nat.Nat66StaticMappingDump") - api.RegisterMessage((*NatControlPing)(nil), "nat.NatControlPing") - api.RegisterMessage((*NatControlPingReply)(nil), "nat.NatControlPingReply") - api.RegisterMessage((*NatDetAddDelMap)(nil), "nat.NatDetAddDelMap") - api.RegisterMessage((*NatDetAddDelMapReply)(nil), "nat.NatDetAddDelMapReply") - api.RegisterMessage((*NatDetCloseSessionIn)(nil), "nat.NatDetCloseSessionIn") - api.RegisterMessage((*NatDetCloseSessionInReply)(nil), "nat.NatDetCloseSessionInReply") - api.RegisterMessage((*NatDetCloseSessionOut)(nil), "nat.NatDetCloseSessionOut") - api.RegisterMessage((*NatDetCloseSessionOutReply)(nil), "nat.NatDetCloseSessionOutReply") - api.RegisterMessage((*NatDetForward)(nil), "nat.NatDetForward") - api.RegisterMessage((*NatDetForwardReply)(nil), "nat.NatDetForwardReply") - api.RegisterMessage((*NatDetMapDetails)(nil), "nat.NatDetMapDetails") - api.RegisterMessage((*NatDetMapDump)(nil), "nat.NatDetMapDump") - api.RegisterMessage((*NatDetReverse)(nil), "nat.NatDetReverse") - api.RegisterMessage((*NatDetReverseReply)(nil), "nat.NatDetReverseReply") - api.RegisterMessage((*NatDetSessionDetails)(nil), "nat.NatDetSessionDetails") - api.RegisterMessage((*NatDetSessionDump)(nil), "nat.NatDetSessionDump") - api.RegisterMessage((*NatGetAddrAndPortAllocAlg)(nil), "nat.NatGetAddrAndPortAllocAlg") - api.RegisterMessage((*NatGetAddrAndPortAllocAlgReply)(nil), "nat.NatGetAddrAndPortAllocAlgReply") - api.RegisterMessage((*NatGetMssClamping)(nil), "nat.NatGetMssClamping") - api.RegisterMessage((*NatGetMssClampingReply)(nil), "nat.NatGetMssClampingReply") - api.RegisterMessage((*NatGetReass)(nil), "nat.NatGetReass") - api.RegisterMessage((*NatGetReassReply)(nil), "nat.NatGetReassReply") - api.RegisterMessage((*NatGetTimeouts)(nil), "nat.NatGetTimeouts") - api.RegisterMessage((*NatGetTimeoutsReply)(nil), "nat.NatGetTimeoutsReply") - api.RegisterMessage((*NatIpfixEnableDisable)(nil), "nat.NatIpfixEnableDisable") - api.RegisterMessage((*NatIpfixEnableDisableReply)(nil), "nat.NatIpfixEnableDisableReply") - api.RegisterMessage((*NatReassDetails)(nil), "nat.NatReassDetails") - api.RegisterMessage((*NatReassDump)(nil), "nat.NatReassDump") - api.RegisterMessage((*NatSetAddrAndPortAllocAlg)(nil), "nat.NatSetAddrAndPortAllocAlg") - api.RegisterMessage((*NatSetAddrAndPortAllocAlgReply)(nil), "nat.NatSetAddrAndPortAllocAlgReply") - api.RegisterMessage((*NatSetMssClamping)(nil), "nat.NatSetMssClamping") - api.RegisterMessage((*NatSetMssClampingReply)(nil), "nat.NatSetMssClampingReply") - api.RegisterMessage((*NatSetReass)(nil), "nat.NatSetReass") - api.RegisterMessage((*NatSetReassReply)(nil), "nat.NatSetReassReply") - api.RegisterMessage((*NatSetTimeouts)(nil), "nat.NatSetTimeouts") - api.RegisterMessage((*NatSetTimeoutsReply)(nil), "nat.NatSetTimeoutsReply") - api.RegisterMessage((*NatSetWorkers)(nil), "nat.NatSetWorkers") - api.RegisterMessage((*NatSetWorkersReply)(nil), "nat.NatSetWorkersReply") - api.RegisterMessage((*NatShowConfig)(nil), "nat.NatShowConfig") - api.RegisterMessage((*NatShowConfigReply)(nil), "nat.NatShowConfigReply") - api.RegisterMessage((*NatWorkerDetails)(nil), "nat.NatWorkerDetails") - api.RegisterMessage((*NatWorkerDump)(nil), "nat.NatWorkerDump") -} - -var Messages = []api.Message{ - (*DsliteAddDelPoolAddrRange)(nil), - (*DsliteAddDelPoolAddrRangeReply)(nil), - (*DsliteAddressDetails)(nil), - (*DsliteAddressDump)(nil), - (*DsliteGetAftrAddr)(nil), - (*DsliteGetAftrAddrReply)(nil), - (*DsliteGetB4Addr)(nil), - (*DsliteGetB4AddrReply)(nil), - (*DsliteSetAftrAddr)(nil), - (*DsliteSetAftrAddrReply)(nil), - (*DsliteSetB4Addr)(nil), - (*DsliteSetB4AddrReply)(nil), - (*Nat44AddDelAddressRange)(nil), - (*Nat44AddDelAddressRangeReply)(nil), - (*Nat44AddDelIdentityMapping)(nil), - (*Nat44AddDelIdentityMappingReply)(nil), - (*Nat44AddDelInterfaceAddr)(nil), - (*Nat44AddDelInterfaceAddrReply)(nil), - (*Nat44AddDelLbStaticMapping)(nil), - (*Nat44AddDelLbStaticMappingReply)(nil), - (*Nat44AddDelStaticMapping)(nil), - (*Nat44AddDelStaticMappingReply)(nil), - (*Nat44AddressDetails)(nil), - (*Nat44AddressDump)(nil), - (*Nat44DelSession)(nil), - (*Nat44DelSessionReply)(nil), - (*Nat44ForwardingEnableDisable)(nil), - (*Nat44ForwardingEnableDisableReply)(nil), - (*Nat44ForwardingIsEnabled)(nil), - (*Nat44ForwardingIsEnabledReply)(nil), - (*Nat44IdentityMappingDetails)(nil), - (*Nat44IdentityMappingDump)(nil), - (*Nat44InterfaceAddDelFeature)(nil), - (*Nat44InterfaceAddDelFeatureReply)(nil), - (*Nat44InterfaceAddDelOutputFeature)(nil), - (*Nat44InterfaceAddDelOutputFeatureReply)(nil), - (*Nat44InterfaceAddrDetails)(nil), - (*Nat44InterfaceAddrDump)(nil), - (*Nat44InterfaceDetails)(nil), - (*Nat44InterfaceDump)(nil), - (*Nat44InterfaceOutputFeatureDetails)(nil), - (*Nat44InterfaceOutputFeatureDump)(nil), - (*Nat44LbStaticMappingDetails)(nil), - (*Nat44LbStaticMappingDump)(nil), - (*Nat44StaticMappingDetails)(nil), - (*Nat44StaticMappingDump)(nil), - (*Nat44UserDetails)(nil), - (*Nat44UserDump)(nil), - (*Nat44UserSessionDetails)(nil), - (*Nat44UserSessionDump)(nil), - (*Nat64AddDelInterface)(nil), - (*Nat64AddDelInterfaceAddr)(nil), - (*Nat64AddDelInterfaceAddrReply)(nil), - (*Nat64AddDelInterfaceReply)(nil), - (*Nat64AddDelPoolAddrRange)(nil), - (*Nat64AddDelPoolAddrRangeReply)(nil), - (*Nat64AddDelPrefix)(nil), - (*Nat64AddDelPrefixReply)(nil), - (*Nat64AddDelStaticBib)(nil), - (*Nat64AddDelStaticBibReply)(nil), - (*Nat64BibDetails)(nil), - (*Nat64BibDump)(nil), - (*Nat64InterfaceDetails)(nil), - (*Nat64InterfaceDump)(nil), - (*Nat64PoolAddrDetails)(nil), - (*Nat64PoolAddrDump)(nil), - (*Nat64PrefixDetails)(nil), - (*Nat64PrefixDump)(nil), - (*Nat64StDetails)(nil), - (*Nat64StDump)(nil), - (*Nat66AddDelInterface)(nil), - (*Nat66AddDelInterfaceReply)(nil), - (*Nat66AddDelStaticMapping)(nil), - (*Nat66AddDelStaticMappingReply)(nil), - (*Nat66InterfaceDetails)(nil), - (*Nat66InterfaceDump)(nil), - (*Nat66StaticMappingDetails)(nil), - (*Nat66StaticMappingDump)(nil), - (*NatControlPing)(nil), - (*NatControlPingReply)(nil), - (*NatDetAddDelMap)(nil), - (*NatDetAddDelMapReply)(nil), - (*NatDetCloseSessionIn)(nil), - (*NatDetCloseSessionInReply)(nil), - (*NatDetCloseSessionOut)(nil), - (*NatDetCloseSessionOutReply)(nil), - (*NatDetForward)(nil), - (*NatDetForwardReply)(nil), - (*NatDetMapDetails)(nil), - (*NatDetMapDump)(nil), - (*NatDetReverse)(nil), - (*NatDetReverseReply)(nil), - (*NatDetSessionDetails)(nil), - (*NatDetSessionDump)(nil), - (*NatGetAddrAndPortAllocAlg)(nil), - (*NatGetAddrAndPortAllocAlgReply)(nil), - (*NatGetMssClamping)(nil), - (*NatGetMssClampingReply)(nil), - (*NatGetReass)(nil), - (*NatGetReassReply)(nil), - (*NatGetTimeouts)(nil), - (*NatGetTimeoutsReply)(nil), - (*NatIpfixEnableDisable)(nil), - (*NatIpfixEnableDisableReply)(nil), - (*NatReassDetails)(nil), - (*NatReassDump)(nil), - (*NatSetAddrAndPortAllocAlg)(nil), - (*NatSetAddrAndPortAllocAlgReply)(nil), - (*NatSetMssClamping)(nil), - (*NatSetMssClampingReply)(nil), - (*NatSetReass)(nil), - (*NatSetReassReply)(nil), - (*NatSetTimeouts)(nil), - (*NatSetTimeoutsReply)(nil), - (*NatSetWorkers)(nil), - (*NatSetWorkersReply)(nil), - (*NatShowConfig)(nil), - (*NatShowConfigReply)(nil), - (*NatWorkerDetails)(nil), - (*NatWorkerDump)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/punt/punt.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/punt/punt.ba.go deleted file mode 100644 index 34ac929d77..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/punt/punt.ba.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/punt.api.json - -/* - Package punt is a generated from VPP binary API module 'punt'. - - It contains following objects: - 3 services - 6 messages -*/ -package punt - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - Punt(*Punt) (*PuntReply, error) - PuntSocketDeregister(*PuntSocketDeregister) (*PuntSocketDeregisterReply, error) - PuntSocketRegister(*PuntSocketRegister) (*PuntSocketRegisterReply, error) -} - -/* Messages */ - -// Punt represents VPP binary API message 'punt': -type Punt struct { - IsAdd uint8 - IPv uint8 - L4Protocol uint8 - L4Port uint16 -} - -func (*Punt) GetMessageName() string { - return "punt" -} -func (*Punt) GetCrcString() string { - return "37760008" -} -func (*Punt) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// PuntReply represents VPP binary API message 'punt_reply': -type PuntReply struct { - Retval int32 -} - -func (*PuntReply) GetMessageName() string { - return "punt_reply" -} -func (*PuntReply) GetCrcString() string { - return "e8d4e804" -} -func (*PuntReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// PuntSocketDeregister represents VPP binary API message 'punt_socket_deregister': -type PuntSocketDeregister struct { - IsIP4 uint8 - L4Protocol uint8 - L4Port uint16 -} - -func (*PuntSocketDeregister) GetMessageName() string { - return "punt_socket_deregister" -} -func (*PuntSocketDeregister) GetCrcString() string { - return "9846a4cc" -} -func (*PuntSocketDeregister) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// PuntSocketDeregisterReply represents VPP binary API message 'punt_socket_deregister_reply': -type PuntSocketDeregisterReply struct { - Retval int32 -} - -func (*PuntSocketDeregisterReply) GetMessageName() string { - return "punt_socket_deregister_reply" -} -func (*PuntSocketDeregisterReply) GetCrcString() string { - return "e8d4e804" -} -func (*PuntSocketDeregisterReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// PuntSocketRegister represents VPP binary API message 'punt_socket_register': -type PuntSocketRegister struct { - HeaderVersion uint32 - IsIP4 uint8 - L4Protocol uint8 - L4Port uint16 - Pathname []byte `struc:"[108]byte"` -} - -func (*PuntSocketRegister) GetMessageName() string { - return "punt_socket_register" -} -func (*PuntSocketRegister) GetCrcString() string { - return "c163b363" -} -func (*PuntSocketRegister) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// PuntSocketRegisterReply represents VPP binary API message 'punt_socket_register_reply': -type PuntSocketRegisterReply struct { - Retval int32 - Pathname []byte `struc:"[64]byte"` -} - -func (*PuntSocketRegisterReply) GetMessageName() string { - return "punt_socket_register_reply" -} -func (*PuntSocketRegisterReply) GetCrcString() string { - return "42dc0ee6" -} -func (*PuntSocketRegisterReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func init() { - api.RegisterMessage((*Punt)(nil), "punt.Punt") - api.RegisterMessage((*PuntReply)(nil), "punt.PuntReply") - api.RegisterMessage((*PuntSocketDeregister)(nil), "punt.PuntSocketDeregister") - api.RegisterMessage((*PuntSocketDeregisterReply)(nil), "punt.PuntSocketDeregisterReply") - api.RegisterMessage((*PuntSocketRegister)(nil), "punt.PuntSocketRegister") - api.RegisterMessage((*PuntSocketRegisterReply)(nil), "punt.PuntSocketRegisterReply") -} - -var Messages = []api.Message{ - (*Punt)(nil), - (*PuntReply)(nil), - (*PuntSocketDeregister)(nil), - (*PuntSocketDeregisterReply)(nil), - (*PuntSocketRegister)(nil), - (*PuntSocketRegisterReply)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/sr/sr.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/sr/sr.ba.go deleted file mode 100644 index 5b69f158ea..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/sr/sr.ba.go +++ /dev/null @@ -1,426 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/sr.api.json - -/* - Package sr is a generated from VPP binary API module 'sr'. - - It contains following objects: - 9 services - 3 types - 18 messages -*/ -package sr - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpSrLocalsids(*SrLocalsidsDump) ([]*SrLocalsidsDetails, error) - DumpSrPolicies(*SrPoliciesDump) ([]*SrPoliciesDetails, error) - DumpSrSteeringPol(*SrSteeringPolDump) ([]*SrSteeringPolDetails, error) - SrLocalsidAddDel(*SrLocalsidAddDel) (*SrLocalsidAddDelReply, error) - SrPolicyAdd(*SrPolicyAdd) (*SrPolicyAddReply, error) - SrPolicyDel(*SrPolicyDel) (*SrPolicyDelReply, error) - SrPolicyMod(*SrPolicyMod) (*SrPolicyModReply, error) - SrSetEncapSource(*SrSetEncapSource) (*SrSetEncapSourceReply, error) - SrSteeringAddDel(*SrSteeringAddDel) (*SrSteeringAddDelReply, error) -} - -/* Types */ - -// SrIP6Address represents VPP binary API type 'sr_ip6_address': -type SrIP6Address struct { - Data []byte `struc:"[16]byte"` -} - -func (*SrIP6Address) GetTypeName() string { - return "sr_ip6_address" -} -func (*SrIP6Address) GetCrcString() string { - return "bea0c5e6" -} - -// Srv6Sid represents VPP binary API type 'srv6_sid': -type Srv6Sid struct { - Addr []byte `struc:"[16]byte"` -} - -func (*Srv6Sid) GetTypeName() string { - return "srv6_sid" -} -func (*Srv6Sid) GetCrcString() string { - return "6ee67284" -} - -// Srv6SidList represents VPP binary API type 'srv6_sid_list': -type Srv6SidList struct { - NumSids uint8 `struc:"sizeof=Sids"` - Weight uint32 - Sids []Srv6Sid -} - -func (*Srv6SidList) GetTypeName() string { - return "srv6_sid_list" -} -func (*Srv6SidList) GetCrcString() string { - return "4066af74" -} - -/* Messages */ - -// SrLocalsidAddDel represents VPP binary API message 'sr_localsid_add_del': -type SrLocalsidAddDel struct { - IsDel uint8 - Localsid Srv6Sid - EndPsp uint8 - Behavior uint8 - SwIfIndex uint32 - VlanIndex uint32 - FibTable uint32 - NhAddr6 []byte `struc:"[16]byte"` - NhAddr4 []byte `struc:"[4]byte"` -} - -func (*SrLocalsidAddDel) GetMessageName() string { - return "sr_localsid_add_del" -} -func (*SrLocalsidAddDel) GetCrcString() string { - return "20d478a0" -} -func (*SrLocalsidAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SrLocalsidAddDelReply represents VPP binary API message 'sr_localsid_add_del_reply': -type SrLocalsidAddDelReply struct { - Retval int32 -} - -func (*SrLocalsidAddDelReply) GetMessageName() string { - return "sr_localsid_add_del_reply" -} -func (*SrLocalsidAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SrLocalsidsDetails represents VPP binary API message 'sr_localsids_details': -type SrLocalsidsDetails struct { - Addr Srv6Sid - EndPsp uint8 - Behavior uint16 - FibTable uint32 - VlanIndex uint32 - XconnectNhAddr6 []byte `struc:"[16]byte"` - XconnectNhAddr4 []byte `struc:"[4]byte"` - XconnectIfaceOrVrfTable uint32 -} - -func (*SrLocalsidsDetails) GetMessageName() string { - return "sr_localsids_details" -} -func (*SrLocalsidsDetails) GetCrcString() string { - return "7ff35765" -} -func (*SrLocalsidsDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SrLocalsidsDump represents VPP binary API message 'sr_localsids_dump': -type SrLocalsidsDump struct{} - -func (*SrLocalsidsDump) GetMessageName() string { - return "sr_localsids_dump" -} -func (*SrLocalsidsDump) GetCrcString() string { - return "51077d14" -} -func (*SrLocalsidsDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SrPoliciesDetails represents VPP binary API message 'sr_policies_details': -type SrPoliciesDetails struct { - Bsid Srv6Sid - Type uint8 - IsEncap uint8 - FibTable uint32 - NumSidLists uint8 `struc:"sizeof=SidLists"` - SidLists []Srv6SidList -} - -func (*SrPoliciesDetails) GetMessageName() string { - return "sr_policies_details" -} -func (*SrPoliciesDetails) GetCrcString() string { - return "ae838a76" -} -func (*SrPoliciesDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SrPoliciesDump represents VPP binary API message 'sr_policies_dump': -type SrPoliciesDump struct{} - -func (*SrPoliciesDump) GetMessageName() string { - return "sr_policies_dump" -} -func (*SrPoliciesDump) GetCrcString() string { - return "51077d14" -} -func (*SrPoliciesDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SrPolicyAdd represents VPP binary API message 'sr_policy_add': -type SrPolicyAdd struct { - BsidAddr []byte `struc:"[16]byte"` - Weight uint32 - IsEncap uint8 - Type uint8 - FibTable uint32 - Sids Srv6SidList -} - -func (*SrPolicyAdd) GetMessageName() string { - return "sr_policy_add" -} -func (*SrPolicyAdd) GetCrcString() string { - return "a1676c1f" -} -func (*SrPolicyAdd) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SrPolicyAddReply represents VPP binary API message 'sr_policy_add_reply': -type SrPolicyAddReply struct { - Retval int32 -} - -func (*SrPolicyAddReply) GetMessageName() string { - return "sr_policy_add_reply" -} -func (*SrPolicyAddReply) GetCrcString() string { - return "e8d4e804" -} -func (*SrPolicyAddReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SrPolicyDel represents VPP binary API message 'sr_policy_del': -type SrPolicyDel struct { - BsidAddr Srv6Sid - SrPolicyIndex uint32 -} - -func (*SrPolicyDel) GetMessageName() string { - return "sr_policy_del" -} -func (*SrPolicyDel) GetCrcString() string { - return "168e1a98" -} -func (*SrPolicyDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SrPolicyDelReply represents VPP binary API message 'sr_policy_del_reply': -type SrPolicyDelReply struct { - Retval int32 -} - -func (*SrPolicyDelReply) GetMessageName() string { - return "sr_policy_del_reply" -} -func (*SrPolicyDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*SrPolicyDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SrPolicyMod represents VPP binary API message 'sr_policy_mod': -type SrPolicyMod struct { - BsidAddr []byte `struc:"[16]byte"` - SrPolicyIndex uint32 - FibTable uint32 - Operation uint8 - SlIndex uint32 - Weight uint32 - Sids Srv6SidList -} - -func (*SrPolicyMod) GetMessageName() string { - return "sr_policy_mod" -} -func (*SrPolicyMod) GetCrcString() string { - return "51252136" -} -func (*SrPolicyMod) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SrPolicyModReply represents VPP binary API message 'sr_policy_mod_reply': -type SrPolicyModReply struct { - Retval int32 -} - -func (*SrPolicyModReply) GetMessageName() string { - return "sr_policy_mod_reply" -} -func (*SrPolicyModReply) GetCrcString() string { - return "e8d4e804" -} -func (*SrPolicyModReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SrSetEncapSource represents VPP binary API message 'sr_set_encap_source': -type SrSetEncapSource struct { - EncapsSource []byte `struc:"[16]byte"` -} - -func (*SrSetEncapSource) GetMessageName() string { - return "sr_set_encap_source" -} -func (*SrSetEncapSource) GetCrcString() string { - return "d05bb4de" -} -func (*SrSetEncapSource) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SrSetEncapSourceReply represents VPP binary API message 'sr_set_encap_source_reply': -type SrSetEncapSourceReply struct { - Retval int32 -} - -func (*SrSetEncapSourceReply) GetMessageName() string { - return "sr_set_encap_source_reply" -} -func (*SrSetEncapSourceReply) GetCrcString() string { - return "e8d4e804" -} -func (*SrSetEncapSourceReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SrSteeringAddDel represents VPP binary API message 'sr_steering_add_del': -type SrSteeringAddDel struct { - IsDel uint8 - BsidAddr []byte `struc:"[16]byte"` - SrPolicyIndex uint32 - TableID uint32 - PrefixAddr []byte `struc:"[16]byte"` - MaskWidth uint32 - SwIfIndex uint32 - TrafficType uint8 -} - -func (*SrSteeringAddDel) GetMessageName() string { - return "sr_steering_add_del" -} -func (*SrSteeringAddDel) GetCrcString() string { - return "28b5dcab" -} -func (*SrSteeringAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SrSteeringAddDelReply represents VPP binary API message 'sr_steering_add_del_reply': -type SrSteeringAddDelReply struct { - Retval int32 -} - -func (*SrSteeringAddDelReply) GetMessageName() string { - return "sr_steering_add_del_reply" -} -func (*SrSteeringAddDelReply) GetCrcString() string { - return "e8d4e804" -} -func (*SrSteeringAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SrSteeringPolDetails represents VPP binary API message 'sr_steering_pol_details': -type SrSteeringPolDetails struct { - TrafficType uint8 - FibTable uint32 - PrefixAddr []byte `struc:"[16]byte"` - MaskWidth uint32 - SwIfIndex uint32 - Bsid Srv6Sid -} - -func (*SrSteeringPolDetails) GetMessageName() string { - return "sr_steering_pol_details" -} -func (*SrSteeringPolDetails) GetCrcString() string { - return "1c756f85" -} -func (*SrSteeringPolDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SrSteeringPolDump represents VPP binary API message 'sr_steering_pol_dump': -type SrSteeringPolDump struct{} - -func (*SrSteeringPolDump) GetMessageName() string { - return "sr_steering_pol_dump" -} -func (*SrSteeringPolDump) GetCrcString() string { - return "51077d14" -} -func (*SrSteeringPolDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func init() { - api.RegisterMessage((*SrLocalsidAddDel)(nil), "sr.SrLocalsidAddDel") - api.RegisterMessage((*SrLocalsidAddDelReply)(nil), "sr.SrLocalsidAddDelReply") - api.RegisterMessage((*SrLocalsidsDetails)(nil), "sr.SrLocalsidsDetails") - api.RegisterMessage((*SrLocalsidsDump)(nil), "sr.SrLocalsidsDump") - api.RegisterMessage((*SrPoliciesDetails)(nil), "sr.SrPoliciesDetails") - api.RegisterMessage((*SrPoliciesDump)(nil), "sr.SrPoliciesDump") - api.RegisterMessage((*SrPolicyAdd)(nil), "sr.SrPolicyAdd") - api.RegisterMessage((*SrPolicyAddReply)(nil), "sr.SrPolicyAddReply") - api.RegisterMessage((*SrPolicyDel)(nil), "sr.SrPolicyDel") - api.RegisterMessage((*SrPolicyDelReply)(nil), "sr.SrPolicyDelReply") - api.RegisterMessage((*SrPolicyMod)(nil), "sr.SrPolicyMod") - api.RegisterMessage((*SrPolicyModReply)(nil), "sr.SrPolicyModReply") - api.RegisterMessage((*SrSetEncapSource)(nil), "sr.SrSetEncapSource") - api.RegisterMessage((*SrSetEncapSourceReply)(nil), "sr.SrSetEncapSourceReply") - api.RegisterMessage((*SrSteeringAddDel)(nil), "sr.SrSteeringAddDel") - api.RegisterMessage((*SrSteeringAddDelReply)(nil), "sr.SrSteeringAddDelReply") - api.RegisterMessage((*SrSteeringPolDetails)(nil), "sr.SrSteeringPolDetails") - api.RegisterMessage((*SrSteeringPolDump)(nil), "sr.SrSteeringPolDump") -} - -var Messages = []api.Message{ - (*SrLocalsidAddDel)(nil), - (*SrLocalsidAddDelReply)(nil), - (*SrLocalsidsDetails)(nil), - (*SrLocalsidsDump)(nil), - (*SrPoliciesDetails)(nil), - (*SrPoliciesDump)(nil), - (*SrPolicyAdd)(nil), - (*SrPolicyAddReply)(nil), - (*SrPolicyDel)(nil), - (*SrPolicyDelReply)(nil), - (*SrPolicyMod)(nil), - (*SrPolicyModReply)(nil), - (*SrSetEncapSource)(nil), - (*SrSetEncapSourceReply)(nil), - (*SrSteeringAddDel)(nil), - (*SrSteeringAddDelReply)(nil), - (*SrSteeringPolDetails)(nil), - (*SrSteeringPolDump)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/stn/stn.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/stn/stn.ba.go deleted file mode 100644 index acf5b26dfa..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/stn/stn.ba.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/stn.api.json - -/* - Package stn is a generated from VPP binary API module 'stn'. - - It contains following objects: - 2 services - 4 messages -*/ -package stn - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpStnRules(*StnRulesDump) ([]*StnRulesDetails, error) - StnAddDelRule(*StnAddDelRule) (*StnAddDelRuleReply, error) -} - -/* Messages */ - -// StnAddDelRule represents VPP binary API message 'stn_add_del_rule': -type StnAddDelRule struct { - IsIP4 uint8 - IPAddress []byte `struc:"[16]byte"` - SwIfIndex uint32 - IsAdd uint8 -} - -func (*StnAddDelRule) GetMessageName() string { - return "stn_add_del_rule" -} -func (*StnAddDelRule) GetCrcString() string { - return "9f0bbe21" -} -func (*StnAddDelRule) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// StnAddDelRuleReply represents VPP binary API message 'stn_add_del_rule_reply': -type StnAddDelRuleReply struct { - Retval int32 -} - -func (*StnAddDelRuleReply) GetMessageName() string { - return "stn_add_del_rule_reply" -} -func (*StnAddDelRuleReply) GetCrcString() string { - return "e8d4e804" -} -func (*StnAddDelRuleReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// StnRulesDetails represents VPP binary API message 'stn_rules_details': -type StnRulesDetails struct { - IsIP4 uint8 - IPAddress []byte `struc:"[16]byte"` - SwIfIndex uint32 -} - -func (*StnRulesDetails) GetMessageName() string { - return "stn_rules_details" -} -func (*StnRulesDetails) GetCrcString() string { - return "5eafa31e" -} -func (*StnRulesDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// StnRulesDump represents VPP binary API message 'stn_rules_dump': -type StnRulesDump struct{} - -func (*StnRulesDump) GetMessageName() string { - return "stn_rules_dump" -} -func (*StnRulesDump) GetCrcString() string { - return "51077d14" -} -func (*StnRulesDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func init() { - api.RegisterMessage((*StnAddDelRule)(nil), "stn.StnAddDelRule") - api.RegisterMessage((*StnAddDelRuleReply)(nil), "stn.StnAddDelRuleReply") - api.RegisterMessage((*StnRulesDetails)(nil), "stn.StnRulesDetails") - api.RegisterMessage((*StnRulesDump)(nil), "stn.StnRulesDump") -} - -var Messages = []api.Message{ - (*StnAddDelRule)(nil), - (*StnAddDelRuleReply)(nil), - (*StnRulesDetails)(nil), - (*StnRulesDump)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/tap/tap.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/tap/tap.ba.go deleted file mode 100644 index fd6f55585f..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/tap/tap.ba.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/tap.api.json - -/* - Package tap is a generated from VPP binary API module 'tap'. - - It contains following objects: - 4 services - 8 messages -*/ -package tap - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpSwInterfaceTap(*SwInterfaceTapDump) ([]*SwInterfaceTapDetails, error) - TapConnect(*TapConnect) (*TapConnectReply, error) - TapDelete(*TapDelete) (*TapDeleteReply, error) - TapModify(*TapModify) (*TapModifyReply, error) -} - -/* Messages */ - -// SwInterfaceTapDetails represents VPP binary API message 'sw_interface_tap_details': -type SwInterfaceTapDetails struct { - SwIfIndex uint32 - DevName []byte `struc:"[64]byte"` -} - -func (*SwInterfaceTapDetails) GetMessageName() string { - return "sw_interface_tap_details" -} -func (*SwInterfaceTapDetails) GetCrcString() string { - return "76229a57" -} -func (*SwInterfaceTapDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceTapDump represents VPP binary API message 'sw_interface_tap_dump': -type SwInterfaceTapDump struct{} - -func (*SwInterfaceTapDump) GetMessageName() string { - return "sw_interface_tap_dump" -} -func (*SwInterfaceTapDump) GetCrcString() string { - return "51077d14" -} -func (*SwInterfaceTapDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// TapConnect represents VPP binary API message 'tap_connect': -type TapConnect struct { - UseRandomMac uint8 - TapName []byte `struc:"[64]byte"` - MacAddress []byte `struc:"[6]byte"` - Renumber uint8 - CustomDevInstance uint32 - IP4AddressSet uint8 - IP4Address []byte `struc:"[4]byte"` - IP4MaskWidth uint8 - IP6AddressSet uint8 - IP6Address []byte `struc:"[16]byte"` - IP6MaskWidth uint8 - Tag []byte `struc:"[64]byte"` -} - -func (*TapConnect) GetMessageName() string { - return "tap_connect" -} -func (*TapConnect) GetCrcString() string { - return "9b9c396f" -} -func (*TapConnect) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// TapConnectReply represents VPP binary API message 'tap_connect_reply': -type TapConnectReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*TapConnectReply) GetMessageName() string { - return "tap_connect_reply" -} -func (*TapConnectReply) GetCrcString() string { - return "fda5941f" -} -func (*TapConnectReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// TapDelete represents VPP binary API message 'tap_delete': -type TapDelete struct { - SwIfIndex uint32 -} - -func (*TapDelete) GetMessageName() string { - return "tap_delete" -} -func (*TapDelete) GetCrcString() string { - return "529cb13f" -} -func (*TapDelete) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// TapDeleteReply represents VPP binary API message 'tap_delete_reply': -type TapDeleteReply struct { - Retval int32 -} - -func (*TapDeleteReply) GetMessageName() string { - return "tap_delete_reply" -} -func (*TapDeleteReply) GetCrcString() string { - return "e8d4e804" -} -func (*TapDeleteReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// TapModify represents VPP binary API message 'tap_modify': -type TapModify struct { - SwIfIndex uint32 - UseRandomMac uint8 - TapName []byte `struc:"[64]byte"` - MacAddress []byte `struc:"[6]byte"` - Renumber uint8 - CustomDevInstance uint32 -} - -func (*TapModify) GetMessageName() string { - return "tap_modify" -} -func (*TapModify) GetCrcString() string { - return "8047ae5c" -} -func (*TapModify) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// TapModifyReply represents VPP binary API message 'tap_modify_reply': -type TapModifyReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*TapModifyReply) GetMessageName() string { - return "tap_modify_reply" -} -func (*TapModifyReply) GetCrcString() string { - return "fda5941f" -} -func (*TapModifyReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func init() { - api.RegisterMessage((*SwInterfaceTapDetails)(nil), "tap.SwInterfaceTapDetails") - api.RegisterMessage((*SwInterfaceTapDump)(nil), "tap.SwInterfaceTapDump") - api.RegisterMessage((*TapConnect)(nil), "tap.TapConnect") - api.RegisterMessage((*TapConnectReply)(nil), "tap.TapConnectReply") - api.RegisterMessage((*TapDelete)(nil), "tap.TapDelete") - api.RegisterMessage((*TapDeleteReply)(nil), "tap.TapDeleteReply") - api.RegisterMessage((*TapModify)(nil), "tap.TapModify") - api.RegisterMessage((*TapModifyReply)(nil), "tap.TapModifyReply") -} - -var Messages = []api.Message{ - (*SwInterfaceTapDetails)(nil), - (*SwInterfaceTapDump)(nil), - (*TapConnect)(nil), - (*TapConnectReply)(nil), - (*TapDelete)(nil), - (*TapDeleteReply)(nil), - (*TapModify)(nil), - (*TapModifyReply)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/tapv2/tapv2.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/tapv2/tapv2.ba.go deleted file mode 100644 index 41840dcd78..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/tapv2/tapv2.ba.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/tapv2.api.json - -/* - Package tapv2 is a generated from VPP binary API module 'tapv2'. - - It contains following objects: - 3 services - 6 messages -*/ -package tapv2 - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpSwInterfaceTapV2(*SwInterfaceTapV2Dump) ([]*SwInterfaceTapV2Details, error) - TapCreateV2(*TapCreateV2) (*TapCreateV2Reply, error) - TapDeleteV2(*TapDeleteV2) (*TapDeleteV2Reply, error) -} - -/* Messages */ - -// SwInterfaceTapV2Details represents VPP binary API message 'sw_interface_tap_v2_details': -type SwInterfaceTapV2Details struct { - SwIfIndex uint32 - ID uint32 - DevName []byte `struc:"[64]byte"` - TxRingSz uint16 - RxRingSz uint16 - HostMacAddr []byte `struc:"[6]byte"` - HostIfName []byte `struc:"[64]byte"` - HostNamespace []byte `struc:"[64]byte"` - HostBridge []byte `struc:"[64]byte"` - HostIP4Addr []byte `struc:"[4]byte"` - HostIP4PrefixLen uint8 - HostIP6Addr []byte `struc:"[16]byte"` - HostIP6PrefixLen uint8 -} - -func (*SwInterfaceTapV2Details) GetMessageName() string { - return "sw_interface_tap_v2_details" -} -func (*SwInterfaceTapV2Details) GetCrcString() string { - return "b4c58229" -} -func (*SwInterfaceTapV2Details) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// SwInterfaceTapV2Dump represents VPP binary API message 'sw_interface_tap_v2_dump': -type SwInterfaceTapV2Dump struct{} - -func (*SwInterfaceTapV2Dump) GetMessageName() string { - return "sw_interface_tap_v2_dump" -} -func (*SwInterfaceTapV2Dump) GetCrcString() string { - return "51077d14" -} -func (*SwInterfaceTapV2Dump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// TapCreateV2 represents VPP binary API message 'tap_create_v2': -type TapCreateV2 struct { - ID uint32 - UseRandomMac uint8 - MacAddress []byte `struc:"[6]byte"` - TxRingSz uint16 - RxRingSz uint16 - HostNamespaceSet uint8 - HostNamespace []byte `struc:"[64]byte"` - HostMacAddrSet uint8 - HostMacAddr []byte `struc:"[6]byte"` - HostIfNameSet uint8 - HostIfName []byte `struc:"[64]byte"` - HostBridgeSet uint8 - HostBridge []byte `struc:"[64]byte"` - HostIP4AddrSet uint8 - HostIP4Addr []byte `struc:"[4]byte"` - HostIP4PrefixLen uint8 - HostIP6AddrSet uint8 - HostIP6Addr []byte `struc:"[16]byte"` - HostIP6PrefixLen uint8 - HostIP4GwSet uint8 - HostIP4Gw []byte `struc:"[4]byte"` - HostIP6GwSet uint8 - HostIP6Gw []byte `struc:"[16]byte"` - Tag []byte `struc:"[64]byte"` -} - -func (*TapCreateV2) GetMessageName() string { - return "tap_create_v2" -} -func (*TapCreateV2) GetCrcString() string { - return "34ce8043" -} -func (*TapCreateV2) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// TapCreateV2Reply represents VPP binary API message 'tap_create_v2_reply': -type TapCreateV2Reply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*TapCreateV2Reply) GetMessageName() string { - return "tap_create_v2_reply" -} -func (*TapCreateV2Reply) GetCrcString() string { - return "fda5941f" -} -func (*TapCreateV2Reply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// TapDeleteV2 represents VPP binary API message 'tap_delete_v2': -type TapDeleteV2 struct { - SwIfIndex uint32 -} - -func (*TapDeleteV2) GetMessageName() string { - return "tap_delete_v2" -} -func (*TapDeleteV2) GetCrcString() string { - return "529cb13f" -} -func (*TapDeleteV2) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// TapDeleteV2Reply represents VPP binary API message 'tap_delete_v2_reply': -type TapDeleteV2Reply struct { - Retval int32 -} - -func (*TapDeleteV2Reply) GetMessageName() string { - return "tap_delete_v2_reply" -} -func (*TapDeleteV2Reply) GetCrcString() string { - return "e8d4e804" -} -func (*TapDeleteV2Reply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func init() { - api.RegisterMessage((*SwInterfaceTapV2Details)(nil), "tapv2.SwInterfaceTapV2Details") - api.RegisterMessage((*SwInterfaceTapV2Dump)(nil), "tapv2.SwInterfaceTapV2Dump") - api.RegisterMessage((*TapCreateV2)(nil), "tapv2.TapCreateV2") - api.RegisterMessage((*TapCreateV2Reply)(nil), "tapv2.TapCreateV2Reply") - api.RegisterMessage((*TapDeleteV2)(nil), "tapv2.TapDeleteV2") - api.RegisterMessage((*TapDeleteV2Reply)(nil), "tapv2.TapDeleteV2Reply") -} - -var Messages = []api.Message{ - (*SwInterfaceTapV2Details)(nil), - (*SwInterfaceTapV2Dump)(nil), - (*TapCreateV2)(nil), - (*TapCreateV2Reply)(nil), - (*TapDeleteV2)(nil), - (*TapDeleteV2Reply)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vmxnet3/vmxnet3.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vmxnet3/vmxnet3.ba.go deleted file mode 100644 index 73b94a33bc..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vmxnet3/vmxnet3.ba.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/vmxnet3.api.json - -/* - Package vmxnet3 is a generated from VPP binary API module 'vmxnet3'. - - It contains following objects: - 3 services - 6 messages -*/ -package vmxnet3 - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpVmxnet3(*Vmxnet3Dump) ([]*Vmxnet3Details, error) - Vmxnet3Create(*Vmxnet3Create) (*Vmxnet3CreateReply, error) - Vmxnet3Delete(*Vmxnet3Delete) (*Vmxnet3DeleteReply, error) -} - -/* Messages */ - -// Vmxnet3Create represents VPP binary API message 'vmxnet3_create': -type Vmxnet3Create struct { - PciAddr uint32 - EnableElog int32 - RxqSize uint16 - TxqSize uint16 -} - -func (*Vmxnet3Create) GetMessageName() string { - return "vmxnet3_create" -} -func (*Vmxnet3Create) GetCrcString() string { - return "7318251d" -} -func (*Vmxnet3Create) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Vmxnet3CreateReply represents VPP binary API message 'vmxnet3_create_reply': -type Vmxnet3CreateReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*Vmxnet3CreateReply) GetMessageName() string { - return "vmxnet3_create_reply" -} -func (*Vmxnet3CreateReply) GetCrcString() string { - return "fda5941f" -} -func (*Vmxnet3CreateReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Vmxnet3Delete represents VPP binary API message 'vmxnet3_delete': -type Vmxnet3Delete struct { - SwIfIndex uint32 -} - -func (*Vmxnet3Delete) GetMessageName() string { - return "vmxnet3_delete" -} -func (*Vmxnet3Delete) GetCrcString() string { - return "529cb13f" -} -func (*Vmxnet3Delete) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// Vmxnet3DeleteReply represents VPP binary API message 'vmxnet3_delete_reply': -type Vmxnet3DeleteReply struct { - Retval int32 -} - -func (*Vmxnet3DeleteReply) GetMessageName() string { - return "vmxnet3_delete_reply" -} -func (*Vmxnet3DeleteReply) GetCrcString() string { - return "e8d4e804" -} -func (*Vmxnet3DeleteReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Vmxnet3Details represents VPP binary API message 'vmxnet3_details': -type Vmxnet3Details struct { - SwIfIndex uint32 - IfName []byte `struc:"[64]byte"` - HwAddr []byte `struc:"[6]byte"` - PciAddr uint32 - Version uint8 - RxQid uint16 - RxQsize uint16 - RxFill []uint16 `struc:"[2]uint16"` - RxNext uint16 - RxProduce []uint16 `struc:"[2]uint16"` - RxConsume []uint16 `struc:"[2]uint16"` - TxQid uint16 - TxQsize uint16 - TxNext uint16 - TxProduce uint16 - TxConsume uint16 - AdminUpDown uint8 -} - -func (*Vmxnet3Details) GetMessageName() string { - return "vmxnet3_details" -} -func (*Vmxnet3Details) GetCrcString() string { - return "2374ddc9" -} -func (*Vmxnet3Details) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Vmxnet3Dump represents VPP binary API message 'vmxnet3_dump': -type Vmxnet3Dump struct{} - -func (*Vmxnet3Dump) GetMessageName() string { - return "vmxnet3_dump" -} -func (*Vmxnet3Dump) GetCrcString() string { - return "51077d14" -} -func (*Vmxnet3Dump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func init() { - api.RegisterMessage((*Vmxnet3Create)(nil), "vmxnet3.Vmxnet3Create") - api.RegisterMessage((*Vmxnet3CreateReply)(nil), "vmxnet3.Vmxnet3CreateReply") - api.RegisterMessage((*Vmxnet3Delete)(nil), "vmxnet3.Vmxnet3Delete") - api.RegisterMessage((*Vmxnet3DeleteReply)(nil), "vmxnet3.Vmxnet3DeleteReply") - api.RegisterMessage((*Vmxnet3Details)(nil), "vmxnet3.Vmxnet3Details") - api.RegisterMessage((*Vmxnet3Dump)(nil), "vmxnet3.Vmxnet3Dump") -} - -var Messages = []api.Message{ - (*Vmxnet3Create)(nil), - (*Vmxnet3CreateReply)(nil), - (*Vmxnet3Delete)(nil), - (*Vmxnet3DeleteReply)(nil), - (*Vmxnet3Details)(nil), - (*Vmxnet3Dump)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vpe/vpe.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vpe/vpe.ba.go deleted file mode 100644 index c87f2feced..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vpe/vpe.ba.go +++ /dev/null @@ -1,378 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/vpe.api.json - -/* - Package vpe is a generated from VPP binary API module 'vpe'. - - It contains following objects: - 9 services - 1 type - 18 messages -*/ -package vpe - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - AddNodeNext(*AddNodeNext) (*AddNodeNextReply, error) - Cli(*Cli) (*CliReply, error) - CliInband(*CliInband) (*CliInbandReply, error) - ControlPing(*ControlPing) (*ControlPingReply, error) - GetNextIndex(*GetNextIndex) (*GetNextIndexReply, error) - GetNodeGraph(*GetNodeGraph) (*GetNodeGraphReply, error) - GetNodeIndex(*GetNodeIndex) (*GetNodeIndexReply, error) - ShowThreads(*ShowThreads) (*ShowThreadsReply, error) - ShowVersion(*ShowVersion) (*ShowVersionReply, error) -} - -/* Types */ - -// ThreadData represents VPP binary API type 'thread_data': -type ThreadData struct { - ID uint32 - Name []byte `struc:"[64]byte"` - Type []byte `struc:"[64]byte"` - PID uint32 - CPUID uint32 - Core uint32 - CPUSocket uint32 -} - -func (*ThreadData) GetTypeName() string { - return "thread_data" -} -func (*ThreadData) GetCrcString() string { - return "0f57094e" -} - -/* Messages */ - -// AddNodeNext represents VPP binary API message 'add_node_next': -type AddNodeNext struct { - NodeName []byte `struc:"[64]byte"` - NextName []byte `struc:"[64]byte"` -} - -func (*AddNodeNext) GetMessageName() string { - return "add_node_next" -} -func (*AddNodeNext) GetCrcString() string { - return "9ab92f7a" -} -func (*AddNodeNext) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// AddNodeNextReply represents VPP binary API message 'add_node_next_reply': -type AddNodeNextReply struct { - Retval int32 - NextIndex uint32 -} - -func (*AddNodeNextReply) GetMessageName() string { - return "add_node_next_reply" -} -func (*AddNodeNextReply) GetCrcString() string { - return "2ed75f32" -} -func (*AddNodeNextReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// Cli represents VPP binary API message 'cli': -type Cli struct { - CmdInShmem uint64 -} - -func (*Cli) GetMessageName() string { - return "cli" -} -func (*Cli) GetCrcString() string { - return "23bfbfff" -} -func (*Cli) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// CliInband represents VPP binary API message 'cli_inband': -type CliInband struct { - Length uint32 `struc:"sizeof=Cmd"` - Cmd []byte -} - -func (*CliInband) GetMessageName() string { - return "cli_inband" -} -func (*CliInband) GetCrcString() string { - return "74e00a49" -} -func (*CliInband) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// CliInbandReply represents VPP binary API message 'cli_inband_reply': -type CliInbandReply struct { - Retval int32 - Length uint32 `struc:"sizeof=Reply"` - Reply []byte -} - -func (*CliInbandReply) GetMessageName() string { - return "cli_inband_reply" -} -func (*CliInbandReply) GetCrcString() string { - return "1f22bbb8" -} -func (*CliInbandReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// CliReply represents VPP binary API message 'cli_reply': -type CliReply struct { - Retval int32 - ReplyInShmem uint64 -} - -func (*CliReply) GetMessageName() string { - return "cli_reply" -} -func (*CliReply) GetCrcString() string { - return "06d68297" -} -func (*CliReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ControlPing represents VPP binary API message 'control_ping': -type ControlPing struct{} - -func (*ControlPing) GetMessageName() string { - return "control_ping" -} -func (*ControlPing) GetCrcString() string { - return "51077d14" -} -func (*ControlPing) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ControlPingReply represents VPP binary API message 'control_ping_reply': -type ControlPingReply struct { - Retval int32 - ClientIndex uint32 - VpePID uint32 -} - -func (*ControlPingReply) GetMessageName() string { - return "control_ping_reply" -} -func (*ControlPingReply) GetCrcString() string { - return "f6b0b8ca" -} -func (*ControlPingReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// GetNextIndex represents VPP binary API message 'get_next_index': -type GetNextIndex struct { - NodeName []byte `struc:"[64]byte"` - NextName []byte `struc:"[64]byte"` -} - -func (*GetNextIndex) GetMessageName() string { - return "get_next_index" -} -func (*GetNextIndex) GetCrcString() string { - return "9ab92f7a" -} -func (*GetNextIndex) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// GetNextIndexReply represents VPP binary API message 'get_next_index_reply': -type GetNextIndexReply struct { - Retval int32 - NextIndex uint32 -} - -func (*GetNextIndexReply) GetMessageName() string { - return "get_next_index_reply" -} -func (*GetNextIndexReply) GetCrcString() string { - return "2ed75f32" -} -func (*GetNextIndexReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// GetNodeGraph represents VPP binary API message 'get_node_graph': -type GetNodeGraph struct{} - -func (*GetNodeGraph) GetMessageName() string { - return "get_node_graph" -} -func (*GetNodeGraph) GetCrcString() string { - return "51077d14" -} -func (*GetNodeGraph) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// GetNodeGraphReply represents VPP binary API message 'get_node_graph_reply': -type GetNodeGraphReply struct { - Retval int32 - ReplyInShmem uint64 -} - -func (*GetNodeGraphReply) GetMessageName() string { - return "get_node_graph_reply" -} -func (*GetNodeGraphReply) GetCrcString() string { - return "06d68297" -} -func (*GetNodeGraphReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// GetNodeIndex represents VPP binary API message 'get_node_index': -type GetNodeIndex struct { - NodeName []byte `struc:"[64]byte"` -} - -func (*GetNodeIndex) GetMessageName() string { - return "get_node_index" -} -func (*GetNodeIndex) GetCrcString() string { - return "6c9a495d" -} -func (*GetNodeIndex) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// GetNodeIndexReply represents VPP binary API message 'get_node_index_reply': -type GetNodeIndexReply struct { - Retval int32 - NodeIndex uint32 -} - -func (*GetNodeIndexReply) GetMessageName() string { - return "get_node_index_reply" -} -func (*GetNodeIndexReply) GetCrcString() string { - return "a8600b89" -} -func (*GetNodeIndexReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ShowThreads represents VPP binary API message 'show_threads': -type ShowThreads struct{} - -func (*ShowThreads) GetMessageName() string { - return "show_threads" -} -func (*ShowThreads) GetCrcString() string { - return "51077d14" -} -func (*ShowThreads) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ShowThreadsReply represents VPP binary API message 'show_threads_reply': -type ShowThreadsReply struct { - Retval int32 - Count uint32 `struc:"sizeof=ThreadData"` - ThreadData []ThreadData -} - -func (*ShowThreadsReply) GetMessageName() string { - return "show_threads_reply" -} -func (*ShowThreadsReply) GetCrcString() string { - return "6942fb35" -} -func (*ShowThreadsReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// ShowVersion represents VPP binary API message 'show_version': -type ShowVersion struct{} - -func (*ShowVersion) GetMessageName() string { - return "show_version" -} -func (*ShowVersion) GetCrcString() string { - return "51077d14" -} -func (*ShowVersion) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// ShowVersionReply represents VPP binary API message 'show_version_reply': -type ShowVersionReply struct { - Retval int32 - Program []byte `struc:"[32]byte"` - Version []byte `struc:"[32]byte"` - BuildDate []byte `struc:"[32]byte"` - BuildDirectory []byte `struc:"[256]byte"` -} - -func (*ShowVersionReply) GetMessageName() string { - return "show_version_reply" -} -func (*ShowVersionReply) GetCrcString() string { - return "8b5a13b4" -} -func (*ShowVersionReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func init() { - api.RegisterMessage((*AddNodeNext)(nil), "vpe.AddNodeNext") - api.RegisterMessage((*AddNodeNextReply)(nil), "vpe.AddNodeNextReply") - api.RegisterMessage((*Cli)(nil), "vpe.Cli") - api.RegisterMessage((*CliInband)(nil), "vpe.CliInband") - api.RegisterMessage((*CliInbandReply)(nil), "vpe.CliInbandReply") - api.RegisterMessage((*CliReply)(nil), "vpe.CliReply") - api.RegisterMessage((*ControlPing)(nil), "vpe.ControlPing") - api.RegisterMessage((*ControlPingReply)(nil), "vpe.ControlPingReply") - api.RegisterMessage((*GetNextIndex)(nil), "vpe.GetNextIndex") - api.RegisterMessage((*GetNextIndexReply)(nil), "vpe.GetNextIndexReply") - api.RegisterMessage((*GetNodeGraph)(nil), "vpe.GetNodeGraph") - api.RegisterMessage((*GetNodeGraphReply)(nil), "vpe.GetNodeGraphReply") - api.RegisterMessage((*GetNodeIndex)(nil), "vpe.GetNodeIndex") - api.RegisterMessage((*GetNodeIndexReply)(nil), "vpe.GetNodeIndexReply") - api.RegisterMessage((*ShowThreads)(nil), "vpe.ShowThreads") - api.RegisterMessage((*ShowThreadsReply)(nil), "vpe.ShowThreadsReply") - api.RegisterMessage((*ShowVersion)(nil), "vpe.ShowVersion") - api.RegisterMessage((*ShowVersionReply)(nil), "vpe.ShowVersionReply") -} - -var Messages = []api.Message{ - (*AddNodeNext)(nil), - (*AddNodeNextReply)(nil), - (*Cli)(nil), - (*CliInband)(nil), - (*CliInbandReply)(nil), - (*CliReply)(nil), - (*ControlPing)(nil), - (*ControlPingReply)(nil), - (*GetNextIndex)(nil), - (*GetNextIndexReply)(nil), - (*GetNodeGraph)(nil), - (*GetNodeGraphReply)(nil), - (*GetNodeIndex)(nil), - (*GetNodeIndexReply)(nil), - (*ShowThreads)(nil), - (*ShowThreadsReply)(nil), - (*ShowVersion)(nil), - (*ShowVersionReply)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vxlan/vxlan.ba.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vxlan/vxlan.ba.go deleted file mode 100644 index af953f03bc..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vxlan/vxlan.ba.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by GoVPP binapi-generator. DO NOT EDIT. -// source: /usr/share/vpp/api/vxlan.api.json - -/* - Package vxlan is a generated from VPP binary API module 'vxlan'. - - It contains following objects: - 4 services - 8 messages -*/ -package vxlan - -import api "git.fd.io/govpp.git/api" -import struc "github.com/lunixbochs/struc" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = api.RegisterMessage -var _ = struc.Pack -var _ = bytes.NewBuffer - -// Services represents VPP binary API services: -type Services interface { - DumpVxlanTunnel(*VxlanTunnelDump) ([]*VxlanTunnelDetails, error) - SwInterfaceSetVxlanBypass(*SwInterfaceSetVxlanBypass) (*SwInterfaceSetVxlanBypassReply, error) - VxlanAddDelTunnel(*VxlanAddDelTunnel) (*VxlanAddDelTunnelReply, error) - VxlanOffloadRx(*VxlanOffloadRx) (*VxlanOffloadRxReply, error) -} - -/* Messages */ - -// SwInterfaceSetVxlanBypass represents VPP binary API message 'sw_interface_set_vxlan_bypass': -type SwInterfaceSetVxlanBypass struct { - SwIfIndex uint32 - IsIPv6 uint8 - Enable uint8 -} - -func (*SwInterfaceSetVxlanBypass) GetMessageName() string { - return "sw_interface_set_vxlan_bypass" -} -func (*SwInterfaceSetVxlanBypass) GetCrcString() string { - return "e74ca095" -} -func (*SwInterfaceSetVxlanBypass) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// SwInterfaceSetVxlanBypassReply represents VPP binary API message 'sw_interface_set_vxlan_bypass_reply': -type SwInterfaceSetVxlanBypassReply struct { - Retval int32 -} - -func (*SwInterfaceSetVxlanBypassReply) GetMessageName() string { - return "sw_interface_set_vxlan_bypass_reply" -} -func (*SwInterfaceSetVxlanBypassReply) GetCrcString() string { - return "e8d4e804" -} -func (*SwInterfaceSetVxlanBypassReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// VxlanAddDelTunnel represents VPP binary API message 'vxlan_add_del_tunnel': -type VxlanAddDelTunnel struct { - IsAdd uint8 - IsIPv6 uint8 - Instance uint32 - SrcAddress []byte `struc:"[16]byte"` - DstAddress []byte `struc:"[16]byte"` - McastSwIfIndex uint32 - EncapVrfID uint32 - DecapNextIndex uint32 - Vni uint32 -} - -func (*VxlanAddDelTunnel) GetMessageName() string { - return "vxlan_add_del_tunnel" -} -func (*VxlanAddDelTunnel) GetCrcString() string { - return "00f4bdd0" -} -func (*VxlanAddDelTunnel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// VxlanAddDelTunnelReply represents VPP binary API message 'vxlan_add_del_tunnel_reply': -type VxlanAddDelTunnelReply struct { - Retval int32 - SwIfIndex uint32 -} - -func (*VxlanAddDelTunnelReply) GetMessageName() string { - return "vxlan_add_del_tunnel_reply" -} -func (*VxlanAddDelTunnelReply) GetCrcString() string { - return "fda5941f" -} -func (*VxlanAddDelTunnelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// VxlanOffloadRx represents VPP binary API message 'vxlan_offload_rx': -type VxlanOffloadRx struct { - HwIfIndex uint32 - SwIfIndex uint32 - Enable uint8 -} - -func (*VxlanOffloadRx) GetMessageName() string { - return "vxlan_offload_rx" -} -func (*VxlanOffloadRx) GetCrcString() string { - return "f0b08786" -} -func (*VxlanOffloadRx) GetMessageType() api.MessageType { - return api.RequestMessage -} - -// VxlanOffloadRxReply represents VPP binary API message 'vxlan_offload_rx_reply': -type VxlanOffloadRxReply struct { - Retval int32 -} - -func (*VxlanOffloadRxReply) GetMessageName() string { - return "vxlan_offload_rx_reply" -} -func (*VxlanOffloadRxReply) GetCrcString() string { - return "e8d4e804" -} -func (*VxlanOffloadRxReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// VxlanTunnelDetails represents VPP binary API message 'vxlan_tunnel_details': -type VxlanTunnelDetails struct { - SwIfIndex uint32 - Instance uint32 - SrcAddress []byte `struc:"[16]byte"` - DstAddress []byte `struc:"[16]byte"` - McastSwIfIndex uint32 - EncapVrfID uint32 - DecapNextIndex uint32 - Vni uint32 - IsIPv6 uint8 -} - -func (*VxlanTunnelDetails) GetMessageName() string { - return "vxlan_tunnel_details" -} -func (*VxlanTunnelDetails) GetCrcString() string { - return "ce38e127" -} -func (*VxlanTunnelDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -// VxlanTunnelDump represents VPP binary API message 'vxlan_tunnel_dump': -type VxlanTunnelDump struct { - SwIfIndex uint32 -} - -func (*VxlanTunnelDump) GetMessageName() string { - return "vxlan_tunnel_dump" -} -func (*VxlanTunnelDump) GetCrcString() string { - return "529cb13f" -} -func (*VxlanTunnelDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func init() { - api.RegisterMessage((*SwInterfaceSetVxlanBypass)(nil), "vxlan.SwInterfaceSetVxlanBypass") - api.RegisterMessage((*SwInterfaceSetVxlanBypassReply)(nil), "vxlan.SwInterfaceSetVxlanBypassReply") - api.RegisterMessage((*VxlanAddDelTunnel)(nil), "vxlan.VxlanAddDelTunnel") - api.RegisterMessage((*VxlanAddDelTunnelReply)(nil), "vxlan.VxlanAddDelTunnelReply") - api.RegisterMessage((*VxlanOffloadRx)(nil), "vxlan.VxlanOffloadRx") - api.RegisterMessage((*VxlanOffloadRxReply)(nil), "vxlan.VxlanOffloadRxReply") - api.RegisterMessage((*VxlanTunnelDetails)(nil), "vxlan.VxlanTunnelDetails") - api.RegisterMessage((*VxlanTunnelDump)(nil), "vxlan.VxlanTunnelDump") -} - -var Messages = []api.Message{ - (*SwInterfaceSetVxlanBypass)(nil), - (*SwInterfaceSetVxlanBypassReply)(nil), - (*VxlanAddDelTunnel)(nil), - (*VxlanAddDelTunnelReply)(nil), - (*VxlanOffloadRx)(nil), - (*VxlanOffloadRxReply)(nil), - (*VxlanTunnelDetails)(nil), - (*VxlanTunnelDump)(nil), -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/descriptor/interface.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/descriptor/interface.go index 9bfcbef549..015c3f6490 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/descriptor/interface.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/descriptor/interface.go @@ -369,7 +369,12 @@ func (d *InterfaceDescriptor) Validate(key string, intf *interfaces.Interface) e return kvs.NewInvalidValueError(ErrInterfaceNameTooLong, "name") } - // validate link with type + // validate interface type defined + if intf.Type == interfaces.Interface_UNDEFINED_TYPE { + return kvs.NewInvalidValueError(ErrInterfaceWithoutType, "type") + } + + // validate link with interface type linkMismatchErr := kvs.NewInvalidValueError(ErrInterfaceLinkMismatch, "link") switch intf.Link.(type) { case *interfaces.Interface_Sub: @@ -392,6 +397,23 @@ func (d *InterfaceDescriptor) Validate(key string, intf *interfaces.Interface) e if intf.Type != interfaces.Interface_TAP { return linkMismatchErr } + case *interfaces.Interface_Bond: + if intf.Type != interfaces.Interface_BOND_INTERFACE { + return linkMismatchErr + } + case *interfaces.Interface_VmxNet3: + if intf.Type != interfaces.Interface_VMXNET3_INTERFACE { + return linkMismatchErr + } + case *interfaces.Interface_Ipsec: + if intf.Type != interfaces.Interface_IPSEC_TUNNEL { + return linkMismatchErr + } + case nil: + if intf.Type != interfaces.Interface_SOFTWARE_LOOPBACK && + intf.Type != interfaces.Interface_DPDK { + return errors.Errorf("VPP interface type %s must have link defined", intf.Type) + } } // validate type specific @@ -415,8 +437,6 @@ func (d *InterfaceDescriptor) Validate(key string, intf *interfaces.Interface) e if name, ok := d.bondIDs[intf.GetBond().GetId()]; ok && name != intf.GetName() { return kvs.NewInvalidValueError(ErrBondInterfaceIDExists, "link.bond.id") } - case interfaces.Interface_UNDEFINED_TYPE: - return kvs.NewInvalidValueError(ErrInterfaceWithoutType, "type") } // validate unnumbered @@ -688,21 +708,17 @@ func (d *InterfaceDescriptor) getMemifRingSize(memif *interfaces.MemifLink) uint } // getTapConfig returns the TAP-specific configuration section (handling undefined attributes). -func getTapConfig(intf *interfaces.Interface) *interfaces.TapLink { - tapCfg := &interfaces.TapLink{ - Version: intf.GetTap().GetVersion(), - HostIfName: intf.GetTap().GetHostIfName(), - ToMicroservice: intf.GetTap().GetToMicroservice(), - RxRingSize: intf.GetTap().GetRxRingSize(), - TxRingSize: intf.GetTap().GetTxRingSize(), - } - if tapCfg.Version == 0 { - tapCfg.Version = 1 +func getTapConfig(intf *interfaces.Interface) (tapLink *interfaces.TapLink) { + tapLink = new(interfaces.TapLink) + proto.Merge(tapLink, intf.GetTap()) + + if tapLink.Version == 0 { + tapLink.Version = 1 } - if tapCfg.HostIfName == "" { - tapCfg.HostIfName = generateTAPHostName(intf.Name) + if tapLink.HostIfName == "" { + tapLink.HostIfName = generateTAPHostName(intf.Name) } - return tapCfg + return tapLink } // generateTAPHostName (deterministically) generates the host name for a TAP interface. diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifplugin.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifplugin.go index 2240fa3342..1e0193a3b4 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifplugin.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifplugin.go @@ -42,7 +42,6 @@ import ( "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifaceidx" "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls" - _ "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810" _ "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1901" _ "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1904" ) diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/admin_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/admin_vppcalls.go deleted file mode 100644 index 11f6d2108e..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/admin_vppcalls.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces" -) - -// InterfaceAdminDown implements interface handler. -func (h *InterfaceVppHandler) InterfaceAdminDown(ifIdx uint32) error { - return h.interfaceSetFlags(ifIdx, false) -} - -// InterfaceAdminUp implements interface handler. -func (h *InterfaceVppHandler) InterfaceAdminUp(ifIdx uint32) error { - return h.interfaceSetFlags(ifIdx, true) -} - -// SetInterfaceTag implements interface handler. -func (h *InterfaceVppHandler) SetInterfaceTag(tag string, ifIdx uint32) error { - return h.handleInterfaceTag(tag, ifIdx, true) -} - -// RemoveInterfaceTag implements interface handler. -func (h *InterfaceVppHandler) RemoveInterfaceTag(tag string, ifIdx uint32) error { - return h.handleInterfaceTag(tag, ifIdx, false) -} - -func (h *InterfaceVppHandler) interfaceSetFlags(ifIdx uint32, adminUp bool) error { - req := &interfaces.SwInterfaceSetFlags{ - SwIfIndex: ifIdx, - AdminUpDown: boolToUint(adminUp), - } - reply := &interfaces.SwInterfaceSetFlagsReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -func (h *InterfaceVppHandler) handleInterfaceTag(tag string, ifIdx uint32, isAdd bool) error { - req := &interfaces.SwInterfaceTagAddDel{ - Tag: []byte(tag), - IsAdd: boolToUint(isAdd), - } - // For some reason, if deleting tag, the software interface index has to be 0 and only name should be set. - // Otherwise reply returns with error core -2 (incorrect sw_if_idx) - if isAdd { - req.SwIfIndex = ifIdx - } - reply := &interfaces.SwInterfaceTagAddDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -func boolToUint(input bool) uint8 { - if input { - return 1 - } - return 0 -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/afpacket_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/afpacket_vppcalls.go deleted file mode 100644 index ed259aedea..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/afpacket_vppcalls.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "net" - - interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/af_packet" -) - -// AddAfPacketInterface implements AfPacket handler. -func (h *InterfaceVppHandler) AddAfPacketInterface(ifName string, hwAddr string, afPacketIntf *interfaces.AfpacketLink) (swIndex uint32, err error) { - req := &af_packet.AfPacketCreate{ - HostIfName: []byte(afPacketIntf.HostIfName), - } - if hwAddr == "" { - req.UseRandomHwAddr = 1 - } else { - mac, err := net.ParseMAC(hwAddr) - if err != nil { - return 0, err - } - req.HwAddr = mac - } - reply := &af_packet.AfPacketCreateReply{} - - if err = h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return 0, err - } - - return reply.SwIfIndex, h.SetInterfaceTag(ifName, reply.SwIfIndex) -} - -// DeleteAfPacketInterface implements AfPacket handler. -func (h *InterfaceVppHandler) DeleteAfPacketInterface(ifName string, idx uint32, afPacketIntf *interfaces.AfpacketLink) error { - req := &af_packet.AfPacketDelete{ - HostIfName: []byte(afPacketIntf.HostIfName), - } - reply := &af_packet.AfPacketDeleteReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return h.RemoveInterfaceTag(ifName, idx) -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/bond_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/bond_vppcalls.go deleted file mode 100644 index b541a54468..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/bond_vppcalls.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) 2019 PANTHEON.tech -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "net" - - if_model "github.com/ligato/vpp-agent/api/models/vpp/interfaces" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/bond" -) - -// AddBondInterface implements interface handler. -func (h *InterfaceVppHandler) AddBondInterface(ifName string, mac string, bondLink *if_model.BondLink) (uint32, error) { - req := &bond.BondCreate{ - Mode: getBondMode(bondLink.Mode), - Lb: getLoadBalance(bondLink.Lb), - } - if mac != "" { - parsedMac, err := net.ParseMAC(mac) - if err != nil { - return 0, err - } - req.UseCustomMac = 1 - req.MacAddress = parsedMac - } - - reply := &bond.BondCreateReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return 0, err - } - - return reply.SwIfIndex, h.SetInterfaceTag(ifName, reply.SwIfIndex) -} - -// DeleteBondInterface implements interface handler. -func (h *InterfaceVppHandler) DeleteBondInterface(ifName string, ifIdx uint32) error { - req := &bond.BondDelete{ - SwIfIndex: ifIdx, - } - reply := &bond.BondDeleteReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return h.RemoveInterfaceTag(ifName, ifIdx) -} - -func getBondMode(mode if_model.BondLink_Mode) uint8 { - switch mode { - case if_model.BondLink_ROUND_ROBIN: - return 1 - case if_model.BondLink_ACTIVE_BACKUP: - return 2 - case if_model.BondLink_XOR: - return 3 - case if_model.BondLink_BROADCAST: - return 4 - case if_model.BondLink_LACP: - return 5 - default: - // UNKNOWN - return 0 - } -} - -// AttachInterfaceToBond implements interface handler. -func (h *InterfaceVppHandler) AttachInterfaceToBond(ifIdx, bondIfIdx uint32, isPassive, isLongTimeout bool) error { - req := &bond.BondEnslave{ - SwIfIndex: ifIdx, - BondSwIfIndex: bondIfIdx, - IsPassive: boolToUint(isPassive), - IsLongTimeout: boolToUint(isLongTimeout), - } - reply := &bond.BondEnslaveReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// DetachInterfaceFromBond implements interface handler -func (h *InterfaceVppHandler) DetachInterfaceFromBond(ifIdx uint32) error { - req := &bond.BondDetachSlave{ - SwIfIndex: ifIdx, - } - reply := &bond.BondDetachSlaveReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - return nil -} - -func getLoadBalance(lb if_model.BondLink_LoadBalance) uint8 { - switch lb { - case if_model.BondLink_L34: - return 1 - case if_model.BondLink_L23: - return 2 - default: - // L2 - return 0 - } -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/dhcp_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/dhcp_vppcalls.go deleted file mode 100644 index 91e565c4d0..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/dhcp_vppcalls.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/dhcp" -) - -func (h *InterfaceVppHandler) handleInterfaceDHCP(ifIdx uint32, hostName string, isAdd bool) error { - req := &dhcp.DHCPClientConfig{ - IsAdd: boolToUint(isAdd), - Client: dhcp.DHCPClient{ - SwIfIndex: ifIdx, - Hostname: []byte(hostName), - WantDHCPEvent: 1, - }, - } - reply := &dhcp.DHCPClientConfigReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// SetInterfaceAsDHCPClient implements interface handler. -func (h *InterfaceVppHandler) SetInterfaceAsDHCPClient(ifIdx uint32, hostName string) error { - return h.handleInterfaceDHCP(ifIdx, hostName, true) -} - -// UnsetInterfaceAsDHCPClient implements interface handler. -func (h *InterfaceVppHandler) UnsetInterfaceAsDHCPClient(ifIdx uint32, hostName string) error { - return h.handleInterfaceDHCP(ifIdx, hostName, false) -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/doc.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/doc.go deleted file mode 100644 index 0036e1104f..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package vppcalls contains wrappers over VPP binary APIs for all supported -// interface types and for dumping all interfaces configured in VPP. -package vpp1810 diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/dump_interface_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/dump_interface_vppcalls.go deleted file mode 100644 index bf623452c4..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/dump_interface_vppcalls.go +++ /dev/null @@ -1,927 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "bytes" - "encoding/hex" - "fmt" - "net" - "strings" - - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/bond" - "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls" - - interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" - "github.com/ligato/vpp-agent/api/models/vpp/ipsec" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/dhcp" - binapi_interface "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ipsec" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/memif" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/tap" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/tapv2" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vmxnet3" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vxlan" -) - -// Default VPP MTU value -const defaultVPPMtu = 9216 - -func getMtu(vppMtu uint16) uint32 { - // If default VPP MTU value is set, return 0 (it means MTU was not set in the NB config) - if vppMtu == defaultVPPMtu { - return 0 - } - return uint32(vppMtu) -} - -// DumpInterfacesByType implements interface handler. -func (h *InterfaceVppHandler) DumpInterfacesByType(reqType interfaces.Interface_Type) (map[uint32]*InterfaceDetails, error) { - // Dump all - ifs, err := h.DumpInterfaces() - if err != nil { - return nil, err - } - // Filter by type - for ifIdx, ifData := range ifs { - if ifData.Interface.Type != reqType { - delete(ifs, ifIdx) - } - } - - return ifs, nil -} - -func (h *InterfaceVppHandler) dumpInterfaces() (map[uint32]*InterfaceDetails, error) { - // map for the resulting interfaces - ifs := make(map[uint32]*InterfaceDetails) - - // First, dump all interfaces to create initial data. - reqCtx := h.callsChannel.SendMultiRequest(&binapi_interface.SwInterfaceDump{}) - for { - ifDetails := &binapi_interface.SwInterfaceDetails{} - stop, err := reqCtx.ReceiveReply(ifDetails) - if stop { - break // Break from the loop. - } - if err != nil { - return nil, fmt.Errorf("failed to dump interface: %v", err) - } - - ifaceName := cleanString(ifDetails.InterfaceName) - l2addr := net.HardwareAddr(ifDetails.L2Address[:ifDetails.L2AddressLength]) - - details := &InterfaceDetails{ - Interface: &interfaces.Interface{ - Name: cleanString(ifDetails.Tag), - Type: guessInterfaceType(ifaceName), // the type may be amended later by further dumps - Enabled: ifDetails.AdminUpDown > 0, - PhysAddress: l2addr.String(), - Mtu: getMtu(ifDetails.LinkMtu), - }, - Meta: &InterfaceMeta{ - SwIfIndex: ifDetails.SwIfIndex, - SupSwIfIndex: ifDetails.SupSwIfIndex, - L2Address: l2addr, - InternalName: ifaceName, - AdminState: ifDetails.AdminUpDown, - LinkState: ifDetails.LinkUpDown, - LinkDuplex: ifDetails.LinkDuplex, - LinkMTU: ifDetails.LinkMtu, - LinkSpeed: uint32(ifDetails.LinkSpeed), - SubID: ifDetails.SubID, - Tag: cleanString(ifDetails.Tag), - }, - } - - // sub interface - if ifDetails.SupSwIfIndex != ifDetails.SwIfIndex { - details.Interface.Type = interfaces.Interface_SUB_INTERFACE - details.Interface.Link = &interfaces.Interface_Sub{ - Sub: &interfaces.SubInterface{ - ParentName: ifs[ifDetails.SupSwIfIndex].Interface.Name, - SubId: ifDetails.SubID, - TagRwOption: getTagRwOption(ifDetails.VtrOp), - PushDot1Q: uintToBool(uint8(ifDetails.VtrPushDot1q)), - Tag1: ifDetails.VtrTag1, - Tag2: ifDetails.VtrTag2, - }, - } - } - // Fill name for physical interfaces (they are mostly without tag) - switch details.Interface.Type { - case interfaces.Interface_DPDK: - details.Interface.Name = ifaceName - case interfaces.Interface_AF_PACKET: - details.Interface.Link = &interfaces.Interface_Afpacket{ - Afpacket: &interfaces.AfpacketLink{ - HostIfName: strings.TrimPrefix(ifaceName, "host-"), - }, - } - } - ifs[ifDetails.SwIfIndex] = details - } - - return ifs, nil -} - -// DumpInterfaces implements interface handler. -func (h *InterfaceVppHandler) DumpInterfaces() (map[uint32]*InterfaceDetails, error) { - ifs, err := h.dumpInterfaces() - if err != nil { - return nil, err - } - - // Get DHCP clients - dhcpClients, err := h.DumpDhcpClients() - if err != nil { - return nil, fmt.Errorf("failed to dump interface DHCP clients: %v", err) - } - - // Get IP addresses before VRF - err = h.dumpIPAddressDetails(ifs, false, dhcpClients) - if err != nil { - return nil, err - } - err = h.dumpIPAddressDetails(ifs, true, dhcpClients) - if err != nil { - return nil, err - } - - // Get unnumbered interfaces - unnumbered, err := h.dumpUnnumberedDetails() - if err != nil { - return nil, fmt.Errorf("failed to dump unnumbered interfaces: %v", err) - } - - // dump VXLAN details before VRFs (used by isIpv6Interface) - err = h.dumpVxlanDetails(ifs) - if err != nil { - return nil, err - } - - // Get interface VRF for every IP family, fill DHCP if set and resolve unnumbered interface setup - for _, ifData := range ifs { - // VRF is stored in metadata for both, IPv4 and IPv6. If the interface is an IPv6 interface (it contains at least - // one IPv6 address), appropriate VRF is stored also in modelled data - ipv4Vrf, err := h.GetInterfaceVrf(ifData.Meta.SwIfIndex) - if err != nil { - return nil, fmt.Errorf("interface dump: failed to get IPv4 VRF from interface %d: %v", - ifData.Meta.SwIfIndex, err) - } - ifData.Meta.VrfIPv4 = ipv4Vrf - ipv6Vrf, err := h.GetInterfaceVrfIPv6(ifData.Meta.SwIfIndex) - if err != nil { - return nil, fmt.Errorf("interface dump: failed to get IPv6 VRF from interface %d: %v", - ifData.Meta.SwIfIndex, err) - } - ifData.Meta.VrfIPv6 = ipv6Vrf - if isIPv6If, err := h.isIpv6Interface(ifData.Interface); err != nil { - return ifs, err - } else if isIPv6If { - ifData.Interface.Vrf = ipv6Vrf - } else { - ifData.Interface.Vrf = ipv4Vrf - } - - // DHCP - dhcpData, ok := dhcpClients[ifData.Meta.SwIfIndex] - if ok { - ifData.Interface.SetDhcpClient = true - ifData.Meta.Dhcp = dhcpData - } - // Unnumbered - ifWithIPIdx, ok := unnumbered[ifData.Meta.SwIfIndex] - if ok { - // Find unnumbered interface - var ifWithIPName string - ifWithIP, ok := ifs[ifWithIPIdx] - if ok { - ifWithIPName = ifWithIP.Interface.Name - } else { - h.log.Debugf("cannot find name of the ip-interface for unnumbered %s", ifData.Interface.Name) - ifWithIPName = "" - } - ifData.Interface.Unnumbered = &interfaces.Interface_Unnumbered{ - InterfaceWithIp: ifWithIPName, - } - } - } - - err = h.dumpMemifDetails(ifs) - if err != nil { - return nil, err - } - - err = h.dumpTapDetails(ifs) - if err != nil { - return nil, err - } - - err = h.dumpIPSecTunnelDetails(ifs) - if err != nil { - return nil, err - } - - err = h.dumpVmxNet3Details(ifs) - if err != nil { - return nil, err - } - - err = h.dumpBondDetails(ifs) - if err != nil { - return nil, err - } - - // Rx-placement dump is last since it uses interface type-specific data - err = h.dumpRxPlacement(ifs) - if err != nil { - return nil, err - } - - return ifs, nil -} - -// DumpMemifSocketDetails implements interface handler. -func (h *InterfaceVppHandler) DumpMemifSocketDetails() (map[string]uint32, error) { - memifSocketMap := make(map[string]uint32) - - reqCtx := h.callsChannel.SendMultiRequest(&memif.MemifSocketFilenameDump{}) - for { - socketDetails := &memif.MemifSocketFilenameDetails{} - stop, err := reqCtx.ReceiveReply(socketDetails) - if stop { - break // Break from the loop. - } - if err != nil { - return memifSocketMap, fmt.Errorf("failed to dump memif socket filename details: %v", err) - } - - filename := string(bytes.SplitN(socketDetails.SocketFilename, []byte{0x00}, 2)[0]) - memifSocketMap[filename] = socketDetails.SocketID - } - - h.log.Debugf("Memif socket dump completed, found %d entries: %v", len(memifSocketMap), memifSocketMap) - - return memifSocketMap, nil -} - -// DumpDhcpClients returns a slice of DhcpMeta with all interfaces and other DHCP-related information available -func (h *InterfaceVppHandler) DumpDhcpClients() (map[uint32]*Dhcp, error) { - dhcpData := make(map[uint32]*Dhcp) - reqCtx := h.callsChannel.SendMultiRequest(&dhcp.DHCPClientDump{}) - - for { - dhcpDetails := &dhcp.DHCPClientDetails{} - last, err := reqCtx.ReceiveReply(dhcpDetails) - if last { - break - } - if err != nil { - return nil, err - } - client := dhcpDetails.Client - lease := dhcpDetails.Lease - - var hostMac net.HardwareAddr = lease.HostMac - var hostAddr, routerAddr string - if uintToBool(lease.IsIPv6) { - hostAddr = fmt.Sprintf("%s/%d", net.IP(lease.HostAddress).To16().String(), uint32(lease.MaskWidth)) - routerAddr = fmt.Sprintf("%s/%d", net.IP(lease.RouterAddress).To16().String(), uint32(lease.MaskWidth)) - } else { - hostAddr = fmt.Sprintf("%s/%d", net.IP(lease.HostAddress[:4]).To4().String(), uint32(lease.MaskWidth)) - routerAddr = fmt.Sprintf("%s/%d", net.IP(lease.RouterAddress[:4]).To4().String(), uint32(lease.MaskWidth)) - } - - // DHCP client data - dhcpClient := &Client{ - SwIfIndex: client.SwIfIndex, - Hostname: string(bytes.SplitN(client.Hostname, []byte{0x00}, 2)[0]), - ID: string(bytes.SplitN(client.ID, []byte{0x00}, 2)[0]), - WantDhcpEvent: uintToBool(client.WantDHCPEvent), - SetBroadcastFlag: uintToBool(client.SetBroadcastFlag), - PID: client.PID, - } - - // DHCP lease data - dhcpLease := &Lease{ - SwIfIndex: lease.SwIfIndex, - State: lease.State, - Hostname: string(bytes.SplitN(lease.Hostname, []byte{0x00}, 2)[0]), - IsIPv6: uintToBool(lease.IsIPv6), - HostAddress: hostAddr, - RouterAddress: routerAddr, - HostMac: hostMac.String(), - } - - // DHCP metadata - dhcpData[client.SwIfIndex] = &Dhcp{ - Client: dhcpClient, - Lease: dhcpLease, - } - } - - return dhcpData, nil -} - -// Returns true if given interface contains at least one IPv6 address. For VxLAN, source and destination -// addresses are also checked -func (h *InterfaceVppHandler) isIpv6Interface(iface *interfaces.Interface) (bool, error) { - if iface.Type == interfaces.Interface_VXLAN_TUNNEL && iface.GetVxlan() != nil { - if ipAddress := net.ParseIP(iface.GetVxlan().SrcAddress); ipAddress.To4() == nil { - return true, nil - } - if ipAddress := net.ParseIP(iface.GetVxlan().DstAddress); ipAddress.To4() == nil { - return true, nil - } - } - for _, ifAddress := range iface.IpAddresses { - if ipAddress, _, err := net.ParseCIDR(ifAddress); err != nil { - return false, err - } else if ipAddress.To4() == nil { - return true, nil - } - } - return false, nil -} - -// dumpIPAddressDetails dumps IP address details of interfaces from VPP and fills them into the provided interface map. -func (h *InterfaceVppHandler) dumpIPAddressDetails(ifs map[uint32]*InterfaceDetails, isIPv6 bool, dhcpClients map[uint32]*Dhcp) error { - // Dump IP addresses of each interface. - for idx := range ifs { - reqCtx := h.callsChannel.SendMultiRequest(&ip.IPAddressDump{ - SwIfIndex: idx, - IsIPv6: boolToUint(isIPv6), - }) - for { - ipDetails := &ip.IPAddressDetails{} - stop, err := reqCtx.ReceiveReply(ipDetails) - if stop { - break // Break from the loop. - } - if err != nil { - return fmt.Errorf("failed to dump interface %d IP address details: %v", idx, err) - } - h.processIPDetails(ifs, ipDetails, dhcpClients) - } - } - - return nil -} - -// processIPDetails processes ip.IPAddressDetails binary API message and fills the details into the provided interface map. -func (h *InterfaceVppHandler) processIPDetails(ifs map[uint32]*InterfaceDetails, ipDetails *ip.IPAddressDetails, dhcpClients map[uint32]*Dhcp) { - ifDetails, ifIdxExists := ifs[ipDetails.SwIfIndex] - if !ifIdxExists { - return - } - - var ipAddr string - if ipDetails.IsIPv6 == 1 { - ipAddr = fmt.Sprintf("%s/%d", net.IP(ipDetails.IP).To16().String(), uint32(ipDetails.PrefixLength)) - } else { - ipAddr = fmt.Sprintf("%s/%d", net.IP(ipDetails.IP[:4]).To4().String(), uint32(ipDetails.PrefixLength)) - } - - // skip IP addresses given by DHCP - if dhcpClient, hasDhcpClient := dhcpClients[ipDetails.SwIfIndex]; hasDhcpClient { - if dhcpClient.Lease != nil && dhcpClient.Lease.HostAddress == ipAddr { - return - } - } - - ifDetails.Interface.IpAddresses = append(ifDetails.Interface.IpAddresses, ipAddr) -} - -// dumpMemifDetails dumps memif interface details from VPP and fills them into the provided interface map. -func (h *InterfaceVppHandler) dumpMemifDetails(ifs map[uint32]*InterfaceDetails) error { - // Dump all memif sockets - memifSocketMap, err := h.DumpMemifSocketDetails() - if err != nil { - return err - } - - reqCtx := h.callsChannel.SendMultiRequest(&memif.MemifDump{}) - for { - memifDetails := &memif.MemifDetails{} - stop, err := reqCtx.ReceiveReply(memifDetails) - if stop { - break // Break from the loop. - } - if err != nil { - return fmt.Errorf("failed to dump memif interface: %v", err) - } - _, ifIdxExists := ifs[memifDetails.SwIfIndex] - if !ifIdxExists { - continue - } - ifs[memifDetails.SwIfIndex].Interface.Link = &interfaces.Interface_Memif{ - Memif: &interfaces.MemifLink{ - Master: memifDetails.Role == 0, - Mode: memifModetoNB(memifDetails.Mode), - Id: memifDetails.ID, - //Secret: // TODO: Secret - not available in the binary API - SocketFilename: func(socketMap map[string]uint32) (filename string) { - for filename, id := range socketMap { - if memifDetails.SocketID == id { - return filename - } - } - // Socket for configured memif should exist - h.log.Warnf("Socket ID not found for memif %v", memifDetails.SwIfIndex) - return - }(memifSocketMap), - RingSize: memifDetails.RingSize, - BufferSize: uint32(memifDetails.BufferSize), - // TODO: RxQueues, TxQueues - not available in the binary API - //RxQueues: - //TxQueues: - }, - } - ifs[memifDetails.SwIfIndex].Interface.Type = interfaces.Interface_MEMIF - } - - return nil -} - -// dumpTapDetails dumps tap interface details from VPP and fills them into the provided interface map. -func (h *InterfaceVppHandler) dumpTapDetails(ifs map[uint32]*InterfaceDetails) error { - // Original TAP. - reqCtx := h.callsChannel.SendMultiRequest(&tap.SwInterfaceTapDump{}) - for { - tapDetails := &tap.SwInterfaceTapDetails{} - stop, err := reqCtx.ReceiveReply(tapDetails) - if stop { - break // Break from the loop. - } - if err != nil { - return fmt.Errorf("failed to dump TAP interface details: %v", err) - } - _, ifIdxExists := ifs[tapDetails.SwIfIndex] - if !ifIdxExists { - continue - } - ifs[tapDetails.SwIfIndex].Interface.Link = &interfaces.Interface_Tap{ - Tap: &interfaces.TapLink{ - Version: 1, - HostIfName: string(bytes.SplitN(tapDetails.DevName, []byte{0x00}, 2)[0]), - }, - } - ifs[tapDetails.SwIfIndex].Interface.Type = interfaces.Interface_TAP - } - - // TAP v.2 - reqCtx = h.callsChannel.SendMultiRequest(&tapv2.SwInterfaceTapV2Dump{}) - for { - tapDetails := &tapv2.SwInterfaceTapV2Details{} - stop, err := reqCtx.ReceiveReply(tapDetails) - if stop { - break // Break from the loop. - } - if err != nil { - return fmt.Errorf("failed to dump TAPv2 interface details: %v", err) - } - _, ifIdxExists := ifs[tapDetails.SwIfIndex] - if !ifIdxExists { - continue - } - ifs[tapDetails.SwIfIndex].Interface.Link = &interfaces.Interface_Tap{ - Tap: &interfaces.TapLink{ - Version: 2, - HostIfName: string(bytes.SplitN(tapDetails.HostIfName, []byte{0x00}, 2)[0]), - // Other parameters are not not yet part of the dump. - }, - } - ifs[tapDetails.SwIfIndex].Interface.Type = interfaces.Interface_TAP - } - - return nil -} - -// dumpVxlanDetails dumps VXLAN interface details from VPP and fills them into the provided interface map. -func (h *InterfaceVppHandler) dumpVxlanDetails(ifs map[uint32]*InterfaceDetails) error { - reqCtx := h.callsChannel.SendMultiRequest(&vxlan.VxlanTunnelDump{SwIfIndex: ^uint32(0)}) - for { - vxlanDetails := &vxlan.VxlanTunnelDetails{} - stop, err := reqCtx.ReceiveReply(vxlanDetails) - if stop { - break // Break from the loop. - } - if err != nil { - return fmt.Errorf("failed to dump VxLAN tunnel interface details: %v", err) - } - _, ifIdxExists := ifs[vxlanDetails.SwIfIndex] - if !ifIdxExists { - continue - } - // Multicast interface - var multicastIfName string - _, exists := ifs[vxlanDetails.McastSwIfIndex] - if exists { - multicastIfName = ifs[vxlanDetails.McastSwIfIndex].Interface.Name - } - - if vxlanDetails.IsIPv6 == 1 { - ifs[vxlanDetails.SwIfIndex].Interface.Link = &interfaces.Interface_Vxlan{ - Vxlan: &interfaces.VxlanLink{ - Multicast: multicastIfName, - SrcAddress: net.IP(vxlanDetails.SrcAddress).To16().String(), - DstAddress: net.IP(vxlanDetails.DstAddress).To16().String(), - Vni: vxlanDetails.Vni, - }, - } - } else { - ifs[vxlanDetails.SwIfIndex].Interface.Link = &interfaces.Interface_Vxlan{ - Vxlan: &interfaces.VxlanLink{ - Multicast: multicastIfName, - SrcAddress: net.IP(vxlanDetails.SrcAddress[:4]).To4().String(), - DstAddress: net.IP(vxlanDetails.DstAddress[:4]).To4().String(), - Vni: vxlanDetails.Vni, - }, - } - } - ifs[vxlanDetails.SwIfIndex].Interface.Type = interfaces.Interface_VXLAN_TUNNEL - } - - return nil -} - -func verifyIPSecTunnelDetails(local, remote *ipsec.IpsecSaDetails) error { - if local.SwIfIndex != remote.SwIfIndex { - return fmt.Errorf("swIfIndex data mismatch (local: %v, remote: %v)", - local.SwIfIndex, remote.SwIfIndex) - } - if local.IsTunnel != remote.IsTunnel { - return fmt.Errorf("tunnel data mismatch (local: %v, remote: %v)", - local.IsTunnel, remote.IsTunnel) - } - - if local.IsTunnelIP6 != remote.IsTunnelIP6 || - !bytes.Equal(local.TunnelSrcAddr, remote.TunnelDstAddr) || - !bytes.Equal(local.TunnelDstAddr, remote.TunnelSrcAddr) { - return fmt.Errorf("src/dst IP mismatch (local: ipv6=%v src=%v dst=%v, remote: ipv6=%v src=%v dst=%v)", - local.IsTunnelIP6, local.TunnelSrcAddr, local.TunnelDstAddr, remote.IsTunnelIP6, remote.TunnelSrcAddr, remote.TunnelDstAddr) - } - - return nil -} - -// dumpIPSecTunnelDetails dumps IPSec tunnel interfaces from the VPP and fills them into the provided interface map. -func (h *InterfaceVppHandler) dumpIPSecTunnelDetails(ifs map[uint32]*InterfaceDetails) error { - // tunnel interfaces are a part of security association dump - var tunnels []*ipsec.IpsecSaDetails - req := &ipsec.IpsecSaDump{ - SaID: ^uint32(0), - } - requestCtx := h.callsChannel.SendMultiRequest(req) - - for { - saDetails := &ipsec.IpsecSaDetails{} - stop, err := requestCtx.ReceiveReply(saDetails) - if stop { - break - } - if err != nil { - return err - } - // skip non-tunnel security associations - if saDetails.SwIfIndex != ^uint32(0) { - tunnels = append(tunnels, saDetails) - } - } - - // every tunnel interface is returned in two API calls. To reconstruct the correct proto-modelled data, - // first appearance is cached, and when the second part arrives, data are completed and stored. - tunnelParts := make(map[uint32]*ipsec.IpsecSaDetails) - - for _, tunnel := range tunnels { - // first appearance is stored in the map, the second one is used in configuration. - firstSaData, ok := tunnelParts[tunnel.SwIfIndex] - if !ok { - tunnelParts[tunnel.SwIfIndex] = tunnel - continue - } - - local := firstSaData - remote := tunnel - - // verify data for local & remote - if err := verifyIPSecTunnelDetails(local, remote); err != nil { - h.log.Warnf("IPSec SA dump for tunnel interface data does not match: %v", err) - continue - } - - var localIP, remoteIP string - if uintToBool(tunnel.IsTunnelIP6) { - localIP = net.IP(local.TunnelSrcAddr).String() - remoteIP = net.IP(remote.TunnelSrcAddr).String() - } else { - localIP = net.IP(local.TunnelSrcAddr[:4]).String() - remoteIP = net.IP(remote.TunnelSrcAddr[:4]).String() - } - - ifDetails, ok := ifs[tunnel.SwIfIndex] - if !ok { - h.log.Warnf("ipsec SA dump returned unrecognized swIfIndex: %v", tunnel.SwIfIndex) - continue - } - ifDetails.Interface.Type = interfaces.Interface_IPSEC_TUNNEL - ifDetails.Interface.Link = &interfaces.Interface_Ipsec{ - Ipsec: &interfaces.IPSecLink{ - Esn: uintToBool(tunnel.UseEsn), - AntiReplay: uintToBool(tunnel.UseAntiReplay), - LocalIp: localIP, - RemoteIp: remoteIP, - LocalSpi: local.Spi, - RemoteSpi: remote.Spi, - CryptoAlg: vpp_ipsec.CryptoAlg(tunnel.CryptoAlg), - LocalCryptoKey: hex.EncodeToString(local.CryptoKey[:local.CryptoKeyLen]), - RemoteCryptoKey: hex.EncodeToString(remote.CryptoKey[:remote.CryptoKeyLen]), - IntegAlg: vpp_ipsec.IntegAlg(tunnel.IntegAlg), - LocalIntegKey: hex.EncodeToString(local.IntegKey[:local.IntegKeyLen]), - RemoteIntegKey: hex.EncodeToString(remote.IntegKey[:remote.IntegKeyLen]), - EnableUdpEncap: uintToBool(tunnel.UDPEncap), - }, - } - } - - return nil -} - -// dumpVmxNet3Details dumps VmxNet3 interface details from VPP and fills them into the provided interface map. -func (h *InterfaceVppHandler) dumpVmxNet3Details(ifs map[uint32]*InterfaceDetails) error { - reqCtx := h.callsChannel.SendMultiRequest(&vmxnet3.Vmxnet3Dump{}) - for { - vmxnet3Details := &vmxnet3.Vmxnet3Details{} - stop, err := reqCtx.ReceiveReply(vmxnet3Details) - if stop { - break // Break from the loop. - } - if err != nil { - return fmt.Errorf("failed to dump VmxNet3 tunnel interface details: %v", err) - } - _, ifIdxExists := ifs[vmxnet3Details.SwIfIndex] - if !ifIdxExists { - continue - } - ifs[vmxnet3Details.SwIfIndex].Interface.Link = &interfaces.Interface_VmxNet3{ - VmxNet3: &interfaces.VmxNet3Link{ - RxqSize: uint32(vmxnet3Details.RxQsize), - TxqSize: uint32(vmxnet3Details.TxQsize), - }, - } - ifs[vmxnet3Details.SwIfIndex].Interface.Type = interfaces.Interface_VMXNET3_INTERFACE - ifs[vmxnet3Details.SwIfIndex].Meta.Pci = vmxnet3Details.PciAddr - } - return nil -} - -// dumpBondDetails dumps bond interface details from VPP and fills them into the provided interface map. -func (h *InterfaceVppHandler) dumpBondDetails(ifs map[uint32]*vppcalls.InterfaceDetails) error { - bondIndexes := make([]uint32, 0) - reqCtx := h.callsChannel.SendMultiRequest(&bond.SwInterfaceBondDump{}) - for { - bondDetails := &bond.SwInterfaceBondDetails{} - stop, err := reqCtx.ReceiveReply(bondDetails) - if err != nil { - return fmt.Errorf("failed to dump bond interface details: %v", err) - } - if stop { - break - } - _, ifIdxExists := ifs[bondDetails.SwIfIndex] - if !ifIdxExists { - continue - } - ifs[bondDetails.SwIfIndex].Interface.Link = &interfaces.Interface_Bond{ - Bond: &interfaces.BondLink{ - Mode: getBondIfMode(bondDetails.Mode), - Lb: getBondLoadBalance(bondDetails.Lb), - }, - } - ifs[bondDetails.SwIfIndex].Interface.Type = interfaces.Interface_BOND_INTERFACE - bondIndexes = append(bondIndexes, bondDetails.SwIfIndex) - } - - // get slave interfaces for bonds - for _, bondIdx := range bondIndexes { - var bondSlaves []*interfaces.BondLink_BondedInterface - reqSlCtx := h.callsChannel.SendMultiRequest(&bond.SwInterfaceSlaveDump{SwIfIndex: bondIdx}) - for { - slaveDetails := &bond.SwInterfaceSlaveDetails{} - stop, err := reqSlCtx.ReceiveReply(slaveDetails) - if err != nil { - return fmt.Errorf("failed to dump bond slave details: %v", err) - } - if stop { - break - } - slaveIf, ifIdxExists := ifs[slaveDetails.SwIfIndex] - if !ifIdxExists { - continue - } - bondSlaves = append(bondSlaves, &interfaces.BondLink_BondedInterface{ - Name: slaveIf.Interface.Name, - IsPassive: uintToBool(slaveDetails.IsPassive), - IsLongTimeout: uintToBool(slaveDetails.IsLongTimeout), - }) - ifs[bondIdx].Interface.GetBond().BondedInterfaces = bondSlaves - } - } - - return nil -} - -// dumpUnnumberedDetails returns a map of unnumbered interface indexes, every with interface index of element with IP -func (h *InterfaceVppHandler) dumpUnnumberedDetails() (map[uint32]uint32, error) { - unIfMap := make(map[uint32]uint32) // unnumbered/ip-interface - reqCtx := h.callsChannel.SendMultiRequest(&ip.IPUnnumberedDump{ - SwIfIndex: ^uint32(0), - }) - - for { - unDetails := &ip.IPUnnumberedDetails{} - last, err := reqCtx.ReceiveReply(unDetails) - if last { - break - } - if err != nil { - return nil, err - } - - unIfMap[unDetails.SwIfIndex] = unDetails.IPSwIfIndex - } - - return unIfMap, nil -} - -func (h *InterfaceVppHandler) dumpRxPlacement(ifs map[uint32]*InterfaceDetails) error { - reqCtx := h.callsChannel.SendMultiRequest(&binapi_interface.SwInterfaceRxPlacementDump{ - SwIfIndex: ^uint32(0), - }) - for { - rxDetails := &binapi_interface.SwInterfaceRxPlacementDetails{} - stop, err := reqCtx.ReceiveReply(rxDetails) - if err != nil { - return fmt.Errorf("failed to dump rx-placement details: %v", err) - } - if stop { - break - } - ifData, ok := ifs[rxDetails.SwIfIndex] - if !ok { - h.log.Warnf("Received rx-placement data for unknown interface with index %d", rxDetails.SwIfIndex) - continue - } - ifData.Interface.RxModeSettings = &interfaces.Interface_RxModeSettings{ - RxMode: getRxModeType(rxDetails.Mode), - QueueId: rxDetails.QueueID, - } - ifData.Interface.RxPlacementSettings = &interfaces.Interface_RxPlacementSettings{ - Queue: rxDetails.QueueID, - Worker: rxDetails.WorkerID, - } - } - return nil -} - -// guessInterfaceType attempts to guess the correct interface type from its internal name (as given by VPP). -// This is required mainly for those interface types, that do not provide dump binary API, -// such as loopback of af_packet. -func guessInterfaceType(ifName string) interfaces.Interface_Type { - switch { - case strings.HasPrefix(ifName, "loop"), - strings.HasPrefix(ifName, "local"): - return interfaces.Interface_SOFTWARE_LOOPBACK - - case strings.HasPrefix(ifName, "memif"): - return interfaces.Interface_MEMIF - - case strings.HasPrefix(ifName, "tap"): - return interfaces.Interface_TAP - - case strings.HasPrefix(ifName, "host"): - return interfaces.Interface_AF_PACKET - - case strings.HasPrefix(ifName, "vxlan"): - return interfaces.Interface_VXLAN_TUNNEL - - case strings.HasPrefix(ifName, "ipsec"): - return interfaces.Interface_IPSEC_TUNNEL - - case strings.HasPrefix(ifName, "vmxnet3"): - return interfaces.Interface_VMXNET3_INTERFACE - - case strings.HasPrefix(ifName, "Bond"): - return interfaces.Interface_BOND_INTERFACE - - default: - return interfaces.Interface_DPDK - } -} - -// memifModetoNB converts binary API type of memif mode to the northbound API type memif mode. -func memifModetoNB(mode uint8) interfaces.MemifLink_MemifMode { - switch mode { - case 0: - return interfaces.MemifLink_ETHERNET - case 1: - return interfaces.MemifLink_IP - case 2: - return interfaces.MemifLink_PUNT_INJECT - default: - return interfaces.MemifLink_ETHERNET - } -} - -// Convert binary API rx-mode to northbound representation -func getRxModeType(mode uint8) interfaces.Interface_RxModeSettings_RxModeType { - switch mode { - case 1: - return interfaces.Interface_RxModeSettings_POLLING - case 2: - return interfaces.Interface_RxModeSettings_INTERRUPT - case 3: - return interfaces.Interface_RxModeSettings_ADAPTIVE - case 4: - return interfaces.Interface_RxModeSettings_DEFAULT - default: - return interfaces.Interface_RxModeSettings_UNKNOWN - } -} - -func getBondIfMode(mode uint8) interfaces.BondLink_Mode { - switch mode { - case 1: - return interfaces.BondLink_ROUND_ROBIN - case 2: - return interfaces.BondLink_ACTIVE_BACKUP - case 3: - return interfaces.BondLink_XOR - case 4: - return interfaces.BondLink_BROADCAST - case 5: - return interfaces.BondLink_LACP - default: - // UNKNOWN - return 0 - } -} - -func getBondLoadBalance(lb uint8) interfaces.BondLink_LoadBalance { - switch lb { - case 1: - return interfaces.BondLink_L34 - case 2: - return interfaces.BondLink_L23 - default: - return interfaces.BondLink_L2 - } -} - -func uintToBool(value uint8) bool { - if value == 0 { - return false - } - return true -} - -func cleanString(b []byte) string { - return string(bytes.SplitN(b, []byte{0x00}, 2)[0]) -} - -func getTagRwOption(op uint32) interfaces.SubInterface_TagRewriteOptions { - switch op { - case 1: - return interfaces.SubInterface_PUSH1 - case 2: - return interfaces.SubInterface_PUSH2 - case 3: - return interfaces.SubInterface_POP1 - case 4: - return interfaces.SubInterface_POP2 - case 5: - return interfaces.SubInterface_TRANSLATE11 - case 6: - return interfaces.SubInterface_TRANSLATE12 - case 7: - return interfaces.SubInterface_TRANSLATE21 - case 8: - return interfaces.SubInterface_TRANSLATE22 - default: // disabled - return interfaces.SubInterface_DISABLED - } -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/ip_container_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/ip_container_vppcalls.go deleted file mode 100644 index 2015c5c34b..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/ip_container_vppcalls.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "github.com/ligato/cn-infra/utils/addrs" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" -) - -const ( - addContainerIP uint8 = 1 - removeContainerIP uint8 = 0 -) - -func (h *InterfaceVppHandler) sendAndLogMessageForVpp(ifIdx uint32, addr string, isAdd uint8) error { - req := &ip.IPContainerProxyAddDel{ - SwIfIndex: ifIdx, - IsAdd: isAdd, - } - - IPaddr, isIPv6, err := addrs.ParseIPWithPrefix(addr) - if err != nil { - return err - } - - prefix, _ := IPaddr.Mask.Size() - req.Plen = byte(prefix) - if isIPv6 { - req.IP = []byte(IPaddr.IP.To16()) - req.IsIP4 = 0 - } else { - req.IP = []byte(IPaddr.IP.To4()) - req.IsIP4 = 1 - } - reply := &ip.IPContainerProxyAddDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// AddContainerIP implements interface handler. -func (h *InterfaceVppHandler) AddContainerIP(ifIdx uint32, addr string) error { - return h.sendAndLogMessageForVpp(ifIdx, addr, addContainerIP) -} - -// DelContainerIP implements interface handler. -func (h *InterfaceVppHandler) DelContainerIP(ifIdx uint32, addr string) error { - return h.sendAndLogMessageForVpp(ifIdx, addr, removeContainerIP) -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/ip_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/ip_vppcalls.go deleted file mode 100644 index 10feb5a911..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/ip_vppcalls.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "net" - - "github.com/ligato/cn-infra/utils/addrs" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces" -) - -const ( - addInterfaceIP uint8 = 1 - delInterfaceIP uint8 = 0 -) - -func (h *InterfaceVppHandler) addDelInterfaceIP(ifIdx uint32, addr *net.IPNet, isAdd uint8) error { - req := &interfaces.SwInterfaceAddDelAddress{ - SwIfIndex: ifIdx, - IsAdd: isAdd, - } - - prefix, _ := addr.Mask.Size() - req.AddressLength = byte(prefix) - - isIPv6, err := addrs.IsIPv6(addr.IP.String()) - if err != nil { - return err - } - if isIPv6 { - req.Address = []byte(addr.IP.To16()) - req.IsIPv6 = 1 - } else { - req.Address = []byte(addr.IP.To4()) - req.IsIPv6 = 0 - } - reply := &interfaces.SwInterfaceAddDelAddressReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// AddInterfaceIP implements interface handler. -func (h *InterfaceVppHandler) AddInterfaceIP(ifIdx uint32, addr *net.IPNet) error { - return h.addDelInterfaceIP(ifIdx, addr, addInterfaceIP) -} - -// DelInterfaceIP implements interface handler. -func (h *InterfaceVppHandler) DelInterfaceIP(ifIdx uint32, addr *net.IPNet) error { - return h.addDelInterfaceIP(ifIdx, addr, delInterfaceIP) -} - -const ( - setUnnumberedIP uint8 = 1 - unsetUnnumberedIP uint8 = 0 -) - -func (h *InterfaceVppHandler) setUnsetUnnumberedIP(uIfIdx uint32, ifIdxWithIP uint32, isAdd uint8) error { - // Prepare the message. - req := &interfaces.SwInterfaceSetUnnumbered{ - SwIfIndex: ifIdxWithIP, - UnnumberedSwIfIndex: uIfIdx, - IsAdd: isAdd, - } - reply := &interfaces.SwInterfaceSetUnnumberedReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// SetUnnumberedIP implements interface handler. -func (h *InterfaceVppHandler) SetUnnumberedIP(uIfIdx uint32, ifIdxWithIP uint32) error { - return h.setUnsetUnnumberedIP(uIfIdx, ifIdxWithIP, setUnnumberedIP) -} - -// UnsetUnnumberedIP implements interface handler. -func (h *InterfaceVppHandler) UnsetUnnumberedIP(uIfIdx uint32) error { - return h.setUnsetUnnumberedIP(uIfIdx, 0, unsetUnnumberedIP) -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/ipsec_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/ipsec_vppcalls.go deleted file mode 100644 index db74ed8a52..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/ipsec_vppcalls.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) 2018 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "encoding/hex" - "net" - - interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" - api "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ipsec" -) - -// AddIPSecTunnelInterface adds a new IPSec tunnel interface. -func (h *InterfaceVppHandler) AddIPSecTunnelInterface(ifName string, ipSecLink *interfaces.IPSecLink) (uint32, error) { - return h.tunnelIfAddDel(ifName, ipSecLink, true) -} - -// DeleteIPSecTunnelInterface removes existing IPSec tunnel interface. -func (h *InterfaceVppHandler) DeleteIPSecTunnelInterface(ifName string, ipSecLink *interfaces.IPSecLink) error { - // Note: ifIdx is not used now, tunnel should be matched based on parameters - _, err := h.tunnelIfAddDel(ifName, ipSecLink, false) - return err -} - -func (h *InterfaceVppHandler) tunnelIfAddDel(ifName string, ipSecLink *interfaces.IPSecLink, isAdd bool) (uint32, error) { - localCryptoKey, err := hex.DecodeString(ipSecLink.LocalCryptoKey) - if err != nil { - return 0, err - } - remoteCryptoKey, err := hex.DecodeString(ipSecLink.RemoteCryptoKey) - if err != nil { - return 0, err - } - localIntegKey, err := hex.DecodeString(ipSecLink.LocalIntegKey) - if err != nil { - return 0, err - } - remoteIntegKey, err := hex.DecodeString(ipSecLink.RemoteIntegKey) - if err != nil { - return 0, err - } - - req := &api.IpsecTunnelIfAddDel{ - IsAdd: boolToUint(isAdd), - Esn: boolToUint(ipSecLink.Esn), - AntiReplay: boolToUint(ipSecLink.AntiReplay), - LocalIP: net.ParseIP(ipSecLink.LocalIp).To4(), - RemoteIP: net.ParseIP(ipSecLink.RemoteIp).To4(), - LocalSpi: ipSecLink.LocalSpi, - RemoteSpi: ipSecLink.RemoteSpi, - CryptoAlg: uint8(ipSecLink.CryptoAlg), - LocalCryptoKey: localCryptoKey, - LocalCryptoKeyLen: uint8(len(localCryptoKey)), - RemoteCryptoKey: remoteCryptoKey, - RemoteCryptoKeyLen: uint8(len(remoteCryptoKey)), - IntegAlg: uint8(ipSecLink.IntegAlg), - LocalIntegKey: localIntegKey, - LocalIntegKeyLen: uint8(len(localIntegKey)), - RemoteIntegKey: remoteIntegKey, - RemoteIntegKeyLen: uint8(len(remoteIntegKey)), - UDPEncap: boolToUint(ipSecLink.EnableUdpEncap), - } - reply := &api.IpsecTunnelIfAddDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return 0, err - } - - return reply.SwIfIndex, nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/l2_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/l2_vppcalls.go deleted file mode 100644 index 8b1135bd05..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/l2_vppcalls.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2019 PANTHEON.tech -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "fmt" - - interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/l2" -) - -// TODO: more suitable for the l2 plugin, but the tag-rewrite retrieve is a part of the vpp interface api - -// SetInterfaceTagRewrite sets an interface tag rewrite -func (h *InterfaceVppHandler) SetVLanTagRewrite(ifIdx uint32, subIf *interfaces.SubInterface) error { - req := &l2.L2InterfaceVlanTagRewrite{ - SwIfIndex: ifIdx, - VtrOp: getTagRewriteOption(subIf.TagRwOption), - PushDot1q: uint32(boolToUint(subIf.PushDot1Q)), - Tag1: subIf.Tag1, - Tag2: subIf.Tag2, - } - reply := &l2.L2InterfaceVlanTagRewriteReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return fmt.Errorf("%s returned error: %v", reply.GetMessageName(), err) - } - - return nil -} - -func getTagRewriteOption(op interfaces.SubInterface_TagRewriteOptions) uint32 { - switch op { - case interfaces.SubInterface_PUSH1: - return 1 - case interfaces.SubInterface_PUSH2: - return 2 - case interfaces.SubInterface_POP1: - return 3 - case interfaces.SubInterface_POP2: - return 4 - case interfaces.SubInterface_TRANSLATE11: - return 5 - case interfaces.SubInterface_TRANSLATE12: - return 6 - case interfaces.SubInterface_TRANSLATE21: - return 7 - case interfaces.SubInterface_TRANSLATE22: - return 8 - default: // disabled - return 0 - } -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/loopback_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/loopback_vppcalls.go deleted file mode 100644 index aba35b86d4..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/loopback_vppcalls.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces" -) - -// AddLoopbackInterface implements interface handler. -func (h *InterfaceVppHandler) AddLoopbackInterface(ifName string) (swIndex uint32, err error) { - req := &interfaces.CreateLoopback{} - reply := &interfaces.CreateLoopbackReply{} - - if err = h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return 0, err - } - - return reply.SwIfIndex, h.SetInterfaceTag(ifName, reply.SwIfIndex) -} - -// DeleteLoopbackInterface implements interface handler. -func (h *InterfaceVppHandler) DeleteLoopbackInterface(ifName string, idx uint32) error { - // Prepare the message. - req := &interfaces.DeleteLoopback{ - SwIfIndex: idx, - } - reply := &interfaces.DeleteLoopbackReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return h.RemoveInterfaceTag(ifName, idx) -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/memif_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/memif_vppcalls.go deleted file mode 100644 index f2ef914339..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/memif_vppcalls.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/memif" -) - -// AddMemifInterface implements interface handler. -func (h *InterfaceVppHandler) AddMemifInterface(ifName string, memIface *interfaces.MemifLink, socketID uint32) (swIdx uint32, err error) { - req := &memif.MemifCreate{ - ID: memIface.Id, - Mode: uint8(memIface.Mode), - Secret: []byte(memIface.Secret), - SocketID: socketID, - BufferSize: uint16(memIface.BufferSize), - RingSize: memIface.RingSize, - RxQueues: uint8(memIface.RxQueues), - TxQueues: uint8(memIface.TxQueues), - } - if memIface.Master { - req.Role = 0 - } else { - req.Role = 1 - } - // TODO: temporary fix, waiting for https://gerrit.fd.io/r/#/c/7266/ - if req.RxQueues == 0 { - req.RxQueues = 1 - } - if req.TxQueues == 0 { - req.TxQueues = 1 - } - reply := &memif.MemifCreateReply{} - - if err = h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return 0, err - } - - return reply.SwIfIndex, h.SetInterfaceTag(ifName, reply.SwIfIndex) -} - -// DeleteMemifInterface implements interface handler. -func (h *InterfaceVppHandler) DeleteMemifInterface(ifName string, idx uint32) error { - req := &memif.MemifDelete{ - SwIfIndex: idx, - } - reply := &memif.MemifDeleteReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return h.RemoveInterfaceTag(ifName, idx) -} - -// RegisterMemifSocketFilename implements interface handler. -func (h *InterfaceVppHandler) RegisterMemifSocketFilename(filename []byte, id uint32) error { - req := &memif.MemifSocketFilenameAddDel{ - SocketFilename: filename, - SocketID: id, - IsAdd: 1, // sockets can be added only - } - reply := &memif.MemifSocketFilenameAddDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/rx_mode_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/rx_mode_vppcalls.go deleted file mode 100644 index 5fb4c1046a..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/rx_mode_vppcalls.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" - binapi_interface "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces" -) - -// SetRxMode implements interface handler. -func (h *InterfaceVppHandler) SetRxMode(ifIdx uint32, rxModeSettings *interfaces.Interface_RxModeSettings) error { - req := &binapi_interface.SwInterfaceSetRxMode{ - SwIfIndex: ifIdx, - Mode: uint8(rxModeSettings.RxMode), - QueueID: rxModeSettings.QueueId, - QueueIDValid: uint8(rxModeSettings.QueueIdValid), - } - reply := &binapi_interface.SwInterfaceSetRxModeReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/rx_placement_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/rx_placement_vppcalls.go deleted file mode 100644 index 8eb57d2133..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/rx_placement_vppcalls.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2018 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" - binapi_interface "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces" -) - -// SetRxPlacement implements interface handler. -func (h *InterfaceVppHandler) SetRxPlacement(ifIdx uint32, rxPlacement *interfaces.Interface_RxPlacementSettings) error { - req := &binapi_interface.SwInterfaceSetRxPlacement{ - SwIfIndex: ifIdx, - QueueID: rxPlacement.Queue, - WorkerID: rxPlacement.Worker, - IsMain: boolToUint(rxPlacement.IsMain), - } - reply := &binapi_interface.SwInterfaceSetRxPlacementReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/subif_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/subif_vppcalls.go deleted file mode 100644 index 9cc72ca974..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/subif_vppcalls.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2018 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces" -) - -// CreateSubif creates sub interface. -func (h *InterfaceVppHandler) CreateSubif(ifIdx, vlanID uint32) (uint32, error) { - req := &interfaces.CreateVlanSubif{ - SwIfIndex: ifIdx, - VlanID: vlanID, - } - - reply := &interfaces.CreateVlanSubifReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return 0, err - } - - return reply.SwIfIndex, nil -} - -// DeleteSubif deletes sub interface. -func (h *InterfaceVppHandler) DeleteSubif(ifIdx uint32) error { - req := &interfaces.DeleteSubif{ - SwIfIndex: ifIdx, - } - - reply := &interfaces.DeleteSubifReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/tap_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/tap_vppcalls.go deleted file mode 100644 index 936b6ce8ad..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/tap_vppcalls.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "errors" - - interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/tap" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/tapv2" -) - -// AddTapInterface implements interface handler. -func (h *InterfaceVppHandler) AddTapInterface(ifName string, tapIf *interfaces.TapLink) (swIfIdx uint32, err error) { - if tapIf == nil || tapIf.HostIfName == "" { - return 0, errors.New("host interface name was not provided for the TAP interface") - } - - if tapIf.Version == 2 { - // Configure fast virtio-based TAP interface - req := &tapv2.TapCreateV2{ - ID: ^uint32(0), - HostIfName: []byte(tapIf.HostIfName), - HostIfNameSet: 1, - UseRandomMac: 1, - RxRingSz: uint16(tapIf.RxRingSize), - TxRingSz: uint16(tapIf.TxRingSize), - } - - reply := &tapv2.TapCreateV2Reply{} - err = h.callsChannel.SendRequest(req).ReceiveReply(reply) - swIfIdx = reply.SwIfIndex - } else { - // Configure the original TAP interface - req := &tap.TapConnect{ - TapName: []byte(tapIf.HostIfName), - UseRandomMac: 1, - } - - reply := &tap.TapConnectReply{} - err = h.callsChannel.SendRequest(req).ReceiveReply(reply) - swIfIdx = reply.SwIfIndex - } - if err != nil { - return 0, err - } - - return swIfIdx, h.SetInterfaceTag(ifName, swIfIdx) -} - -// DeleteTapInterface implements interface handler. -func (h *InterfaceVppHandler) DeleteTapInterface(ifName string, idx uint32, version uint32) error { - var err error - - if version == 2 { - req := &tapv2.TapDeleteV2{ - SwIfIndex: idx, - } - - reply := &tapv2.TapDeleteV2Reply{} - err = h.callsChannel.SendRequest(req).ReceiveReply(reply) - } else { - req := &tap.TapDelete{ - SwIfIndex: idx, - } - - reply := &tap.TapDeleteReply{} - err = h.callsChannel.SendRequest(req).ReceiveReply(reply) - } - if err != nil { - return err - } - - return h.RemoveInterfaceTag(ifName, idx) -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/vmxnet3_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/vmxnet3_vppcalls.go deleted file mode 100644 index b945e16ff0..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/vmxnet3_vppcalls.go +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) 2018 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "fmt" - - "github.com/pkg/errors" - - interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vmxnet3" -) - -// AddVmxNet3 implements interface handler -func (h *InterfaceVppHandler) AddVmxNet3(ifName string, vmxNet3 *interfaces.VmxNet3Link) (swIdx uint32, err error) { - var pci uint32 - pci, err = derivePCI(ifName) - if err != nil { - return 0, err - } - - req := &vmxnet3.Vmxnet3Create{ - PciAddr: pci, - } - // Optional arguments - if vmxNet3 != nil { - req.EnableElog = int32(boolToUint(vmxNet3.EnableElog)) - req.RxqSize = uint16(vmxNet3.RxqSize) - req.TxqSize = uint16(vmxNet3.TxqSize) - } - - reply := &vmxnet3.Vmxnet3CreateReply{} - if err = h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return 0, errors.Errorf(err.Error()) - } - - return reply.SwIfIndex, h.SetInterfaceTag(ifName, reply.SwIfIndex) -} - -// DeleteVmxNet3 implements interface handler -func (h *InterfaceVppHandler) DeleteVmxNet3(ifName string, ifIdx uint32) error { - req := &vmxnet3.Vmxnet3Delete{ - SwIfIndex: ifIdx, - } - reply := &vmxnet3.Vmxnet3DeleteReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return errors.Errorf(err.Error()) - } - - return h.RemoveInterfaceTag(ifName, ifIdx) -} - -func derivePCI(ifName string) (uint32, error) { - var function, slot, bus, domain, pci uint32 - - numLen, err := fmt.Sscanf(ifName, "vmxnet3-%x/%x/%x/%x", &domain, &bus, &slot, &function) - if err != nil { - err = errors.Errorf("cannot parse PCI address from the vmxnet3 interface name %s: %v", ifName, err) - return 0, err - } - if numLen != 4 { - err = errors.Errorf("cannot parse PCI address from the interface name %s: expected 4 address elements, received %d", - ifName, numLen) - return 0, err - } - - pci |= function << 29 - pci |= slot << 24 - pci |= bus << 16 - pci |= domain - - return pci, nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/vppcalls_handler.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/vppcalls_handler.go deleted file mode 100644 index bf94efe171..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/vppcalls_handler.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - govppapi "git.fd.io/govpp.git/api" - "github.com/ligato/cn-infra/logging" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/l2" - - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/af_packet" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/bond" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/dhcp" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ipsec" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/memif" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/tap" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/tapv2" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vmxnet3" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vxlan" - "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls" -) - -type ( - InterfaceDetails = vppcalls.InterfaceDetails - InterfaceMeta = vppcalls.InterfaceMeta - InterfaceEvent = vppcalls.InterfaceEvent - Dhcp = vppcalls.Dhcp - Client = vppcalls.Client - Lease = vppcalls.Lease -) - -func init() { - var msgs []govppapi.Message - msgs = append(msgs, af_packet.Messages...) - msgs = append(msgs, bond.Messages...) - msgs = append(msgs, dhcp.Messages...) - msgs = append(msgs, interfaces.Messages...) - msgs = append(msgs, ip.Messages...) - msgs = append(msgs, ipsec.Messages...) - msgs = append(msgs, l2.Messages...) - msgs = append(msgs, memif.Messages...) - msgs = append(msgs, tap.Messages...) - msgs = append(msgs, tapv2.Messages...) - msgs = append(msgs, vmxnet3.Messages...) - msgs = append(msgs, vxlan.Messages...) - - vppcalls.Versions["vpp1810"] = vppcalls.HandlerVersion{ - Msgs: msgs, - New: func(ch govppapi.Channel, log logging.Logger) vppcalls.InterfaceVppAPI { - return &InterfaceVppHandler{ch, log} - }, - } -} - -// InterfaceVppHandler is accessor for interface-related vppcalls methods -type InterfaceVppHandler struct { - callsChannel govppapi.Channel - log logging.Logger -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/vrf_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/vrf_vppcalls.go deleted file mode 100644 index 48a4f2e37f..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/vrf_vppcalls.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces" -) - -// SetInterfaceVrf implements interface handler. -func (h *InterfaceVppHandler) SetInterfaceVrf(ifIdx, vrfID uint32) error { - return h.setInterfaceVrf(ifIdx, vrfID, false) -} - -// SetInterfaceVrfIPv6 implements interface handler. -func (h *InterfaceVppHandler) SetInterfaceVrfIPv6(ifIdx, vrfID uint32) error { - return h.setInterfaceVrf(ifIdx, vrfID, true) -} - -// GetInterfaceVrf implements interface handler. -func (h *InterfaceVppHandler) GetInterfaceVrf(ifIdx uint32) (vrfID uint32, err error) { - return h.getInterfaceVrf(ifIdx, false) -} - -// GetInterfaceVrfIPv6 implements interface handler. -func (h *InterfaceVppHandler) GetInterfaceVrfIPv6(ifIdx uint32) (vrfID uint32, err error) { - return h.getInterfaceVrf(ifIdx, true) -} - -// Interface is set to VRF table. Table IP version has to be defined. -func (h *InterfaceVppHandler) setInterfaceVrf(ifIdx, vrfID uint32, isIPv6 bool) error { - req := &interfaces.SwInterfaceSetTable{ - SwIfIndex: ifIdx, - VrfID: vrfID, - IsIPv6: boolToUint(isIPv6), - } - reply := &interfaces.SwInterfaceSetTableReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - h.log.Debugf("Interface %d set to VRF %d", ifIdx, vrfID) - - return nil -} - -// Returns VRF ID for provided interface. -func (h *InterfaceVppHandler) getInterfaceVrf(ifIdx uint32, isIPv6 bool) (vrfID uint32, err error) { - req := &interfaces.SwInterfaceGetTable{ - SwIfIndex: ifIdx, - IsIPv6: boolToUint(isIPv6), - } - reply := &interfaces.SwInterfaceGetTableReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return 0, err - } - - return reply.VrfID, nil -} \ No newline at end of file diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/vxlan_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/vxlan_vppcalls.go deleted file mode 100644 index 6beee17424..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/vxlan_vppcalls.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "fmt" - "net" - - interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vxlan" -) - -func (h *InterfaceVppHandler) addDelVxLanTunnel(vxLan *interfaces.VxlanLink, vrf, multicastIf uint32, isAdd bool) (swIdx uint32, err error) { - req := &vxlan.VxlanAddDelTunnel{ - IsAdd: boolToUint(isAdd), - Vni: vxLan.Vni, - DecapNextIndex: 0xFFFFFFFF, - Instance: ^uint32(0), - EncapVrfID: vrf, - McastSwIfIndex: multicastIf, - } - - srcAddr := net.ParseIP(vxLan.SrcAddress).To4() - dstAddr := net.ParseIP(vxLan.DstAddress).To4() - if srcAddr == nil && dstAddr == nil { - srcAddr = net.ParseIP(vxLan.SrcAddress).To16() - dstAddr = net.ParseIP(vxLan.DstAddress).To16() - req.IsIPv6 = 1 - if srcAddr == nil || dstAddr == nil { - return 0, fmt.Errorf("invalid VXLAN address, src: %s, dst: %s", srcAddr, dstAddr) - } - } else if srcAddr == nil && dstAddr != nil || srcAddr != nil && dstAddr == nil { - return 0, fmt.Errorf("IP version mismatch for VXLAN destination and source IP addresses") - } - - req.SrcAddress = []byte(srcAddr) - req.DstAddress = []byte(dstAddr) - - reply := &vxlan.VxlanAddDelTunnelReply{} - if err = h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return 0, err - } - - return reply.SwIfIndex, nil -} - -// AddVxLanTunnel implements VxLan handler. -func (h *InterfaceVppHandler) AddVxLanTunnel(ifName string, vrf, multicastIf uint32, vxLan *interfaces.VxlanLink) (swIndex uint32, err error) { - swIfIdx, err := h.addDelVxLanTunnel(vxLan, vrf, multicastIf, true) - if err != nil { - return 0, err - } - return swIfIdx, h.SetInterfaceTag(ifName, swIfIdx) -} - -// DeleteVxLanTunnel implements VxLan handler. -func (h *InterfaceVppHandler) DeleteVxLanTunnel(ifName string, idx, vrf uint32, vxLan *interfaces.VxlanLink) error { - // Multicast does not need to be set - if _, err := h.addDelVxLanTunnel(vxLan, vrf, 0, false); err != nil { - return err - } - return h.RemoveInterfaceTag(ifName, idx) -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/watch_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/watch_vppcalls.go deleted file mode 100644 index 10ac419e36..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1810/watch_vppcalls.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "bytes" - "fmt" - "net" - "os" - - govppapi "git.fd.io/govpp.git/api" - "github.com/pkg/errors" - - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/dhcp" - binapi_interfaces "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces" -) - -func (h *InterfaceVppHandler) WatchInterfaceEvents(events chan<- *InterfaceEvent) error { - notifChan := make(chan govppapi.Message) - - // subscribe for receiving SwInterfaceEvents notifications - vppNotifSubs, err := h.callsChannel.SubscribeNotification(notifChan, &binapi_interfaces.SwInterfaceEvent{}) - if err != nil { - return errors.Errorf("failed to subscribe VPP notification (sw_interface_event): %v", err) - } - _ = vppNotifSubs - - go func() { - for { - select { - case e := <-notifChan: - ifEvent, ok := e.(*binapi_interfaces.SwInterfaceEvent) - if !ok { - continue - } - events <- &InterfaceEvent{ - SwIfIndex: ifEvent.SwIfIndex, - AdminState: ifEvent.AdminUpDown, - LinkState: ifEvent.LinkUpDown, - Deleted: ifEvent.Deleted != 0, - } - } - } - }() - - // enable interface state notifications from VPP - wantIfEventsReply := &binapi_interfaces.WantInterfaceEventsReply{} - err = h.callsChannel.SendRequest(&binapi_interfaces.WantInterfaceEvents{ - PID: uint32(os.Getpid()), - EnableDisable: 1, - }).ReceiveReply(wantIfEventsReply) - if err != nil { - if err == govppapi.VPPApiError(govppapi.INVALID_REGISTRATION) { - h.log.Warnf("already registered for watch interface events: %v", err) - return nil - } - return errors.Errorf("failed to watch interface events: %v", err) - } - - return nil -} - -func (h *InterfaceVppHandler) WatchDHCPLeases(leasesCh chan<- *Lease) error { - notifChan := make(chan govppapi.Message) - - // subscribe for receiving SwInterfaceEvents notifications - vppNotifSubs, err := h.callsChannel.SubscribeNotification(notifChan, &dhcp.DHCPComplEvent{}) - if err != nil { - return errors.Errorf("failed to subscribe VPP notification (sw_interface_event): %v", err) - } - _ = vppNotifSubs - - go func() { - for { - select { - case e := <-notifChan: - dhcpEvent, ok := e.(*dhcp.DHCPComplEvent) - if !ok { - continue - } - lease := dhcpEvent.Lease - var hostMac net.HardwareAddr - copy(hostMac, lease.HostMac) - var hostAddr, routerAddr string - if uintToBool(lease.IsIPv6) { - hostAddr = fmt.Sprintf("%s/%d", net.IP(lease.HostAddress).To16().String(), uint32(lease.MaskWidth)) - routerAddr = fmt.Sprintf("%s/%d", net.IP(lease.RouterAddress).To16().String(), uint32(lease.MaskWidth)) - } else { - hostAddr = fmt.Sprintf("%s/%d", net.IP(lease.HostAddress[:4]).To4().String(), uint32(lease.MaskWidth)) - routerAddr = fmt.Sprintf("%s/%d", net.IP(lease.RouterAddress[:4]).To4().String(), uint32(lease.MaskWidth)) - } - leasesCh <- &Lease{ - SwIfIndex: lease.SwIfIndex, - State: lease.State, - Hostname: string(bytes.SplitN(lease.Hostname, []byte{0x00}, 2)[0]), - IsIPv6: uintToBool(lease.IsIPv6), - HostAddress: hostAddr, - RouterAddress: routerAddr, - HostMac: hostMac.String(), - } - } - } - }() - - return nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1901/tap_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1901/tap_vppcalls.go index 3ece76dcbc..2d7ff818dc 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1901/tap_vppcalls.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1901/tap_vppcalls.go @@ -29,6 +29,10 @@ func (h *InterfaceVppHandler) AddTapInterface(ifName string, tapIf *interfaces.T } if tapIf.Version == 2 { + if tapIf.EnableGso { + h.log.Warnf("GSO feature for TAP interface is not supported in VPP 19.01") + } + // Configure fast virtio-based TAP interface req := &tapv2.TapCreateV2{ ID: ^uint32(0), diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1901/watch_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1901/watch_vppcalls.go index a60c9cd101..b374a35e6f 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1901/watch_vppcalls.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1901/watch_vppcalls.go @@ -108,8 +108,6 @@ func (h *InterfaceVppHandler) WatchDHCPLeases(leasesCh chan<- *vppcalls.Lease) e continue } lease := dhcpEvent.Lease - var hostMac net.HardwareAddr - copy(hostMac, lease.HostMac) var hostAddr, routerAddr string if uintToBool(lease.IsIPv6) { hostAddr = fmt.Sprintf("%s/%d", net.IP(lease.HostAddress).To16().String(), uint32(lease.MaskWidth)) @@ -125,7 +123,7 @@ func (h *InterfaceVppHandler) WatchDHCPLeases(leasesCh chan<- *vppcalls.Lease) e IsIPv6: uintToBool(lease.IsIPv6), HostAddress: hostAddr, RouterAddress: routerAddr, - HostMac: hostMac.String(), + HostMac: net.HardwareAddr(lease.HostMac).String(), } } } diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1904/dump_interface_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1904/dump_interface_vppcalls.go index 77e06e4607..090e4ec8c2 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1904/dump_interface_vppcalls.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1904/dump_interface_vppcalls.go @@ -477,8 +477,10 @@ func (h *InterfaceVppHandler) dumpTapDetails(ifs map[uint32]*vppcalls.InterfaceD ifs[tapDetails.SwIfIndex].Interface.Link = &interfaces.Interface_Tap{ Tap: &interfaces.TapLink{ Version: 2, - HostIfName: string(bytes.SplitN(tapDetails.HostIfName, []byte{0x00}, 2)[0]), - // Other parameters are not not yet part of the dump. + HostIfName: cleanString(tapDetails.HostIfName), + RxRingSize: uint32(tapDetails.RxRingSz), + TxRingSize: uint32(tapDetails.TxRingSz), + EnableGso: tapDetails.TapFlags&TapFlagGSO == TapFlagGSO, }, } ifs[tapDetails.SwIfIndex].Interface.Type = interfaces.Interface_TAP diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1904/tap_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1904/tap_vppcalls.go index 7c97e87dfc..cca48e2ec3 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1904/tap_vppcalls.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1904/tap_vppcalls.go @@ -22,6 +22,11 @@ import ( "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1904/tapv2" ) +// TapFlags definitions from https://github.com/FDio/vpp/blob/stable/1904/src/vnet/devices/tap/tap.h#L33 +const ( + TapFlagGSO uint32 = 1 << iota +) + // AddTapInterface implements interface handler. func (h *InterfaceVppHandler) AddTapInterface(ifName string, tapIf *interfaces.TapLink) (swIfIdx uint32, err error) { if tapIf == nil || tapIf.HostIfName == "" { @@ -31,6 +36,11 @@ func (h *InterfaceVppHandler) AddTapInterface(ifName string, tapIf *interfaces.T if tapIf.Version == 1 { return 0, errors.New("tap version 1 has been deprecated") } else if tapIf.Version == 2 { + var flags uint32 + if tapIf.EnableGso { + flags |= TapFlagGSO + } + // Configure fast virtio-based TAP interface req := &tapv2.TapCreateV2{ ID: ^uint32(0), @@ -39,6 +49,7 @@ func (h *InterfaceVppHandler) AddTapInterface(ifName string, tapIf *interfaces.T UseRandomMac: 1, RxRingSz: uint16(tapIf.RxRingSize), TxRingSz: uint16(tapIf.TxRingSize), + TapFlags: flags, } reply := &tapv2.TapCreateV2Reply{} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1904/watch_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1904/watch_vppcalls.go index 01b93822a0..c34fb864e2 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1904/watch_vppcalls.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls/vpp1904/watch_vppcalls.go @@ -108,8 +108,6 @@ func (h *InterfaceVppHandler) WatchDHCPLeases(leasesCh chan<- *vppcalls.Lease) e continue } lease := dhcpEvent.Lease - var hostMac net.HardwareAddr - copy(hostMac, lease.HostMac) var hostAddr, routerAddr string if uintToBool(lease.IsIPv6) { hostAddr = fmt.Sprintf("%s/%d", net.IP(lease.HostAddress).To16().String(), uint32(lease.MaskWidth)) @@ -125,7 +123,7 @@ func (h *InterfaceVppHandler) WatchDHCPLeases(leasesCh chan<- *vppcalls.Lease) e IsIPv6: uintToBool(lease.IsIPv6), HostAddress: hostAddr, RouterAddress: routerAddr, - HostMac: hostMac.String(), + HostMac: net.HardwareAddr(lease.HostMac).String(), } } } diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/ipsecplugin/vppcalls/ipsec_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ipsecplugin/vppcalls/ipsec_vppcalls.go new file mode 100644 index 0000000000..ffb9992781 --- /dev/null +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/ipsecplugin/vppcalls/ipsec_vppcalls.go @@ -0,0 +1,114 @@ +// Copyright (c) 2018 Cisco and/or its affiliates. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package vppcalls + +import ( + govppapi "git.fd.io/govpp.git/api" + "github.com/ligato/cn-infra/logging" + ipsec "github.com/ligato/vpp-agent/api/models/vpp/ipsec" + "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifaceidx" +) + +// IPSecSaDetails holds security association with VPP metadata +type IPSecSaDetails struct { + Sa *ipsec.SecurityAssociation + Meta *IPSecSaMeta +} + +// IPSecSaMeta contains all VPP-specific metadata +type IPSecSaMeta struct { + SaID uint32 + Interface string + IfIdx uint32 + CryptoKeyLen uint8 + IntegKeyLen uint8 + Salt uint32 + SeqOutbound uint64 + LastSeqInbound uint64 + ReplayWindow uint64 + TotalDataSize uint64 +} + +// IPSecSpdDetails represents IPSec policy databases with particular metadata +type IPSecSpdDetails struct { + Spd *ipsec.SecurityPolicyDatabase + PolicyMeta map[string]*SpdMeta // SA index name is a key + NumPolicies uint32 +} + +// SpdMeta hold VPP-specific data related to SPD +type SpdMeta struct { + SaID uint32 + Policy uint8 + Bytes uint64 + Packets uint64 +} + +// IPSecVppAPI provides methods for creating and managing of a IPsec configuration +type IPSecVppAPI interface { + IPSecVPPRead + + // AddSPD adds SPD to VPP via binary API + AddSPD(spdID uint32) error + // DelSPD deletes SPD from VPP via binary API + DeleteSPD(spdID uint32) error + // InterfaceAddSPD adds SPD interface assignment to VPP via binary API + AddSPDInterface(spdID uint32, iface *ipsec.SecurityPolicyDatabase_Interface) error + // InterfaceDelSPD deletes SPD interface assignment from VPP via binary API + DeleteSPDInterface(spdID uint32, iface *ipsec.SecurityPolicyDatabase_Interface) error + // AddSPDEntry adds SPD policy entry to VPP via binary API + AddSPDEntry(spdID, saID uint32, spd *ipsec.SecurityPolicyDatabase_PolicyEntry) error + // DelSPDEntry deletes SPD policy entry from VPP via binary API + DeleteSPDEntry(spdID, saID uint32, spd *ipsec.SecurityPolicyDatabase_PolicyEntry) error + // AddSAEntry adds SA to VPP via binary API + AddSA(sa *ipsec.SecurityAssociation) error + // DelSAEntry deletes SA from VPP via binary API + DeleteSA(sa *ipsec.SecurityAssociation) error +} + +// IPSecVPPRead provides read methods for IPSec +type IPSecVPPRead interface { + // DumpIPSecSPD returns a list of IPSec security policy databases + DumpIPSecSPD() (spdList []*IPSecSpdDetails, err error) + // DumpIPSecSA returns a list of configured security associations + DumpIPSecSA() (saList []*IPSecSaDetails, err error) + // DumpIPSecSAWithIndex returns a security association with provided index + DumpIPSecSAWithIndex(saID uint32) (saList []*IPSecSaDetails, err error) +} + +var Versions = map[string]HandlerVersion{} + +type HandlerVersion struct { + Msgs []govppapi.Message + New func(govppapi.Channel, ifaceidx.IfaceMetadataIndex, logging.Logger) IPSecVppAPI +} + +func CompatibleIPSecVppHandler( + ch govppapi.Channel, idx ifaceidx.IfaceMetadataIndex, log logging.Logger, +) IPSecVppAPI { + if len(Versions) == 0 { + // ipsecplugin is not loaded + return nil + } + for ver, h := range Versions { + log.Debugf("checking compatibility with %s", ver) + if err := ch.CheckCompatiblity(h.Msgs...); err != nil { + continue + } + log.Debug("found compatible version:", ver) + return h.New(ch, idx, log) + } + panic("no compatible version available") +} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/l2plugin.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/l2plugin.go index 6204d5be5d..0d271258a7 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/l2plugin.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/l2plugin.go @@ -33,7 +33,6 @@ import ( "github.com/ligato/vpp-agent/plugins/vpp/l2plugin/descriptor/adapter" "github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls" - _ "github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810" _ "github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1901" _ "github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1904" ) diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/arp_term_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/arp_term_vppcalls.go deleted file mode 100644 index 98f24a6389..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/arp_term_vppcalls.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "net" - - "github.com/ligato/cn-infra/utils/addrs" - - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/l2" -) - -func (h *BridgeDomainVppHandler) callBdIPMacAddDel(isAdd bool, bdID uint32, mac string, ip string) error { - req := &l2.BdIPMacAddDel{ - BdID: bdID, - IsAdd: boolToUint(isAdd), - } - - macAddr, err := net.ParseMAC(mac) - if err != nil { - return err - } - req.MacAddress = macAddr - - isIpv6, err := addrs.IsIPv6(ip) - if err != nil { - return err - } - ipAddr := net.ParseIP(ip) - if isIpv6 { - req.IsIPv6 = 1 - req.IPAddress = []byte(ipAddr.To16()) - } else { - req.IsIPv6 = 0 - req.IPAddress = []byte(ipAddr.To4()) - } - - reply := &l2.BdIPMacAddDelReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// AddArpTerminationTableEntry creates ARP termination entry for bridge domain. -func (h *BridgeDomainVppHandler) AddArpTerminationTableEntry(bdID uint32, mac string, ip string) error { - err := h.callBdIPMacAddDel(true, bdID, mac, ip) - if err != nil { - return err - } - return nil -} - -// RemoveArpTerminationTableEntry removes ARP termination entry from bridge domain. -func (h *BridgeDomainVppHandler) RemoveArpTerminationTableEntry(bdID uint32, mac string, ip string) error { - err := h.callBdIPMacAddDel(false, bdID, mac, ip) - if err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/bridge_domain_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/bridge_domain_vppcalls.go deleted file mode 100644 index 403d390d80..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/bridge_domain_vppcalls.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - l2 "github.com/ligato/vpp-agent/api/models/vpp/l2" - l2ba "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/l2" -) - -// AddBridgeDomain adds new bridge domain. -func (h *BridgeDomainVppHandler) AddBridgeDomain(bdIdx uint32, bd *l2.BridgeDomain) error { - req := &l2ba.BridgeDomainAddDel{ - IsAdd: 1, - BdID: bdIdx, - Learn: boolToUint(bd.Learn), - ArpTerm: boolToUint(bd.ArpTermination), - Flood: boolToUint(bd.Flood), - UuFlood: boolToUint(bd.UnknownUnicastFlood), - Forward: boolToUint(bd.Forward), - MacAge: uint8(bd.MacAge), - BdTag: []byte(bd.Name), - } - reply := &l2ba.BridgeDomainAddDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// DeleteBridgeDomain removes existing bridge domain. -func (h *BridgeDomainVppHandler) DeleteBridgeDomain(bdIdx uint32) error { - req := &l2ba.BridgeDomainAddDel{ - IsAdd: 0, - BdID: bdIdx, - } - reply := &l2ba.BridgeDomainAddDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -func boolToUint(value bool) uint8 { - if value { - return 1 - } - return 0 -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/doc.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/doc.go deleted file mode 100644 index b6c62f29f5..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package vppcalls contains wrappers over VPP binary APIs for bridge-domains, -// and L2 FIBs and XConnect pairs and helpers for dumping them. -package vpp1810 diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/dump_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/dump_vppcalls.go deleted file mode 100644 index f09e611809..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/dump_vppcalls.go +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "bytes" - "net" - - "github.com/pkg/errors" - - l2nb "github.com/ligato/vpp-agent/api/models/vpp/l2" - l2ba "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/l2" - "github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls" -) - -// DumpBridgeDomains implements bridge domain handler. -func (h *BridgeDomainVppHandler) DumpBridgeDomains() ([]*vppcalls.BridgeDomainDetails, error) { - // At first prepare bridge domain ARP termination table which needs to be dumped separately. - bdArpTab, err := h.dumpBridgeDomainMacTable() - if err != nil { - return nil, errors.Errorf("failed to dump arp termination table: %v", err) - } - - // list of resulting BDs - var bds []*vppcalls.BridgeDomainDetails - - // dump bridge domains - reqCtx := h.callsChannel.SendMultiRequest(&l2ba.BridgeDomainDump{BdID: ^uint32(0)}) - - for { - bdDetails := &l2ba.BridgeDomainDetails{} - stop, err := reqCtx.ReceiveReply(bdDetails) - if stop { - break - } - if err != nil { - return nil, err - } - - // bridge domain metadata - bdData := &vppcalls.BridgeDomainDetails{ - Bd: &l2nb.BridgeDomain{ - Name: string(bytes.Replace(bdDetails.BdTag, []byte{0x00}, []byte{}, -1)), - Flood: bdDetails.Flood > 0, - UnknownUnicastFlood: bdDetails.UuFlood > 0, - Forward: bdDetails.Forward > 0, - Learn: bdDetails.Learn > 0, - ArpTermination: bdDetails.ArpTerm > 0, - MacAge: uint32(bdDetails.MacAge), - }, - Meta: &vppcalls.BridgeDomainMeta{ - BdID: bdDetails.BdID, - }, - } - - // bridge domain interfaces - for _, iface := range bdDetails.SwIfDetails { - ifaceName, _, exists := h.ifIndexes.LookupBySwIfIndex(iface.SwIfIndex) - if !exists { - h.log.Warnf("Bridge domain dump: interface name for index %d not found", iface.SwIfIndex) - continue - } - // Bvi - var bvi bool - if iface.SwIfIndex == bdDetails.BviSwIfIndex { - bvi = true - } - // add interface entry - bdData.Bd.Interfaces = append(bdData.Bd.Interfaces, &l2nb.BridgeDomain_Interface{ - Name: ifaceName, - BridgedVirtualInterface: bvi, - SplitHorizonGroup: uint32(iface.Shg), - }) - } - - // Add ARP termination entries. - arpTable, ok := bdArpTab[bdDetails.BdID] - if ok { - bdData.Bd.ArpTerminationTable = arpTable - } - - bds = append(bds, bdData) - } - - return bds, nil -} - -// Reads ARP termination table from all bridge domains. Result is then added to bridge domains. -func (h *BridgeDomainVppHandler) dumpBridgeDomainMacTable() (map[uint32][]*l2nb.BridgeDomain_ArpTerminationEntry, error) { - bdArpTable := make(map[uint32][]*l2nb.BridgeDomain_ArpTerminationEntry) - req := &l2ba.BdIPMacDump{BdID: ^uint32(0)} - - reqCtx := h.callsChannel.SendMultiRequest(req) - for { - msg := &l2ba.BdIPMacDetails{} - stop, err := reqCtx.ReceiveReply(msg) - if err != nil { - return nil, err - } - if stop { - break - } - - // Prepare ARP entry - arpEntry := &l2nb.BridgeDomain_ArpTerminationEntry{} - var ipAddr net.IP = msg.IPAddress - if uintToBool(msg.IsIPv6) { - arpEntry.IpAddress = ipAddr.To16().String() - } else { - arpEntry.IpAddress = ipAddr[:4].To4().String() - } - arpEntry.PhysAddress = net.HardwareAddr(msg.MacAddress).String() - - // Add ARP entry to result map - bdArpTable[msg.BdID] = append(bdArpTable[msg.BdID], arpEntry) - } - - return bdArpTable, nil -} - -// DumpL2FIBs dumps VPP L2 FIB table entries into the northbound API -// data structure map indexed by destination MAC address. -func (h *FIBVppHandler) DumpL2FIBs() (map[string]*vppcalls.FibTableDetails, error) { - // map for the resulting FIBs - fibs := make(map[string]*vppcalls.FibTableDetails) - - reqCtx := h.callsChannel.SendMultiRequest(&l2ba.L2FibTableDump{BdID: ^uint32(0)}) - for { - fibDetails := &l2ba.L2FibTableDetails{} - stop, err := reqCtx.ReceiveReply(fibDetails) - if stop { - break // Break from the loop. - } - if err != nil { - return nil, err - } - - mac := net.HardwareAddr(fibDetails.Mac).String() - var action l2nb.FIBEntry_Action - if fibDetails.FilterMac > 0 { - action = l2nb.FIBEntry_DROP - } else { - action = l2nb.FIBEntry_FORWARD - } - - // Interface name (only for FORWARD entries) - var ifName string - if action == l2nb.FIBEntry_FORWARD { - var exists bool - ifName, _, exists = h.ifIndexes.LookupBySwIfIndex(fibDetails.SwIfIndex) - if !exists { - h.log.Warnf("FIB dump: interface name for index %d not found", fibDetails.SwIfIndex) - continue - } - } - // Bridge domain name - bdName, _, exists := h.bdIndexes.LookupByIndex(fibDetails.BdID) - if !exists { - h.log.Warnf("FIB dump: bridge domain name for index %d not found", fibDetails.BdID) - continue - } - - fibs[mac] = &vppcalls.FibTableDetails{ - Fib: &l2nb.FIBEntry{ - PhysAddress: mac, - BridgeDomain: bdName, - Action: action, - OutgoingInterface: ifName, - StaticConfig: fibDetails.StaticMac > 0, - BridgedVirtualInterface: fibDetails.BviMac > 0, - }, - Meta: &vppcalls.FibMeta{ - BdID: fibDetails.BdID, - IfIdx: fibDetails.SwIfIndex, - }, - } - } - - return fibs, nil -} - -// DumpXConnectPairs implements xconnect handler. -func (h *XConnectVppHandler) DumpXConnectPairs() (map[uint32]*vppcalls.XConnectDetails, error) { - // map for the resulting xconnect pairs - xpairs := make(map[uint32]*vppcalls.XConnectDetails) - - reqCtx := h.callsChannel.SendMultiRequest(&l2ba.L2XconnectDump{}) - for { - pairs := &l2ba.L2XconnectDetails{} - stop, err := reqCtx.ReceiveReply(pairs) - if stop { - break - } - if err != nil { - return nil, err - } - - // Find interface names - rxIfaceName, _, exists := h.ifIndexes.LookupBySwIfIndex(pairs.RxSwIfIndex) - if !exists { - h.log.Warnf("XConnect dump: rx interface name for index %d not found", pairs.RxSwIfIndex) - continue - } - txIfaceName, _, exists := h.ifIndexes.LookupBySwIfIndex(pairs.TxSwIfIndex) - if !exists { - h.log.Warnf("XConnect dump: tx interface name for index %d not found", pairs.TxSwIfIndex) - continue - } - - xpairs[pairs.RxSwIfIndex] = &vppcalls.XConnectDetails{ - Xc: &l2nb.XConnectPair{ - ReceiveInterface: rxIfaceName, - TransmitInterface: txIfaceName, - }, - Meta: &vppcalls.XcMeta{ - ReceiveInterfaceSwIfIdx: pairs.RxSwIfIndex, - TransmitInterfaceSwIfIdx: pairs.TxSwIfIndex, - }, - } - } - - return xpairs, nil -} - -func uintToBool(value uint8) bool { - if value == 0 { - return false - } - return true -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/interface_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/interface_vppcalls.go deleted file mode 100644 index a4a7258eb8..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/interface_vppcalls.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "fmt" - - "github.com/pkg/errors" - - l2 "github.com/ligato/vpp-agent/api/models/vpp/l2" - l2ba "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/l2" -) - -// AddInterfaceToBridgeDomain puts interface into bridge domain. -func (h *BridgeDomainVppHandler) AddInterfaceToBridgeDomain(bdIdx uint32, ifaceCfg *l2.BridgeDomain_Interface) error { - ifaceMeta, found := h.ifIndexes.LookupByName(ifaceCfg.Name) - if !found { - return errors.New("failed to get interface metadata") - } - if err := h.addDelInterfaceToBridgeDomain(bdIdx, ifaceCfg, ifaceMeta.GetIndex(), true); err != nil { - return err - } - return nil -} - -// DeleteInterfaceFromBridgeDomain removes interface from bridge domain. -func (h *BridgeDomainVppHandler) DeleteInterfaceFromBridgeDomain(bdIdx uint32, ifaceCfg *l2.BridgeDomain_Interface) error { - ifaceMeta, found := h.ifIndexes.LookupByName(ifaceCfg.Name) - if !found { - return errors.New("failed to get interface metadata") - } - if err := h.addDelInterfaceToBridgeDomain(bdIdx, ifaceCfg, ifaceMeta.GetIndex(), false); err != nil { - return err - } - return nil -} - -func (h *BridgeDomainVppHandler) addDelInterfaceToBridgeDomain(bdIdx uint32, ifaceCfg *l2.BridgeDomain_Interface, - ifIdx uint32, add bool) error { - req := &l2ba.SwInterfaceSetL2Bridge{ - BdID: bdIdx, - RxSwIfIndex: ifIdx, - Shg: uint8(ifaceCfg.SplitHorizonGroup), - Enable: boolToUint(add), - } - // Set as BVI. - if ifaceCfg.BridgedVirtualInterface { - req.PortType = l2ba.L2_API_PORT_TYPE_BVI - } - reply := &l2ba.SwInterfaceSetL2BridgeReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return fmt.Errorf("%s returned error: %v", reply.GetMessageName(), err) - } - - return nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/l2fib_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/l2fib_vppcalls.go deleted file mode 100644 index 12a4b9100a..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/l2fib_vppcalls.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "errors" - "net" - - l2nb "github.com/ligato/vpp-agent/api/models/vpp/l2" - l2ba "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/l2" -) - -// AddL2FIB creates L2 FIB table entry. -func (h *FIBVppHandler) AddL2FIB(fib *l2nb.FIBEntry) error { - return h.l2fibAddDel(fib, true) -} - -// DeleteL2FIB removes existing L2 FIB table entry. -func (h *FIBVppHandler) DeleteL2FIB(fib *l2nb.FIBEntry) error { - return h.l2fibAddDel(fib, false) -} - -func (h *FIBVppHandler) l2fibAddDel(fib *l2nb.FIBEntry, isAdd bool) (err error) { - // get bridge domain metadata - bdMeta, found := h.bdIndexes.LookupByName(fib.BridgeDomain) - if !found { - return errors.New("failed to get bridge domain metadata") - } - - // get outgoing interface index - swIfIndex := ^uint32(0) // ~0 is used by DROP entries - if fib.Action == l2nb.FIBEntry_FORWARD { - ifaceMeta, found := h.ifIndexes.LookupByName(fib.OutgoingInterface) - if !found { - return errors.New("failed to get interface metadata") - } - swIfIndex = ifaceMeta.GetIndex() - } - - // parse MAC address - var mac []byte - if fib.PhysAddress != "" { - mac, err = net.ParseMAC(fib.PhysAddress) - if err != nil { - return err - } - } - - // add L2 FIB - req := &l2ba.L2fibAddDel{ - IsAdd: boolToUint(isAdd), - Mac: mac, - BdID: bdMeta.GetIndex(), - SwIfIndex: swIfIndex, - BviMac: boolToUint(fib.BridgedVirtualInterface), - StaticMac: boolToUint(fib.StaticConfig), - FilterMac: boolToUint(fib.Action == l2nb.FIBEntry_DROP), - } - reply := &l2ba.L2fibAddDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/vppcalls_handlers.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/vppcalls_handlers.go deleted file mode 100644 index 21ca0e79f7..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/vppcalls_handlers.go +++ /dev/null @@ -1,94 +0,0 @@ -package vpp1810 - -import ( - govppapi "git.fd.io/govpp.git/api" - "github.com/ligato/cn-infra/logging" - - "github.com/ligato/vpp-agent/pkg/idxvpp" - l2ba "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/l2" - "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifaceidx" - "github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls" -) - -func init() { - vppcalls.Versions["vpp1810"] = vppcalls.HandlerVersion{ - Msgs: l2ba.Messages, - New: func(ch govppapi.Channel, - ifIdx ifaceidx.IfaceMetadataIndex, bdIdx idxvpp.NameToIndex, log logging.Logger, - ) vppcalls.L2VppAPI { - return NewL2VppHandler(ch, ifIdx, bdIdx, log) - }, - } -} - -type L2VppHandler struct { - *BridgeDomainVppHandler - *FIBVppHandler - *XConnectVppHandler -} - -func NewL2VppHandler(ch govppapi.Channel, - ifIdx ifaceidx.IfaceMetadataIndex, bdIdx idxvpp.NameToIndex, log logging.Logger, -) *L2VppHandler { - return &L2VppHandler{ - BridgeDomainVppHandler: newBridgeDomainVppHandler(ch, ifIdx, log), - FIBVppHandler: newFIBVppHandler(ch, ifIdx, bdIdx, log), - XConnectVppHandler: newXConnectVppHandler(ch, ifIdx, log), - } -} - -// BridgeDomainVppHandler is accessor for bridge domain-related vppcalls methods. -type BridgeDomainVppHandler struct { - callsChannel govppapi.Channel - ifIndexes ifaceidx.IfaceMetadataIndex - log logging.Logger -} - -// FIBVppHandler is accessor for FIB-related vppcalls methods. -type FIBVppHandler struct { - callsChannel govppapi.Channel - ifIndexes ifaceidx.IfaceMetadataIndex - bdIndexes idxvpp.NameToIndex - log logging.Logger -} - -// XConnectVppHandler is accessor for cross-connect-related vppcalls methods. -type XConnectVppHandler struct { - callsChannel govppapi.Channel - ifIndexes ifaceidx.IfaceMetadataIndex - log logging.Logger -} - -// NewBridgeDomainVppHandler creates new instance of bridge domain vppcalls handler. -func newBridgeDomainVppHandler(callsChan govppapi.Channel, - ifIndexes ifaceidx.IfaceMetadataIndex, log logging.Logger, -) *BridgeDomainVppHandler { - return &BridgeDomainVppHandler{ - callsChannel: callsChan, - ifIndexes: ifIndexes, - log: log, - } -} - -// NewFIBVppHandler creates new instance of FIB vppcalls handler. -func newFIBVppHandler(callsChan govppapi.Channel, - ifIndexes ifaceidx.IfaceMetadataIndex, bdIndexes idxvpp.NameToIndex, log logging.Logger, -) *FIBVppHandler { - return &FIBVppHandler{ - callsChannel: callsChan, - ifIndexes: ifIndexes, - bdIndexes: bdIndexes, - log: log, - } -} - -// NewXConnectVppHandler creates new instance of cross connect vppcalls handler. -func newXConnectVppHandler(callsChan govppapi.Channel, - ifIndexes ifaceidx.IfaceMetadataIndex, log logging.Logger, -) *XConnectVppHandler { - return &XConnectVppHandler{ - callsChannel: callsChan, - ifIndexes: ifIndexes, - log: log, - } -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/xconnect_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/xconnect_vppcalls.go deleted file mode 100644 index 1974c08258..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l2plugin/vppcalls/vpp1810/xconnect_vppcalls.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2017 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "errors" - - l2ba "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/l2" -) - -// AddL2XConnect creates xConnect between two existing interfaces. -func (h *XConnectVppHandler) AddL2XConnect(rxIface, txIface string) error { - return h.addDelXConnect(rxIface, txIface, true) -} - -// DeleteL2XConnect removes xConnect between two interfaces. -func (h *XConnectVppHandler) DeleteL2XConnect(rxIface, txIface string) error { - return h.addDelXConnect(rxIface, txIface, false) -} - -func (h *XConnectVppHandler) addDelXConnect(rxIface, txIface string, enable bool) error { - // get Rx interface metadata - rxIfaceMeta, found := h.ifIndexes.LookupByName(rxIface) - if !found { - return errors.New("failed to get Rx interface metadata") - } - - // get Tx interface metadata - txIfaceMeta, found := h.ifIndexes.LookupByName(txIface) - if !found { - return errors.New("failed to get Tx interface metadata") - } - - // add/del xConnect pair - req := &l2ba.SwInterfaceSetL2Xconnect{ - Enable: boolToUint(enable), - TxSwIfIndex: txIfaceMeta.GetIndex(), - RxSwIfIndex: rxIfaceMeta.GetIndex(), - } - reply := &l2ba.SwInterfaceSetL2XconnectReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/l3plugin.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/l3plugin.go index 5b45860e1f..408de286c2 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/l3plugin.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/l3plugin.go @@ -33,7 +33,6 @@ import ( "github.com/ligato/vpp-agent/plugins/vpp/l3plugin/descriptor" "github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls" - _ "github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810" _ "github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1901" _ "github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1904" ) diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/arp_dump.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/arp_dump.go deleted file mode 100644 index 389343a4a8..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/arp_dump.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "fmt" - "net" - - l3 "github.com/ligato/vpp-agent/api/models/vpp/l3" - l3binapi "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" - "github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls" -) - -// DumpArpEntries implements arp handler. -func (h *ArpVppHandler) DumpArpEntries() ([]*vppcalls.ArpDetails, error) { - arpV4Entries, err := h.dumpArpEntries(false) - if err != nil { - return nil, err - } - arpV6Entries, err := h.dumpArpEntries(true) - if err != nil { - return nil, err - } - return append(arpV4Entries, arpV6Entries...), nil -} - -func (h *ArpVppHandler) dumpArpEntries(isIPv6 bool) ([]*vppcalls.ArpDetails, error) { - var entries []*vppcalls.ArpDetails - reqCtx := h.callsChannel.SendMultiRequest(&l3binapi.IPNeighborDump{ - SwIfIndex: 0xffffffff, // Send multirequest to get all ARP entries for given IP version - IsIPv6: boolToUint(isIPv6), - }) - - for { - arpDetails := &l3binapi.IPNeighborDetails{} - stop, err := reqCtx.ReceiveReply(arpDetails) - if stop { - break - } - if err != nil { - h.log.Error(err) - return nil, err - } - - // ARP interface - ifName, _, exists := h.ifIndexes.LookupBySwIfIndex(arpDetails.SwIfIndex) - if !exists { - h.log.Warnf("ARP dump: interface name not found for index %d", arpDetails.SwIfIndex) - } - // IP & MAC address - var ip string - if arpDetails.IsIPv6 == 1 { - ip = fmt.Sprintf("%s", net.IP(arpDetails.IPAddress).To16().String()) - } else { - ip = fmt.Sprintf("%s", net.IP(arpDetails.IPAddress[:4]).To4().String()) - } - - // ARP entry - arp := &l3.ARPEntry{ - Interface: ifName, - IpAddress: ip, - PhysAddress: net.HardwareAddr(arpDetails.MacAddress).String(), - Static: uintToBool(arpDetails.IsStatic), - } - // ARP meta - meta := &vppcalls.ArpMeta{ - SwIfIndex: arpDetails.SwIfIndex, - } - - entries = append(entries, &vppcalls.ArpDetails{ - Arp: arp, - Meta: meta, - }) - } - - return entries, nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/arp_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/arp_vppcalls.go deleted file mode 100644 index 44669f6d00..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/arp_vppcalls.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "net" - - "github.com/pkg/errors" - - l3 "github.com/ligato/vpp-agent/api/models/vpp/l3" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" -) - -// vppAddDelArp adds or removes ARP entry according to provided input -func (h *ArpVppHandler) vppAddDelArp(entry *l3.ARPEntry, delete bool) error { - meta, found := h.ifIndexes.LookupByName(entry.Interface) - if !found { - return errors.Errorf("interface %s not found", entry.Interface) - } - - req := &ip.IPNeighborAddDel{ - SwIfIndex: meta.SwIfIndex, - IsNoAdjFib: 1, - IsAdd: boolToUint(!delete), - IsStatic: boolToUint(entry.Static), - } - - ipAddr := net.ParseIP(entry.IpAddress) - if ipAddr == nil { - return errors.Errorf("invalid IP address: %q", entry.IpAddress) - } - if ipAddr.To4() == nil { - req.IsIPv6 = 1 - req.DstAddress = []byte(ipAddr.To16()) - } else { - req.IsIPv6 = 0 - req.DstAddress = []byte(ipAddr.To4()) - } - - macAddr, err := net.ParseMAC(entry.PhysAddress) - if err != nil { - return err - } - req.MacAddress = []byte(macAddr) - - reply := &ip.IPNeighborAddDelReply{} - if err = h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// VppAddArp implements arp handler. -func (h *ArpVppHandler) VppAddArp(entry *l3.ARPEntry) error { - return h.vppAddDelArp(entry, false) -} - -// VppDelArp implements arp handler. -func (h *ArpVppHandler) VppDelArp(entry *l3.ARPEntry) error { - return h.vppAddDelArp(entry, true) -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/ipneigh_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/ipneigh_vppcalls.go deleted file mode 100644 index 269c1b2350..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/ipneigh_vppcalls.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "regexp" - "strconv" - - "github.com/pkg/errors" - - l3 "github.com/ligato/vpp-agent/api/models/vpp/l3" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" -) - -// SetIPScanNeighbor implements ip neigh handler. -func (h *IPNeighHandler) SetIPScanNeighbor(data *l3.IPScanNeighbor) error { - req := &ip.IPScanNeighborEnableDisable{ - Mode: uint8(data.Mode), - ScanInterval: uint8(data.ScanInterval), - MaxProcTime: uint8(data.MaxProcTime), - MaxUpdate: uint8(data.MaxUpdate), - ScanIntDelay: uint8(data.ScanIntDelay), - StaleThreshold: uint8(data.StaleThreshold), - } - reply := &ip.IPScanNeighborEnableDisableReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -var ( - /* - --- - IP neighbor scan disabled - current time is 5.5101 sec - --- - IP neighbor scan enabled for IPv4 neighbors - current time is 95133.3063 sec - Full_scan_interval: 1 min Stale_purge_threshod: 4 min - Max_process_time: 20 usec Max_updates 10 Delay_to_resume_after_max_limit: 231 msec - --- - IP neighbor scan enabled for IPv4 and IPv6 neighbors - current time is 95.6033 sec - Full_scan_interval: 1 min Stale_purge_threshod: 4 min - Max_process_time: 20 usec Max_updates 10 Delay_to_resume_after_max_limit: 1 msec - */ - cliIPScanNeighRe = regexp.MustCompile(`IP neighbor scan (disabled|enabled)(?: for (IPv4|IPv6|IPv4 and IPv6) neighbors)? - current time is [0-9\.]+ sec(?: -\s+Full_scan_interval: ([0-9]+) min\s+Stale_purge_threshod: ([0-9]+) min -\s+Max_process_time: ([0-9]+) usec\s+Max_updates ([0-9]+)\s+Delay_to_resume_after_max_limit: ([0-9]+) msec)?`) -) - -// GetIPScanNeighbor dumps current IP Scan Neighbor configuration. -func (h *IPNeighHandler) GetIPScanNeighbor() (*l3.IPScanNeighbor, error) { - data, err := h.RunCli("show ip scan-neighbor") - if err != nil { - return nil, err - } - - ipScanNeigh := &l3.IPScanNeighbor{} - - matches := cliIPScanNeighRe.FindStringSubmatch(string(data)) - - if len(matches) != 8 { - h.log.Warnf("invalid 'show ip scan-neighbor' output: %q", string(data)) - return nil, errors.Errorf("invalid 'show ip scan-neighbor' output") - } - - if matches[1] == "enabled" { - switch matches[2] { - case "IPv4": - ipScanNeigh.Mode = l3.IPScanNeighbor_IPv4 - case "IPv6": - ipScanNeigh.Mode = l3.IPScanNeighbor_IPv6 - case "IPv4 and IPv6": - ipScanNeigh.Mode = l3.IPScanNeighbor_BOTH - } - } - ipScanNeigh.ScanInterval = h.strToUint32(matches[3]) - ipScanNeigh.StaleThreshold = h.strToUint32(matches[4]) - ipScanNeigh.MaxProcTime = h.strToUint32(matches[5]) - ipScanNeigh.MaxUpdate = h.strToUint32(matches[6]) - ipScanNeigh.ScanIntDelay = h.strToUint32(matches[7]) - - return ipScanNeigh, nil -} - -func (h *IPNeighHandler) strToUint32(s string) uint32 { - if s == "" { - return 0 - } - n, err := strconv.ParseUint(s, 10, 32) - if err != nil { - h.log.Error(err) - } - return uint32(n) -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/proxyarp_dump.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/proxyarp_dump.go deleted file mode 100644 index 525a93c678..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/proxyarp_dump.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "fmt" - "net" - - l3 "github.com/ligato/vpp-agent/api/models/vpp/l3" - l3binapi "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" - "github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls" -) - -// DumpProxyArpRanges implements proxy arp handler. -func (h *ProxyArpVppHandler) DumpProxyArpRanges() (pArpRngs []*vppcalls.ProxyArpRangesDetails, err error) { - reqCtx := h.callsChannel.SendMultiRequest(&l3binapi.ProxyArpDump{}) - - for { - proxyArpDetails := &l3binapi.ProxyArpDetails{} - stop, err := reqCtx.ReceiveReply(proxyArpDetails) - if stop { - break - } - if err != nil { - h.log.Error(err) - return nil, err - } - - pArpRngs = append(pArpRngs, &vppcalls.ProxyArpRangesDetails{ - Range: &l3.ProxyARP_Range{ - FirstIpAddr: fmt.Sprintf("%s", net.IP(proxyArpDetails.Proxy.LowAddress[:4]).To4().String()), - LastIpAddr: fmt.Sprintf("%s", net.IP(proxyArpDetails.Proxy.HiAddress[:4]).To4().String()), - }, - }) - } - - return pArpRngs, nil -} - -// DumpProxyArpInterfaces implements proxy arp handler. -func (h *ProxyArpVppHandler) DumpProxyArpInterfaces() (pArpIfs []*vppcalls.ProxyArpInterfaceDetails, err error) { - reqCtx := h.callsChannel.SendMultiRequest(&l3binapi.ProxyArpIntfcDump{}) - - for { - proxyArpDetails := &l3binapi.ProxyArpIntfcDetails{} - stop, err := reqCtx.ReceiveReply(proxyArpDetails) - if stop { - break - } - if err != nil { - h.log.Error(err) - return nil, err - } - - // Interface - ifName, _, exists := h.ifIndexes.LookupBySwIfIndex(proxyArpDetails.SwIfIndex) - if !exists { - h.log.Warnf("Proxy ARP interface dump: missing name for interface index %d", proxyArpDetails.SwIfIndex) - } - - // Create entry - pArpIfs = append(pArpIfs, &vppcalls.ProxyArpInterfaceDetails{ - Interface: &l3.ProxyARP_Interface{ - Name: ifName, - }, - Meta: &vppcalls.ProxyArpInterfaceMeta{ - SwIfIndex: proxyArpDetails.SwIfIndex, - }, - }) - - } - - return pArpIfs, nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/proxyarp_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/proxyarp_vppcalls.go deleted file mode 100644 index 30d397d3da..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/proxyarp_vppcalls.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "github.com/pkg/errors" - - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" -) - -// EnableProxyArpInterface implements proxy arp handler. -func (h *ProxyArpVppHandler) EnableProxyArpInterface(ifName string) error { - return h.vppAddDelProxyArpInterface(ifName, true) -} - -// DisableProxyArpInterface implements proxy arp handler. -func (h *ProxyArpVppHandler) DisableProxyArpInterface(ifName string) error { - return h.vppAddDelProxyArpInterface(ifName, false) -} - -// AddProxyArpRange implements proxy arp handler. -func (h *ProxyArpVppHandler) AddProxyArpRange(firstIP, lastIP []byte) error { - return h.vppAddDelProxyArpRange(firstIP, lastIP, true) -} - -// DeleteProxyArpRange implements proxy arp handler. -func (h *ProxyArpVppHandler) DeleteProxyArpRange(firstIP, lastIP []byte) error { - return h.vppAddDelProxyArpRange(firstIP, lastIP, false) -} - -// vppAddDelProxyArpInterface adds or removes proxy ARP interface entry according to provided input -func (h *ProxyArpVppHandler) vppAddDelProxyArpInterface(ifName string, enable bool) error { - meta, found := h.ifIndexes.LookupByName(ifName) - if !found { - return errors.Errorf("interface %s not found", ifName) - } - - req := &ip.ProxyArpIntfcEnableDisable{ - EnableDisable: boolToUint(enable), - SwIfIndex: meta.SwIfIndex, - } - - reply := &ip.ProxyArpIntfcEnableDisableReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - h.log.Debugf("interface %v enabled for proxy arp: %v", req.SwIfIndex, enable) - - return nil -} - -// vppAddDelProxyArpRange adds or removes proxy ARP range according to provided input -func (h *ProxyArpVppHandler) vppAddDelProxyArpRange(firstIP, lastIP []byte, isAdd bool) error { - req := &ip.ProxyArpAddDel{ - IsAdd: boolToUint(isAdd), - Proxy: ip.ProxyArp{ - VrfID: 0, // TODO: add support for VRF - LowAddress: firstIP, - HiAddress: lastIP, - }, - } - - reply := &ip.ProxyArpAddDelReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - h.log.Debugf("proxy arp range: %v - %v added: %v", req.Proxy.LowAddress, req.Proxy.HiAddress, isAdd) - - return nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/route_dump.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/route_dump.go deleted file mode 100644 index c0c21d3bb3..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/route_dump.go +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "bytes" - "fmt" - "net" - - l3 "github.com/ligato/vpp-agent/api/models/vpp/l3" - l3binapi "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" - "github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls" -) - -// DumpRoutes implements route handler. -func (h *RouteHandler) DumpRoutes() ([]*vppcalls.RouteDetails, error) { - var routes []*vppcalls.RouteDetails - // Dump IPv4 l3 FIB. - reqCtx := h.callsChannel.SendMultiRequest(&l3binapi.IPFibDump{}) - for { - fibDetails := &l3binapi.IPFibDetails{} - stop, err := reqCtx.ReceiveReply(fibDetails) - if stop { - break - } - if err != nil { - return nil, err - } - ipv4Route, err := h.dumpRouteIPv4Details(fibDetails) - if err != nil { - return nil, err - } - routes = append(routes, ipv4Route...) - } - - // Dump IPv6 l3 FIB. - reqCtx = h.callsChannel.SendMultiRequest(&l3binapi.IP6FibDump{}) - for { - fibDetails := &l3binapi.IP6FibDetails{} - stop, err := reqCtx.ReceiveReply(fibDetails) - if stop { - break - } - if err != nil { - return nil, err - } - ipv6Route, err := h.dumpRouteIPv6Details(fibDetails) - if err != nil { - return nil, err - } - routes = append(routes, ipv6Route...) - } - - return routes, nil -} - -func (h *RouteHandler) dumpRouteIPv4Details(fibDetails *l3binapi.IPFibDetails) ([]*vppcalls.RouteDetails, error) { - return h.dumpRouteIPDetails(fibDetails.TableID, fibDetails.TableName, fibDetails.Address, fibDetails.AddressLength, fibDetails.Path, false) -} - -func (h *RouteHandler) dumpRouteIPv6Details(fibDetails *l3binapi.IP6FibDetails) ([]*vppcalls.RouteDetails, error) { - return h.dumpRouteIPDetails(fibDetails.TableID, fibDetails.TableName, fibDetails.Address, fibDetails.AddressLength, fibDetails.Path, true) -} - -// dumpRouteIPDetails processes static route details and returns a route objects. Number of routes returned -// depends on size of path list. -func (h *RouteHandler) dumpRouteIPDetails(tableID uint32, tableName []byte, address []byte, prefixLen uint8, paths []l3binapi.FibPath, ipv6 bool) ([]*vppcalls.RouteDetails, error) { - // Common fields for every route path (destination IP, VRF) - var dstIP string - if ipv6 { - dstIP = fmt.Sprintf("%s/%d", net.IP(address).To16().String(), uint32(prefixLen)) - } else { - dstIP = fmt.Sprintf("%s/%d", net.IP(address[:4]).To4().String(), uint32(prefixLen)) - } - - var routeDetails []*vppcalls.RouteDetails - - // Paths - if len(paths) > 0 { - for _, path := range paths { - // Next hop IP address - var nextHopIP string - if ipv6 { - nextHopIP = fmt.Sprintf("%s", net.IP(path.NextHop).To16().String()) - } else { - nextHopIP = fmt.Sprintf("%s", net.IP(path.NextHop[:4]).To4().String()) - } - - // Route type (if via VRF is used) - var routeType l3.Route_RouteType - var viaVrfID uint32 - if uintToBool(path.IsDrop) { - routeType = l3.Route_DROP - } else if path.SwIfIndex == NextHopOutgoingIfUnset && path.TableID != tableID { - // outgoing interface not specified and path table is not equal to route table id = inter-VRF route - routeType = l3.Route_INTER_VRF - viaVrfID = path.TableID - } else { - routeType = l3.Route_INTRA_VRF // default - } - - // Outgoing interface - var ifName string - var ifIdx uint32 - if path.SwIfIndex == NextHopOutgoingIfUnset { - ifIdx = NextHopOutgoingIfUnset - } else { - var exists bool - ifIdx = path.SwIfIndex - if ifName, _, exists = h.ifIndexes.LookupBySwIfIndex(path.SwIfIndex); !exists { - h.log.Warnf("Static route dump: interface name for index %d not found", path.SwIfIndex) - } - } - - // Route configuration - route := &l3.Route{ - Type: routeType, - VrfId: tableID, - DstNetwork: dstIP, - NextHopAddr: nextHopIP, - OutgoingInterface: ifName, - Weight: uint32(path.Weight), - Preference: uint32(path.Preference), - ViaVrfId: viaVrfID, - } - - labelStack := make([]vppcalls.FibMplsLabel, len(path.LabelStack)) - for i, l := range path.LabelStack { - labelStack[i] = vppcalls.FibMplsLabel{ - IsUniform: uintToBool(l.IsUniform), - Label: l.Label, - TTL: l.TTL, - Exp: l.Exp, - } - } - - // Route metadata - meta := &vppcalls.RouteMeta{ - TableName: string(bytes.SplitN(tableName, []byte{0x00}, 2)[0]), - OutgoingIfIdx: ifIdx, - NextHopID: path.NextHopID, - IsIPv6: ipv6, - RpfID: path.RpfID, - Afi: path.Afi, - IsLocal: uintToBool(path.IsLocal), - IsUDPEncap: uintToBool(path.IsUDPEncap), - IsDvr: uintToBool(path.IsDvr), - IsProhibit: uintToBool(path.IsProhibit), - IsResolveAttached: uintToBool(path.IsResolveAttached), - IsResolveHost: uintToBool(path.IsResolveHost), - IsSourceLookup: uintToBool(path.IsSourceLookup), - IsUnreach: uintToBool(path.IsUnreach), - LabelStack: labelStack, - } - - routeDetails = append(routeDetails, &vppcalls.RouteDetails{ - Route: route, - Meta: meta, - }) - } - } else { - // Return route without path fields, but this is not a valid configuration - h.log.Warnf("Route with destination IP %s (VRF %d) has no path specified", dstIP, tableID) - route := &l3.Route{ - Type: l3.Route_INTRA_VRF, // default - VrfId: tableID, - DstNetwork: dstIP, - } - meta := &vppcalls.RouteMeta{ - TableName: string(bytes.SplitN(tableName, []byte{0x00}, 2)[0]), - } - routeDetails = append(routeDetails, &vppcalls.RouteDetails{ - Route: route, - Meta: meta, - }) - } - - return routeDetails, nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/route_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/route_vppcalls.go deleted file mode 100644 index c51e92ac15..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/route_vppcalls.go +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "net" - - "github.com/ligato/cn-infra/utils/addrs" - "github.com/pkg/errors" - - "github.com/ligato/vpp-agent/api/models/vpp/l3" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" -) - -const ( - // NextHopViaLabelUnset constant has to be assigned into the field next hop - // via label in ip_add_del_route binary message if next hop via label is not defined. - // Equals to MPLS_LABEL_INVALID defined in VPP - NextHopViaLabelUnset uint32 = 0xfffff + 1 - - // ClassifyTableIndexUnset is a default value for field classify_table_index in ip_add_del_route binary message. - ClassifyTableIndexUnset = ^uint32(0) - - // NextHopOutgoingIfUnset constant has to be assigned into the field next_hop_outgoing_interface - // in ip_add_del_route binary message if outgoing interface for next hop is not defined. - NextHopOutgoingIfUnset = ^uint32(0) -) - -// vppAddDelRoute adds or removes route, according to provided input. Every route has to contain VRF ID (default is 0). -func (h *RouteHandler) vppAddDelRoute(route *vpp_l3.Route, rtIfIdx uint32, delete bool) error { - req := &ip.IPAddDelRoute{} - if delete { - req.IsAdd = 0 - } else { - req.IsAdd = 1 - } - - // Destination address (route set identifier) - parsedDstIP, isIpv6, err := addrs.ParseIPWithPrefix(route.DstNetwork) - if err != nil { - return err - } - parsedNextHopIP := net.ParseIP(route.NextHopAddr) - prefix, _ := parsedDstIP.Mask.Size() - if isIpv6 { - req.IsIPv6 = 1 - req.DstAddress = []byte(parsedDstIP.IP.To16()) - req.NextHopAddress = []byte(parsedNextHopIP.To16()) - } else { - req.IsIPv6 = 0 - req.DstAddress = []byte(parsedDstIP.IP.To4()) - req.NextHopAddress = []byte(parsedNextHopIP.To4()) - } - req.DstAddressLength = byte(prefix) - - // Common route parameters - req.NextHopWeight = uint8(route.Weight) - req.NextHopPreference = uint8(route.Preference) - req.NextHopViaLabel = NextHopViaLabelUnset - req.ClassifyTableIndex = ClassifyTableIndexUnset - - // VRF/Other route parameters based on type - req.TableID = route.VrfId - if route.Type == vpp_l3.Route_INTER_VRF { - req.NextHopSwIfIndex = rtIfIdx - req.NextHopTableID = route.ViaVrfId - } else if route.Type == vpp_l3.Route_DROP { - req.IsDrop = 1 - } else { - req.NextHopSwIfIndex = rtIfIdx - req.NextHopTableID = route.VrfId - } - - // Multi path is always true - req.IsMultipath = 1 - - // Send message - reply := &ip.IPAddDelRouteReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// VppAddRoute implements route handler. -func (h *RouteHandler) VppAddRoute(route *vpp_l3.Route) error { - swIfIdx, err := h.getRouteSwIfIndex(route.OutgoingInterface) - if err != nil { - return err - } - - return h.vppAddDelRoute(route, swIfIdx, false) -} - -// VppDelRoute implements route handler. -func (h *RouteHandler) VppDelRoute(route *vpp_l3.Route) error { - swIfIdx, err := h.getRouteSwIfIndex(route.OutgoingInterface) - if err != nil { - return err - } - - return h.vppAddDelRoute(route, swIfIdx, true) -} - -func (h *RouteHandler) getRouteSwIfIndex(ifName string) (swIfIdx uint32, err error) { - swIfIdx = NextHopOutgoingIfUnset - if ifName != "" { - meta, found := h.ifIndexes.LookupByName(ifName) - if !found { - return 0, errors.Errorf("interface %s not found", ifName) - } - swIfIdx = meta.SwIfIndex - } - return -} \ No newline at end of file diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/vppcalls_handlers.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/vppcalls_handlers.go deleted file mode 100644 index 3b759494c7..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/vppcalls_handlers.go +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - govppapi "git.fd.io/govpp.git/api" - "github.com/ligato/cn-infra/logging" - "github.com/ligato/cn-infra/logging/logrus" - - vpevppcalls "github.com/ligato/vpp-agent/plugins/govppmux/vppcalls" - "github.com/ligato/vpp-agent/plugins/govppmux/vppcalls/vpp1810" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vpe" - "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifaceidx" - "github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls" -) - -func init() { - var msgs []govppapi.Message - msgs = append(msgs, ip.Messages...) - msgs = append(msgs, vpe.Messages...) - - vppcalls.Versions["vpp1810"] = vppcalls.HandlerVersion{ - Msgs: msgs, - New: NewL3VppHandler, - } -} - -type L3VppHandler struct { - *ArpVppHandler - *ProxyArpVppHandler - *RouteHandler - *IPNeighHandler - *VrfTableHandler -} - -func NewL3VppHandler(ch govppapi.Channel, ifIdx ifaceidx.IfaceMetadataIndex, log logging.Logger) vppcalls.L3VppAPI { - return &L3VppHandler{ - ArpVppHandler: NewArpVppHandler(ch, ifIdx, log), - ProxyArpVppHandler: NewProxyArpVppHandler(ch, ifIdx, log), - RouteHandler: NewRouteVppHandler(ch, ifIdx, log), - IPNeighHandler: NewIPNeighVppHandler(ch, log), - VrfTableHandler: NewVrfTableVppHandler(ch, log), - } -} - -// ArpVppHandler is accessor for ARP-related vppcalls methods -type ArpVppHandler struct { - callsChannel govppapi.Channel - ifIndexes ifaceidx.IfaceMetadataIndex - log logging.Logger -} - -// ProxyArpVppHandler is accessor for proxy ARP-related vppcalls methods -type ProxyArpVppHandler struct { - callsChannel govppapi.Channel - ifIndexes ifaceidx.IfaceMetadataIndex - log logging.Logger -} - -// RouteHandler is accessor for route-related vppcalls methods -type RouteHandler struct { - callsChannel govppapi.Channel - ifIndexes ifaceidx.IfaceMetadataIndex - log logging.Logger -} - -// IPNeighHandler is accessor for ip-neighbor-related vppcalls methods -type IPNeighHandler struct { - callsChannel govppapi.Channel - log logging.Logger - vpevppcalls.VpeVppAPI -} - -// VrfTableHandler is accessor for vrf-related vppcalls methods -type VrfTableHandler struct { - callsChannel govppapi.Channel - log logging.Logger -} - -// NewArpVppHandler creates new instance of IPsec vppcalls handler -func NewArpVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.IfaceMetadataIndex, log logging.Logger) *ArpVppHandler { - if log == nil { - log = logrus.NewLogger("arp-handler") - } - return &ArpVppHandler{ - callsChannel: callsChan, - ifIndexes: ifIndexes, - log: log, - } -} - -// NewProxyArpVppHandler creates new instance of proxy ARP vppcalls handler -func NewProxyArpVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.IfaceMetadataIndex, log logging.Logger) *ProxyArpVppHandler { - if log == nil { - log = logrus.NewLogger("proxy-arp-handler") - } - return &ProxyArpVppHandler{ - callsChannel: callsChan, - ifIndexes: ifIndexes, - log: log, - } -} - -// NewRouteVppHandler creates new instance of route vppcalls handler -func NewRouteVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.IfaceMetadataIndex, log logging.Logger) *RouteHandler { - if log == nil { - log = logrus.NewLogger("route-handler") - } - return &RouteHandler{ - callsChannel: callsChan, - ifIndexes: ifIndexes, - log: log, - } -} - -// NewIPNeighVppHandler creates new instance of ip neighbor vppcalls handler -func NewIPNeighVppHandler(callsChan govppapi.Channel, log logging.Logger) *IPNeighHandler { - if log == nil { - log = logrus.NewLogger("ip-neigh") - } - return &IPNeighHandler{ - callsChannel: callsChan, - log: log, - VpeVppAPI: vpp1810.NewVpeHandler(callsChan), - } -} - -// NewVrfTableVppHandler creates new instance of vrf-table vppcalls handler -func NewVrfTableVppHandler(callsChan govppapi.Channel, log logging.Logger) *VrfTableHandler { - if log == nil { - log = logrus.NewLogger("vrf-table-handler") - } - return &VrfTableHandler{ - callsChannel: callsChan, - log: log, - } -} - -func uintToBool(value uint8) bool { - if value == 0 { - return false - } - return true -} - -func boolToUint(input bool) uint8 { - if input { - return 1 - } - return 0 -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/vrf_dump.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/vrf_dump.go deleted file mode 100644 index ac7ae08aa0..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/vrf_dump.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "bytes" - - l3 "github.com/ligato/vpp-agent/api/models/vpp/l3" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" -) - -// DumpVrfTables dumps all configured VRF tables. -func (h *VrfTableHandler) DumpVrfTables() (tables []*l3.VrfTable, err error) { - // dump IPv4 VRF tables - v4Tables := make(map[uint32]*l3.VrfTable) - reqCtx := h.callsChannel.SendMultiRequest(&ip.IPFibDump{}) - for { - fibDetails := &ip.IPFibDetails{} - stop, err := reqCtx.ReceiveReply(fibDetails) - if stop { - break - } - if err != nil { - return nil, err - } - if _, dumped := v4Tables[fibDetails.TableID]; !dumped { - v4Tables[fibDetails.TableID] = &l3.VrfTable{ - Id: fibDetails.TableID, - Protocol: l3.VrfTable_IPV4, - Label: bytesToString(fibDetails.TableName), - } - } - } - - // dump IPv6 VRF tables - v6Tables := make(map[uint32]*l3.VrfTable) - reqCtx = h.callsChannel.SendMultiRequest(&ip.IP6FibDump{}) - for { - fibDetails := &ip.IP6FibDetails{} - stop, err := reqCtx.ReceiveReply(fibDetails) - if stop { - break - } - if err != nil { - return nil, err - } - if _, dumped := v6Tables[fibDetails.TableID]; !dumped { - v6Tables[fibDetails.TableID] = &l3.VrfTable{ - Id: fibDetails.TableID, - Protocol: l3.VrfTable_IPV6, - Label: bytesToString(fibDetails.TableName), - } - } - } - - for _, table := range v4Tables { - tables = append(tables, table) - } - for _, table := range v6Tables { - tables = append(tables, table) - } - return tables, nil -} - -func bytesToString(b []byte) string { - return string(bytes.SplitN(b, []byte{0x00}, 2)[0]) -} \ No newline at end of file diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/vrf_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/vrf_vppcalls.go deleted file mode 100644 index f8b2809f51..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/l3plugin/vppcalls/vpp1810/vrf_vppcalls.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - l3 "github.com/ligato/vpp-agent/api/models/vpp/l3" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" -) - -// AddVrfTable adds new VRF table. -func (h *VrfTableHandler) AddVrfTable(table *l3.VrfTable) error { - return h.addDelVrfTable(table, true) -} - -// DelVrfTable deletes existing VRF table. -func (h *VrfTableHandler) DelVrfTable(table *l3.VrfTable) error { - return h.addDelVrfTable(table, false) -} - -func (h *VrfTableHandler) addDelVrfTable(table *l3.VrfTable, isAdd bool) error { - req := &ip.IPTableAddDel{ - TableID: table.Id, - IsIPv6: boolToUint(table.GetProtocol() == l3.VrfTable_IPV6), - Name: []byte(table.Label), - IsAdd: boolToUint(isAdd), - } - reply := &ip.IPTableAddDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/natplugin/natplugin.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/natplugin/natplugin.go index 0f0f8f6119..bd71ed1cf6 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/natplugin/natplugin.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/natplugin/natplugin.go @@ -32,7 +32,6 @@ import ( "github.com/ligato/vpp-agent/plugins/vpp/natplugin/descriptor" "github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls" - _ "github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls/vpp1810" _ "github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls/vpp1901" _ "github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls/vpp1904" ) @@ -88,7 +87,6 @@ func (p *NATPlugin) Init() error { return err } - return nil } diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls/vpp1810/dump_nat_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls/vpp1810/dump_nat_vppcalls.go deleted file mode 100644 index 76579e4fbe..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls/vpp1810/dump_nat_vppcalls.go +++ /dev/null @@ -1,548 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "bytes" - "fmt" - "net" - "sort" - "strings" - - "github.com/gogo/protobuf/proto" - - interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces" - nat "github.com/ligato/vpp-agent/api/models/vpp/nat" - ba_nat "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/nat" - "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifaceidx" -) - -// DNATs sorted by tags -type dnatMap map[string]*nat.DNat44 - -// static mappings sorted by tags -type stMappingMap map[string][]*nat.DNat44_StaticMapping - -// identity mappings sorted by tags -type idMappingMap map[string][]*nat.DNat44_IdentityMapping - -// Nat44GlobalConfigDump dumps global NAT44 config in NB format. -func (h *NatVppHandler) Nat44GlobalConfigDump() (*nat.Nat44Global, error) { - isEnabled, err := h.isNat44ForwardingEnabled() - if err != nil { - return nil, err - } - natInterfaces, err := h.nat44InterfaceDump() - if err != nil { - return nil, err - } - natAddressPool, err := h.nat44AddressDump() - if err != nil { - return nil, err - } - vrIPv4, _, err := h.virtualReassemblyDump() - if err != nil { - return nil, err - } - - // combine into the global NAT configuration - return &nat.Nat44Global{ - Forwarding: isEnabled, - NatInterfaces: natInterfaces, - AddressPool: natAddressPool, - VirtualReassembly: vrIPv4, - }, nil -} - -// DNat44Dump dumps all configured DNAT-44 configurations ordered by label. -func (h *NatVppHandler) DNat44Dump() (dnats []*nat.DNat44, err error) { - dnatMap := make(dnatMap) - - // Static mappings - natStMappings, err := h.nat44StaticMappingDump() - if err != nil { - return nil, fmt.Errorf("failed to dump NAT44 static mappings: %v", err) - } - for label, mappings := range natStMappings { - dnat := getOrCreateDNAT(dnatMap, label) - dnat.StMappings = append(dnat.StMappings, mappings...) - } - - // Static mappings with load balancer - natStLbMappings, err := h.nat44StaticMappingLbDump() - if err != nil { - return nil, fmt.Errorf("failed to dump NAT44 static mappings with load balancer: %v", err) - } - for label, mappings := range natStLbMappings { - dnat := getOrCreateDNAT(dnatMap, label) - dnat.StMappings = append(dnat.StMappings, mappings...) - } - - // Identity mappings - natIDMappings, err := h.nat44IdentityMappingDump() - if err != nil { - return nil, fmt.Errorf("failed to dump NAT44 identity mappings: %v", err) - } - for label, mappings := range natIDMappings { - dnat := getOrCreateDNAT(dnatMap, label) - dnat.IdMappings = append(dnat.IdMappings, mappings...) - } - - // Convert map of DNAT configurations into a list. - for _, dnat := range dnatMap { - dnats = append(dnats, dnat) - } - - // sort to simplify testing - sort.Slice(dnats, func(i, j int) bool { return dnats[i].Label < dnats[j].Label }) - - return dnats, nil -} - -// nat44AddressDump returns NAT44 address pool configured in the VPP. -func (h *NatVppHandler) nat44AddressDump() (addressPool []*nat.Nat44Global_Address, err error) { - req := &ba_nat.Nat44AddressDump{} - reqContext := h.callsChannel.SendMultiRequest(req) - - for { - msg := &ba_nat.Nat44AddressDetails{} - stop, err := reqContext.ReceiveReply(msg) - if err != nil { - return nil, fmt.Errorf("failed to dump NAT44 Address pool: %v", err) - } - if stop { - break - } - - ipAddress := net.IP(msg.IPAddress) - - addressPool = append(addressPool, &nat.Nat44Global_Address{ - Address: ipAddress.To4().String(), - VrfId: msg.VrfID, - TwiceNat: uintToBool(msg.TwiceNat), - }) - } - - return -} - -// virtualReassemblyDump returns current NAT virtual-reassembly configuration. -func (h *NatVppHandler) virtualReassemblyDump() (vrIPv4 *nat.VirtualReassembly, vrIPv6 *nat.VirtualReassembly, err error) { - req := &ba_nat.NatGetReass{} - reply := &ba_nat.NatGetReassReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return nil, nil, fmt.Errorf("failed to get NAT virtual reassembly configuration: %v", err) - } - - vrIPv4 = &nat.VirtualReassembly{ - Timeout: reply.IP4Timeout, - MaxReassemblies: uint32(reply.IP4MaxReass), - MaxFragments: uint32(reply.IP4MaxFrag), - DropFragments: uintToBool(reply.IP4DropFrag), - } - vrIPv6 = &nat.VirtualReassembly{ - Timeout: reply.IP6Timeout, - MaxReassemblies: uint32(reply.IP6MaxReass), - MaxFragments: uint32(reply.IP6MaxFrag), - DropFragments: uintToBool(reply.IP6DropFrag), - } - - return -} - -// nat44StaticMappingDump returns a map of NAT44 static mappings sorted by tags -func (h *NatVppHandler) nat44StaticMappingDump() (entries stMappingMap, err error) { - entries = make(stMappingMap) - childMappings := make(stMappingMap) - req := &ba_nat.Nat44StaticMappingDump{} - reqContext := h.callsChannel.SendMultiRequest(req) - - for { - msg := &ba_nat.Nat44StaticMappingDetails{} - stop, err := reqContext.ReceiveReply(msg) - if err != nil { - return nil, fmt.Errorf("failed to dump NAT44 static mapping: %v", err) - } - if stop { - break - } - lcIPAddress := net.IP(msg.LocalIPAddress) - exIPAddress := net.IP(msg.ExternalIPAddress) - - // Parse tag (DNAT label) - tag := string(bytes.SplitN(msg.Tag, []byte{0x00}, 2)[0]) - if _, hasTag := entries[tag]; !hasTag { - entries[tag] = []*nat.DNat44_StaticMapping{} - childMappings[tag] = []*nat.DNat44_StaticMapping{} - } - - // resolve interface name - var ( - found bool - extIfaceName string - extIfaceMeta *ifaceidx.IfaceMetadata - ) - if msg.ExternalSwIfIndex != noInterface { - extIfaceName, extIfaceMeta, found = h.ifIndexes.LookupBySwIfIndex(msg.ExternalSwIfIndex) - if !found { - h.log.Warnf("Interface with index %v not found in the mapping", msg.ExternalSwIfIndex) - continue - } - } - - // Add mapping into the map. - mapping := &nat.DNat44_StaticMapping{ - ExternalInterface: extIfaceName, - ExternalPort: uint32(msg.ExternalPort), - LocalIps: []*nat.DNat44_StaticMapping_LocalIP{ // single-value - { - VrfId: msg.VrfID, - LocalIp: lcIPAddress.To4().String(), - LocalPort: uint32(msg.LocalPort), - }, - }, - Protocol: h.protocolNumberToNBValue(msg.Protocol), - TwiceNat: h.getTwiceNatMode(msg.TwiceNat, msg.SelfTwiceNat), - // if there is only one backend the affinity can not be set - SessionAffinity: 0, - } - if !exIPAddress.IsUnspecified() { - mapping.ExternalIp = exIPAddress.To4().String() - } - entries[tag] = append(entries[tag], mapping) - - if msg.ExternalSwIfIndex != noInterface { - // collect auto-generated "child" mappings (interface replaced with every assigned IP address) - for _, ipAddr := range h.getInterfaceIPAddresses(extIfaceName, extIfaceMeta) { - childMapping := proto.Clone(mapping).(*nat.DNat44_StaticMapping) - childMapping.ExternalIp = ipAddr - childMapping.ExternalInterface = "" - childMappings[tag] = append(childMappings[tag], childMapping) - } - } - } - - // do not dump auto-generated child mappings - for tag, mappings := range entries { - var filtered []*nat.DNat44_StaticMapping - for _, mapping := range mappings { - isChild := false - for _, child := range childMappings[tag] { - if proto.Equal(mapping, child) { - isChild = true - break - } - } - if !isChild { - filtered = append(filtered, mapping) - } - } - entries[tag] = filtered - } - return entries, nil -} - -// nat44StaticMappingLbDump returns a map of NAT44 static mapping with load balancing sorted by tags. -func (h *NatVppHandler) nat44StaticMappingLbDump() (entries stMappingMap, err error) { - entries = make(stMappingMap) - req := &ba_nat.Nat44LbStaticMappingDump{} - reqContext := h.callsChannel.SendMultiRequest(req) - - for { - msg := &ba_nat.Nat44LbStaticMappingDetails{} - stop, err := reqContext.ReceiveReply(msg) - if err != nil { - return nil, fmt.Errorf("failed to dump NAT44 lb-static mapping: %v", err) - } - if stop { - break - } - - // Parse tag (DNAT label) - tag := string(bytes.SplitN(msg.Tag, []byte{0x00}, 2)[0]) - if _, hasTag := entries[tag]; !hasTag { - entries[tag] = []*nat.DNat44_StaticMapping{} - } - - // Prepare localIPs - var locals []*nat.DNat44_StaticMapping_LocalIP - for _, localIPVal := range msg.Locals { - localIP := net.IP(localIPVal.Addr) - locals = append(locals, &nat.DNat44_StaticMapping_LocalIP{ - VrfId: localIPVal.VrfID, - LocalIp: localIP.To4().String(), - LocalPort: uint32(localIPVal.Port), - Probability: uint32(localIPVal.Probability), - }) - } - exIPAddress := net.IP(msg.ExternalAddr) - - // Add mapping into the map. - mapping := &nat.DNat44_StaticMapping{ - ExternalPort: uint32(msg.ExternalPort), - LocalIps: locals, - Protocol: h.protocolNumberToNBValue(msg.Protocol), - TwiceNat: h.getTwiceNatMode(msg.TwiceNat, msg.SelfTwiceNat), - SessionAffinity: msg.Affinity, - } - if !exIPAddress.IsUnspecified() { - mapping.ExternalIp = exIPAddress.To4().String() - } - entries[tag] = append(entries[tag], mapping) - } - - return entries, nil -} - -// nat44IdentityMappingDump returns a map of NAT44 identity mappings sorted by tags. -func (h *NatVppHandler) nat44IdentityMappingDump() (entries idMappingMap, err error) { - entries = make(idMappingMap) - childMappings := make(idMappingMap) - req := &ba_nat.Nat44IdentityMappingDump{} - reqContext := h.callsChannel.SendMultiRequest(req) - - for { - msg := &ba_nat.Nat44IdentityMappingDetails{} - stop, err := reqContext.ReceiveReply(msg) - if err != nil { - return nil, fmt.Errorf("failed to dump NAT44 identity mapping: %v", err) - } - if stop { - break - } - - ipAddress := net.IP(msg.IPAddress) - - // Parse tag (DNAT label) - tag := string(bytes.SplitN(msg.Tag, []byte{0x00}, 2)[0]) - if _, hasTag := entries[tag]; !hasTag { - entries[tag] = []*nat.DNat44_IdentityMapping{} - childMappings[tag] = []*nat.DNat44_IdentityMapping{} - } - - // resolve interface name - var ( - found bool - ifaceName string - ifaceMeta *ifaceidx.IfaceMetadata - ) - if msg.SwIfIndex != noInterface { - ifaceName, ifaceMeta, found = h.ifIndexes.LookupBySwIfIndex(msg.SwIfIndex) - if !found { - h.log.Warnf("Interface with index %v not found in the mapping", msg.SwIfIndex) - continue - } - } - - // Add mapping into the map. - mapping := &nat.DNat44_IdentityMapping{ - VrfId: msg.VrfID, - Interface: ifaceName, - Port: uint32(msg.Port), - Protocol: h.protocolNumberToNBValue(msg.Protocol), - } - if !ipAddress.IsUnspecified() { - mapping.IpAddress = ipAddress.To4().String() - } - entries[tag] = append(entries[tag], mapping) - - if msg.SwIfIndex != noInterface { - // collect auto-generated "child" mappings (interface replaced with every assigned IP address) - for _, ipAddr := range h.getInterfaceIPAddresses(ifaceName, ifaceMeta) { - childMapping := proto.Clone(mapping).(*nat.DNat44_IdentityMapping) - childMapping.IpAddress = ipAddr - childMapping.Interface = "" - childMappings[tag] = append(childMappings[tag], childMapping) - } - } - } - - // do not dump auto-generated child mappings - for tag, mappings := range entries { - var filtered []*nat.DNat44_IdentityMapping - for _, mapping := range mappings { - isChild := false - for _, child := range childMappings[tag] { - if proto.Equal(mapping, child) { - isChild = true - break - } - } - if !isChild { - filtered = append(filtered, mapping) - } - } - entries[tag] = filtered - } - - return entries, nil -} - -// nat44InterfaceDump dumps NAT44 interface features. -func (h *NatVppHandler) nat44InterfaceDump() (interfaces []*nat.Nat44Global_Interface, err error) { - - /* dump non-Output interfaces first */ - req1 := &ba_nat.Nat44InterfaceDump{} - reqContext := h.callsChannel.SendMultiRequest(req1) - - for { - msg := &ba_nat.Nat44InterfaceDetails{} - stop, err := reqContext.ReceiveReply(msg) - if err != nil { - return nil, fmt.Errorf("failed to dump NAT44 interface: %v", err) - } - if stop { - break - } - - // Find interface name - ifName, _, found := h.ifIndexes.LookupBySwIfIndex(msg.SwIfIndex) - if !found { - h.log.Warnf("Interface with index %d not found in the mapping", msg.SwIfIndex) - continue - } - - if msg.IsInside == 0 || msg.IsInside == 2 { - interfaces = append(interfaces, &nat.Nat44Global_Interface{ - Name: ifName, - IsInside: false, - }) - } - if msg.IsInside == 1 || msg.IsInside == 2 { - interfaces = append(interfaces, &nat.Nat44Global_Interface{ - Name: ifName, - IsInside: true, - }) - } - } - - /* dump Output interfaces next */ - req2 := &ba_nat.Nat44InterfaceOutputFeatureDump{} - reqContext = h.callsChannel.SendMultiRequest(req2) - - for { - msg := &ba_nat.Nat44InterfaceOutputFeatureDetails{} - stop, err := reqContext.ReceiveReply(msg) - if err != nil { - return nil, fmt.Errorf("failed to dump NAT44 interface output feature: %v", err) - } - if stop { - break - } - - // Find interface name - ifName, _, found := h.ifIndexes.LookupBySwIfIndex(msg.SwIfIndex) - if !found { - h.log.Warnf("Interface with index %d not found in the mapping", msg.SwIfIndex) - continue - } - - interfaces = append(interfaces, &nat.Nat44Global_Interface{ - Name: ifName, - IsInside: uintToBool(msg.IsInside), - OutputFeature: true, - }) - } - - return interfaces, nil -} - -// Nat44IsForwardingEnabled checks if the NAT44 forwarding is enabled. -func (h *NatVppHandler) isNat44ForwardingEnabled() (isEnabled bool, err error) { - req := &ba_nat.Nat44ForwardingIsEnabled{} - - reply := &ba_nat.Nat44ForwardingIsEnabledReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return false, fmt.Errorf("failed to dump NAT44 forwarding: %v", err) - } - - isEnabled = uintToBool(reply.Enabled) - return isEnabled, nil -} - -func (h *NatVppHandler) getInterfaceIPAddresses(ifaceName string, ifaceMeta *ifaceidx.IfaceMetadata) (ipAddrs []string) { - ipAddrNets := ifaceMeta.IPAddresses - dhcpLease, hasDHCPLease := h.dhcpIndex.GetValue(ifaceName) - if hasDHCPLease { - lease := dhcpLease.(*interfaces.DHCPLease) - ipAddrNets = append(ipAddrNets, lease.HostIpAddress) - } - for _, ipAddrNet := range ipAddrNets { - ipAddr := strings.Split(ipAddrNet, "/")[0] - ipAddrs = append(ipAddrs, ipAddr) - } - return ipAddrs -} - -// protocolNumberToNBValue converts protocol numeric representation into the corresponding enum -// enum value from the NB model. -func (h *NatVppHandler) protocolNumberToNBValue(protocol uint8) (proto nat.DNat44_Protocol) { - switch protocol { - case TCP: - return nat.DNat44_TCP - case UDP: - return nat.DNat44_UDP - case ICMP: - return nat.DNat44_ICMP - default: - h.log.Warnf("Unknown protocol %v", protocol) - return 0 - } -} - -// protocolNBValueToNumber converts protocol enum value from the NB model into the -// corresponding numeric representation. -func (h *NatVppHandler) protocolNBValueToNumber(protocol nat.DNat44_Protocol) (proto uint8) { - switch protocol { - case nat.DNat44_TCP: - return TCP - case nat.DNat44_UDP: - return UDP - case nat.DNat44_ICMP: - return ICMP - default: - h.log.Warnf("Unknown protocol %v, defaulting to TCP", protocol) - return TCP - } -} - -func (h *NatVppHandler) getTwiceNatMode(twiceNat, selfTwiceNat uint8) nat.DNat44_StaticMapping_TwiceNatMode { - if twiceNat > 0 { - if selfTwiceNat > 0 { - h.log.Warnf("Both TwiceNAT and self-TwiceNAT are enabled") - return 0 - } - return nat.DNat44_StaticMapping_ENABLED - } - if selfTwiceNat > 0 { - return nat.DNat44_StaticMapping_SELF - } - return nat.DNat44_StaticMapping_DISABLED -} - -func getOrCreateDNAT(dnats dnatMap, label string) *nat.DNat44 { - if _, created := dnats[label]; !created { - dnats[label] = &nat.DNat44{Label: label} - } - return dnats[label] -} - -func uintToBool(value uint8) bool { - if value == 0 { - return false - } - return true -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls/vpp1810/nat_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls/vpp1810/nat_vppcalls.go deleted file mode 100644 index a32cb2fc87..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls/vpp1810/nat_vppcalls.go +++ /dev/null @@ -1,424 +0,0 @@ -// Copyright (c) 2018 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "math" - "net" - - "github.com/pkg/errors" - - nat "github.com/ligato/vpp-agent/api/models/vpp/nat" - natba "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/nat" -) - -// Num protocol representation -const ( - ICMP uint8 = 1 - TCP uint8 = 6 - UDP uint8 = 17 -) - -const ( - // NoInterface is sw-if-idx which means 'no interface' - noInterface = ^uint32(0) - // Maximal length of tag - maxTagLen = 64 -) - -// SetNat44Forwarding configures NAT44 forwarding. -func (h *NatVppHandler) SetNat44Forwarding(enableFwd bool) error { - req := &natba.Nat44ForwardingEnableDisable{ - Enable: boolToUint(enableFwd), - } - reply := &natba.Nat44ForwardingEnableDisableReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// EnableNat44Interface enables NAT44 feature for provided interface. -func (h *NatVppHandler) EnableNat44Interface(iface string, isInside, isOutput bool) error { - if isOutput { - return h.handleNat44InterfaceOutputFeature(iface, isInside, true) - } - return h.handleNat44Interface(iface, isInside, true) -} - -// DisableNat44Interface disables NAT44 feature for provided interface. -func (h *NatVppHandler) DisableNat44Interface(iface string, isInside, isOutput bool) error { - if isOutput { - return h.handleNat44InterfaceOutputFeature(iface, isInside, false) - } - return h.handleNat44Interface(iface, isInside, false) -} - -// AddNat44Address adds new IPv4 address into the NAT44 pool. -func (h *NatVppHandler) AddNat44Address(address string, vrf uint32, twiceNat bool) error { - return h.handleNat44AddressPool(address, vrf, twiceNat, true) -} - -// DelNat44Address removes existing IPv4 address from the NAT44 pool. -func (h *NatVppHandler) DelNat44Address(address string, vrf uint32, twiceNat bool) error { - return h.handleNat44AddressPool(address, vrf, twiceNat, false) -} - -// SetVirtualReassemblyIPv4 configures NAT virtual reassembly for IPv4 packets. -func (h *NatVppHandler) SetVirtualReassemblyIPv4(vrCfg *nat.VirtualReassembly) error { - return h.handleNatVirtualReassembly(vrCfg, false) -} - -// SetVirtualReassemblyIPv6 configures NAT virtual reassembly for IPv6 packets. -func (h *NatVppHandler) SetVirtualReassemblyIPv6(vrCfg *nat.VirtualReassembly) error { - return h.handleNatVirtualReassembly(vrCfg, true) -} - -// AddNat44IdentityMapping adds new NAT44 identity mapping -func (h *NatVppHandler) AddNat44IdentityMapping(mapping *nat.DNat44_IdentityMapping, dnatLabel string) error { - return h.handleNat44IdentityMapping(mapping, dnatLabel, true) -} - -// DelNat44IdentityMapping removes existing NAT44 identity mapping -func (h *NatVppHandler) DelNat44IdentityMapping(mapping *nat.DNat44_IdentityMapping, dnatLabel string) error { - return h.handleNat44IdentityMapping(mapping, dnatLabel, false) -} - -// AddNat44StaticMapping creates new NAT44 static mapping entry. -func (h *NatVppHandler) AddNat44StaticMapping(mapping *nat.DNat44_StaticMapping, dnatLabel string) error { - if len(mapping.LocalIps) == 0 { - return errors.Errorf("cannot configure static mapping for DNAT %s: no local address provided", dnatLabel) - } - if len(mapping.LocalIps) == 1 { - return h.handleNat44StaticMapping(mapping, dnatLabel, true) - } - return h.handleNat44StaticMappingLb(mapping, dnatLabel, true) -} - -// DelNat44StaticMapping removes existing NAT44 static mapping entry. -func (h *NatVppHandler) DelNat44StaticMapping(mapping *nat.DNat44_StaticMapping, dnatLabel string) error { - if len(mapping.LocalIps) == 0 { - return errors.Errorf("cannot un-configure static mapping from DNAT %s: no local address provided", dnatLabel) - } - if len(mapping.LocalIps) == 1 { - return h.handleNat44StaticMapping(mapping, dnatLabel, false) - } - return h.handleNat44StaticMappingLb(mapping, dnatLabel, false) -} - -// Calls VPP binary API to set/unset interface NAT44 feature. -func (h *NatVppHandler) handleNat44Interface(iface string, isInside, isAdd bool) error { - // get interface metadata - ifaceMeta, found := h.ifIndexes.LookupByName(iface) - if !found { - return errors.New("failed to get interface metadata") - } - - req := &natba.Nat44InterfaceAddDelFeature{ - SwIfIndex: ifaceMeta.SwIfIndex, - IsInside: boolToUint(isInside), - IsAdd: boolToUint(isAdd), - } - reply := &natba.Nat44InterfaceAddDelFeatureReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// Calls VPP binary API to set/unset interface NAT44 output feature -func (h *NatVppHandler) handleNat44InterfaceOutputFeature(iface string, isInside, isAdd bool) error { - // get interface metadata - ifaceMeta, found := h.ifIndexes.LookupByName(iface) - if !found { - return errors.New("failed to get interface metadata") - } - - req := &natba.Nat44InterfaceAddDelOutputFeature{ - SwIfIndex: ifaceMeta.SwIfIndex, - IsInside: boolToUint(isInside), - IsAdd: boolToUint(isAdd), - } - reply := &natba.Nat44InterfaceAddDelOutputFeatureReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// Calls VPP binary API to add/remove address to/from the NAT44 pool. -func (h *NatVppHandler) handleNat44AddressPool(address string, vrf uint32, twiceNat, isAdd bool) error { - ipAddr := net.ParseIP(address).To4() - if ipAddr == nil { - return errors.Errorf("unable to parse address %s from the NAT pool", - address) - } - - req := &natba.Nat44AddDelAddressRange{ - FirstIPAddress: ipAddr, - LastIPAddress: ipAddr, - VrfID: vrf, - TwiceNat: boolToUint(twiceNat), - IsAdd: boolToUint(isAdd), - } - reply := &natba.Nat44AddDelAddressRangeReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// Calls VPP binary API to setup NAT virtual reassembly -func (h *NatVppHandler) handleNatVirtualReassembly(vrCfg *nat.VirtualReassembly, isIpv6 bool) error { - req := &natba.NatSetReass{ - Timeout: vrCfg.Timeout, - MaxReass: uint16(vrCfg.MaxReassemblies), - MaxFrag: uint8(vrCfg.MaxFragments), - DropFrag: boolToUint(vrCfg.DropFragments), - IsIP6: boolToUint(isIpv6), - } - reply := &natba.NatSetReassReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// Calls VPP binary API to add/remove NAT44 static mapping -func (h *NatVppHandler) handleNat44StaticMapping(mapping *nat.DNat44_StaticMapping, dnatLabel string, isAdd bool) error { - var ifIdx = noInterface - var exIPAddr net.IP - - // check tag length limit - if err := checkTagLength(dnatLabel); err != nil { - return err - } - - // parse local endpoint - lcIPAddr := net.ParseIP(mapping.LocalIps[0].LocalIp).To4() - lcPort := uint16(mapping.LocalIps[0].LocalPort) - lcVrf := mapping.LocalIps[0].VrfId - if lcIPAddr == nil { - return errors.Errorf("cannot configure DNAT static mapping %s: unable to parse local IP %s", - dnatLabel, lcIPAddr.String()) - } - - // Check external interface (prioritized over external IP) - if mapping.ExternalInterface != "" { - // Check external interface - ifMeta, found := h.ifIndexes.LookupByName(mapping.ExternalInterface) - if !found { - return errors.Errorf("cannot configure static mapping for DNAT %s: required external interface %s is missing", - dnatLabel, mapping.ExternalInterface) - } - ifIdx = ifMeta.SwIfIndex - } else { - // Parse external IP address - exIPAddr = net.ParseIP(mapping.ExternalIp).To4() - if exIPAddr == nil { - return errors.Errorf("cannot configure static mapping for DNAT %s: unable to parse external IP %s", - dnatLabel, mapping.ExternalIp) - } - } - - // Resolve mapping (address only or address and port) - var addrOnly bool - if lcPort == 0 || mapping.ExternalPort == 0 { - addrOnly = true - } - - req := &natba.Nat44AddDelStaticMapping{ - Tag: []byte(dnatLabel), - LocalIPAddress: lcIPAddr, - ExternalIPAddress: exIPAddr, - Protocol: h.protocolNBValueToNumber(mapping.Protocol), - ExternalSwIfIndex: ifIdx, - VrfID: lcVrf, - TwiceNat: boolToUint(mapping.TwiceNat == nat.DNat44_StaticMapping_ENABLED), - SelfTwiceNat: boolToUint(mapping.TwiceNat == nat.DNat44_StaticMapping_SELF), - Out2inOnly: 1, - IsAdd: boolToUint(isAdd), - } - - if addrOnly { - req.AddrOnly = 1 - } else { - req.LocalPort = lcPort - req.ExternalPort = uint16(mapping.ExternalPort) - } - - reply := &natba.Nat44AddDelStaticMappingReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// Calls VPP binary API to add/remove NAT44 static mapping with load balancing. -func (h *NatVppHandler) handleNat44StaticMappingLb(mapping *nat.DNat44_StaticMapping, dnatLabel string, isAdd bool) error { - // check tag length limit - if err := checkTagLength(dnatLabel); err != nil { - return err - } - - // parse external IP address - exIPAddrByte := net.ParseIP(mapping.ExternalIp).To4() - if exIPAddrByte == nil { - return errors.Errorf("cannot configure LB static mapping for DNAT %s: unable to parse external IP %s", - dnatLabel, mapping.ExternalIp) - } - - // In this case, external port is required - if mapping.ExternalPort == 0 { - return errors.Errorf("cannot configure LB static mapping for DNAT %s: external port is not set", dnatLabel) - } - - // Transform local IP/Ports - var ( - locals []natba.Nat44LbAddrPort - localNum int - ) - for _, local := range mapping.LocalIps { - // TODO: this is a temporary solution - // once LocalNum uses bigger range than uint8 this check should be removed - // as well as the cast below uint8(len... - localNum++ - if localNum > math.MaxUint8 { - h.log.Warnf("Only the first %v local addresses will be programmed", math.MaxUint8) - break - } - if local.LocalPort == 0 { - return errors.Errorf("cannot set local IP/Port for DNAT mapping %s: port is missing", - dnatLabel) - } - - localIP := net.ParseIP(local.LocalIp).To4() - if localIP == nil { - return errors.Errorf("cannot set local IP/Port for DNAT mapping %s: unable to parse local IP %v", - dnatLabel, local.LocalIp) - } - - locals = append(locals, natba.Nat44LbAddrPort{ - Addr: localIP, - Port: uint16(local.LocalPort), - Probability: uint8(local.Probability), - VrfID: local.VrfId, - }) - } - - req := &natba.Nat44AddDelLbStaticMapping{ - Tag: []byte(dnatLabel), - Locals: locals, - LocalNum: uint8(len(locals)), - ExternalAddr: exIPAddrByte, - ExternalPort: uint16(mapping.ExternalPort), - Protocol: h.protocolNBValueToNumber(mapping.Protocol), - TwiceNat: boolToUint(mapping.TwiceNat == nat.DNat44_StaticMapping_ENABLED), - SelfTwiceNat: boolToUint(mapping.TwiceNat == nat.DNat44_StaticMapping_SELF), - Out2inOnly: 1, - IsAdd: boolToUint(isAdd), - Affinity: mapping.SessionAffinity, - } - - reply := &natba.Nat44AddDelLbStaticMappingReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// Calls VPP binary API to add/remove NAT44 identity mapping. -func (h *NatVppHandler) handleNat44IdentityMapping(mapping *nat.DNat44_IdentityMapping, dnatLabel string, isAdd bool) error { - var ifIdx = noInterface - var ipAddr net.IP - - // check tag length limit - if err := checkTagLength(dnatLabel); err != nil { - return err - } - - // get interface index - if mapping.Interface != "" { - ifMeta, found := h.ifIndexes.LookupByName(mapping.Interface) - if !found { - return errors.Errorf("failed to configure identity mapping for DNAT %s: addressed interface %s does not exist", - dnatLabel, mapping.Interface) - } - ifIdx = ifMeta.SwIfIndex - } - - if ifIdx == noInterface { - // Case with IP (optionally port). Verify and parse input IP/port - ipAddr = net.ParseIP(mapping.IpAddress).To4() - if ipAddr == nil { - return errors.Errorf("failed to configure identity mapping for DNAT %s: unable to parse IP address %s", - dnatLabel, mapping.IpAddress) - } - } - - var addrOnly bool - if mapping.Port == 0 { - addrOnly = true - } - - req := &natba.Nat44AddDelIdentityMapping{ - Tag: []byte(dnatLabel), - AddrOnly: boolToUint(addrOnly), - IPAddress: ipAddr, - Port: uint16(mapping.Port), - Protocol: h.protocolNBValueToNumber(mapping.Protocol), - SwIfIndex: ifIdx, - VrfID: mapping.VrfId, - IsAdd: boolToUint(isAdd), - } - - reply := &natba.Nat44AddDelIdentityMappingReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -// checkTagLength serves as a validator for static/identity mapping tag length -func checkTagLength(tag string) error { - if len(tag) > maxTagLen { - return errors.Errorf("DNAT label '%s' has %d bytes, max allowed is %d", - tag, len(tag), maxTagLen) - } - return nil -} - -func boolToUint(input bool) uint8 { - if input { - return 1 - } - return 0 -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls/vpp1810/vppcalls_handler.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls/vpp1810/vppcalls_handler.go deleted file mode 100644 index f523b32efc..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls/vpp1810/vppcalls_handler.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - govppapi "git.fd.io/govpp.git/api" - "github.com/ligato/cn-infra/idxmap" - "github.com/ligato/cn-infra/logging" - - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/nat" - "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifaceidx" - "github.com/ligato/vpp-agent/plugins/vpp/natplugin/vppcalls" -) - -func init() { - var msgs []govppapi.Message - msgs = append(msgs, nat.Messages...) - - vppcalls.Versions["vpp1810"] = vppcalls.HandlerVersion{ - Msgs: msgs, - New: func(ch govppapi.Channel, ifIdx ifaceidx.IfaceMetadataIndex, dhcpIdx idxmap.NamedMapping, log logging.Logger) vppcalls.NatVppAPI { - return &NatVppHandler{ch, ifIdx, dhcpIdx, log} - }, - } -} - -// NatVppHandler is accessor for NAT-related vppcalls methods. -type NatVppHandler struct { - callsChannel govppapi.Channel - ifIndexes ifaceidx.IfaceMetadataIndex - dhcpIndex idxmap.NamedMapping - log logging.Logger -} - -/*// NewNatVppHandler creates new instance of NAT vppcalls handler. -func NewNatVppHandler(callsChan api.Channel, ifIndexes ifaceidx.IfaceMetadataIndex, - dhcpIndex idxmap.NamedMapping, log logging.Logger) *NatVppHandler { - - return &NatVppHandler{ - callsChannel: callsChan, - ifIndexes: ifIndexes, - dhcpIndex: dhcpIndex, - log: log, - } -}*/ diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/README.md b/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/README.md deleted file mode 100644 index 57e1aaaf97..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# Punt plugin - -**Written for: v1.7-vpp18.10** - -The punt plugin provides several options for how to configure the VPP to allow a specific IP traffic to be punted to the host TCP/IP stack. The plugin supports **punt to the host** (either directly, or **via Unix domain socket**) and registration of **IP punt redirect** rules. - -- [Punt to host stack](#pths) - * [Model](#pths-model) - * [Requirements](#pths-req) - * [Configuration](#pths-config) - * [Limitations](#pths-limit) - * [Known issues](#pths-issues) -- [IP redirect](#ipr) - * [Model](#ipr-model) - * [Configuration](#ipr-config) - * [Limitations](#ipr-limit) - * [Known issues](#ipr-issues) - -## Punt to host stack - -All the incoming traffic matching one of the VPP interface addresses, and also matching defined L3 protocol, L4 protocol, and port - and would be otherwise dropped - will be instead punted to the host. If a Unix domain socket path is defined (optional), the traffic will be punted via socket. All the fields which serve as a traffic filter are mandatory. - -### Model - -The punt plugin defines the following [model](../model/punt/punt.proto) which grants support for two main configuration items defined by different northbound keys. - -The punt to host is defined as `ToHost` object in the generated proto model. - -The key has a following format (for both, with or without socket): -``` -vpp/config/v2/punt/tohost/l3//l4//port/ -``` - -L3/L4 protocol in the key is defined as a `string` value, however, the value is transformed to numeric representation in the VPP binary API. - -The usage of L3 protocol `ALL` is exclusive for IP punt to host (without socket registration) in the VPP API. If used for the IP punt with socket registration, the vpp-agent calls the binary API twice with the same parameters for both, IPv4 and IPv6. - -### Requirements - -**Important note:** in order to configure a punt to host via Unix domain socket, a specific VPP startup-config is required. The attempt to set punt without it results in errors in VPP. Startup-config: - -``` -punt { - socket /tmp/socket/punt -} -``` - -The path has to match with the one in the northbound data. - -### Configuration - -How to configure punt to host: - -**1. Using Key-value database:** put proto-modeled data to the database under the correct key for punt to host configuration. If the database is the ETCD, it is possible to use [vpp-agent-ctl](../../../cmd/vpp-agent-ctlv2) utility. Let's assume that we want to configure a punt to host with socket registration (with default agent label `vpp1`): - -``` -vpp-agent-ctl -put "/vnf-agent/vpp1/vpp/config/v2/punt/tohost/l3/IPv4/l4/UDP/port/9000" json/punt-to-host.json -``` - -The more simple way is to use the configuration example directly in the `vpp-agent-ctl`. The example contains pre-defined data which can be put to the ETCD with a single command. Commands are different for a punt to host alone, or registered via socket: - -``` -vpp-agent-ctl -puntr // simple punt to host -vpp-agent-ctl -rsocket // register punt to host via socket -``` - -To remove/deregister data, use: - -``` -vpp-agent-ctl -puntd -vpp-agent-ctl -dsocket -``` - -**2. Using REST** not yet implemented - -**3. Using GRPC:** not yet implemented - -### Limitations - -Current limitations for a punt to host: -* The UDP configuration cannot be shown (or even configured) in the VPP cli. -* The VPP does not provide API to dump configuration, which takes the vpp-agent the opportunity to read existing entries and may case issues with resync. -* Although the vpp-agent supports the TCP protocol as the L4 protocol to filter incoming traffic, the current VPP version don't. -* Configured punt to host entry cannot be removed since the VPP does not support this option. The attempt to do so exits with an error. - -Current limitations for a punt to host via unix domain socket: -* The configuration cannot be shown (or even configured) in the VPP cli. -* The vpp-agent cannot read registered entries since the VPP does not provide an API to dump. -* The VPP startup config punt section requires unix domain socket path defined. The limitation is that only one path can be defined at a time. - -### Known issues - -* VPP issue: if the Unix domain socket path is defined in the startup config, the path has to exist, otherwise the VPP fails to start. The file itself can be created by the VPP. - -## IP redirect - -Defined as the IP punt, IP redirect allows a traffic matching given IP protocol to be punted to the defined TX interface and next hop IP address. All those fields have to be defined in the northbound proto-modeled data. Optionally, the RX interface can be also defined as an input filter. - -### Model - -IP redirect is defined as `IpRedirect` object in the generated proto model. - -The key has a following format: -``` -vpp/config/v2/punt/ipredirect/l3//tx/ -``` - -L3 protocol is defined as `string` value (transformed to numeric in VPP API call). The table is the same as before. - -If L3 protocol is set to `ALL`, the respective API is called for IPv4 and IPv6 separately. - -### Configuration - -How to configure IP redirect: - -**1. Using the key-value database:** put proto-modeled data to the database under the correct key for IP redirect configuration. If the database is the ETCD, it is possible to use [vpp-agent-ctl](../../../cmd/vpp-agent-ctlv2) utility. Let's assume that we want to configure following IP redirect (with default agent label `vpp1`). Since the configuration counts with an existing interface (tap1 in this case), the interface has to be configured as well (the order does not matter). - -``` -vpp-agent-ctl -put "/vnf-agent/vpp1/vpp/config/v2/interface/tap1" json/tap.json -vpp-agent-ctl -put "/vnf-agent/vpp1/vpp/config/v2/punt/ipredirect/l3/IPv4/tx/tap1" json/ip-redirect.json -``` - -The simple way is to use an configuration example directly in the `vpp-agent-ctl`. The example contains pre-defined data which can be put to ETCD with a single command. Let's configure interface and IP redirect: - -``` -vpp-agent-ctl -tap -vpp-agent-ctl -ipredir -``` - -To remove IP redirect entry, use: - -``` -vpp-agent-ctl -ipredird -``` - -In case the interface is not configured, the IP redirect data are cached and marked as pending, awaiting the interface to appear in order to be re-tried. - -**2. Using REST** not yet implemented - -**3. Using GRPC:** not yet implemented - -The VPP cli command (for configuration verification) is `show ip punt redirect `. - -### Limitations - -* The VPP does not provide API calls to dump existing IP redirect entries. It may cause resync not to work properly. - -### Known issues - -* No issues are known with the current VPP version. \ No newline at end of file diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/puntplugin.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/puntplugin.go index d1a2ec2c89..7cadc8670b 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/puntplugin.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/puntplugin.go @@ -35,7 +35,6 @@ import ( "github.com/ligato/vpp-agent/plugins/vpp/puntplugin/descriptor/adapter" "github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls" - _ "github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls/vpp1810" _ "github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls/vpp1901" _ "github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls/vpp1904" ) diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls/vpp1810/dump_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls/vpp1810/dump_vppcalls.go deleted file mode 100644 index f79463b4f2..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls/vpp1810/dump_vppcalls.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "github.com/ligato/vpp-agent/api/models/vpp/punt" - "github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls" -) - -// FIXME: temporary solutions for providing data in dump -var socketPathMap = make(map[uint32]*vpp_punt.ToHost) - -// DumpPuntRegisteredSockets returns punt to host via registered socket entries -// TODO since the binary API is not available, all data are read from local cache for now -func (h *PuntVppHandler) DumpRegisteredPuntSockets() (punts []*vppcalls.PuntDetails, err error) { - for _, punt := range socketPathMap { - punts = append(punts, &vppcalls.PuntDetails{ - PuntData: punt, - SocketPath: punt.SocketPath, - }) - } - - if len(punts) > 0 { - h.log.Warnf("Dump punt socket register: all entries were read from local cache") - } - - return punts, nil -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls/vpp1810/punt_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls/vpp1810/punt_vppcalls.go deleted file mode 100644 index 1548ddbb61..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls/vpp1810/punt_vppcalls.go +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "net" - "strings" - - "github.com/pkg/errors" - - punt "github.com/ligato/vpp-agent/api/models/vpp/punt" - ipba "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" - puntba "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/punt" -) - -// AddPunt configures new punt entry -func (h *PuntVppHandler) AddPunt(puntCfg *punt.ToHost) error { - return h.handlePuntToHost(puntCfg, true) -} - -// DeletePunt removes punt entry -func (h *PuntVppHandler) DeletePunt(puntCfg *punt.ToHost) error { - return h.handlePuntToHost(puntCfg, false) -} - -// RegisterPuntSocket registers new punt to socket -func (h *PuntVppHandler) RegisterPuntSocket(puntCfg *punt.ToHost) (string, error) { - if puntCfg.L3Protocol == punt.L3Protocol_IPv4 { - return h.registerPuntWithSocketIPv4(puntCfg) - } else if puntCfg.L3Protocol == punt.L3Protocol_IPv6 { - return h.registerPuntWithSocketIPv6(puntCfg) - } - - // if L3 is set to all, register both, IPv4 and IPv6 - path4, err := h.registerPuntWithSocketIPv4(puntCfg) - if err != nil { - return "", err - } - path6, err := h.registerPuntWithSocketIPv6(puntCfg) - if err != nil { - return "", err - } - - if path4 != path6 { - h.log.Warnf("returned IPv4 Pathname (%s) for registered punt socket does not match IPv6 Pathname (%s)", - path4, path6) - } - - return path4, nil -} - -// DeregisterPuntSocket removes existing punt to socket sogistration -func (h *PuntVppHandler) DeregisterPuntSocket(puntCfg *punt.ToHost) error { - if puntCfg.L3Protocol == punt.L3Protocol_IPv4 { - return h.unregisterPuntWithSocketIPv4(puntCfg) - } else if puntCfg.L3Protocol == punt.L3Protocol_IPv6 { - return h.unregisterPuntWithSocketIPv6(puntCfg) - } - // if L3 is set to all, deregister both, IPv4 and IPv6 - err := h.unregisterPuntWithSocketIPv4(puntCfg) - if err != nil { - return err - } - return h.unregisterPuntWithSocketIPv6(puntCfg) -} - -// AddPuntRedirect adds new redirect entry -func (h *PuntVppHandler) AddPuntRedirect(puntCfg *punt.IPRedirect) error { - if puntCfg.L3Protocol == punt.L3Protocol_IPv4 { - return h.handlePuntRedirectIPv4(puntCfg, true) - } else if puntCfg.L3Protocol == punt.L3Protocol_IPv6 { - return h.handlePuntRedirectIPv6(puntCfg, true) - } - // un-configure both, IPv4 and IPv6 - err := h.handlePuntRedirectIPv4(puntCfg, true) - if err != nil { - return err - } - return h.handlePuntRedirectIPv6(puntCfg, true) -} - -// DeletePuntRedirect removes existing redirect entry -func (h *PuntVppHandler) DeletePuntRedirect(puntCfg *punt.IPRedirect) error { - if puntCfg.L3Protocol == punt.L3Protocol_IPv4 { - return h.handlePuntRedirectIPv4(puntCfg, false) - } else if puntCfg.L3Protocol == punt.L3Protocol_IPv6 { - return h.handlePuntRedirectIPv6(puntCfg, false) - } - // un-configure both, IPv4 and IPv6 - err := h.handlePuntRedirectIPv6(puntCfg, false) - if err != nil { - return err - } - return h.handlePuntRedirectIPv4(puntCfg, false) -} - -func (h *PuntVppHandler) handlePuntToHost(punt *punt.ToHost, isAdd bool) error { - req := &puntba.Punt{ - IsAdd: boolToUint(isAdd), - IPv: resolveL3Proto(punt.L3Protocol), - L4Protocol: resolveL4Proto(punt.L4Protocol), - L4Port: uint16(punt.Port), - } - reply := &puntba.PuntReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -func (h *PuntVppHandler) registerPuntWithSocketIPv4(punt *punt.ToHost) (string, error) { - return h.registerPuntWithSocket(punt, true) -} - -func (h *PuntVppHandler) registerPuntWithSocketIPv6(punt *punt.ToHost) (string, error) { - return h.registerPuntWithSocket(punt, false) -} - -func (h *PuntVppHandler) registerPuntWithSocket(punt *punt.ToHost, isIPv4 bool) (string, error) { - pathName := []byte(punt.SocketPath) - pathByte := make([]byte, 108) // linux sun_path defined to 108 bytes as by unix(7) - for i, c := range pathName { - pathByte[i] = c - } - - req := &puntba.PuntSocketRegister{ - HeaderVersion: 1, - IsIP4: boolToUint(isIPv4), - L4Protocol: resolveL4Proto(punt.L4Protocol), - L4Port: uint16(punt.Port), - Pathname: pathByte, - } - reply := &puntba.PuntSocketRegisterReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return "", err - } - - p := *punt - p.SocketPath = strings.SplitN(string(reply.Pathname), "\x00", 2)[0] - socketPathMap[punt.Port] = &p - - /*if h.RegisterSocketFn != nil { - h.RegisterSocketFn(true, punt, p.SocketPath) - }*/ - - return p.SocketPath, nil -} - -func (h *PuntVppHandler) unregisterPuntWithSocketIPv4(punt *punt.ToHost) error { - return h.unregisterPuntWithSocket(punt, true) -} - -func (h *PuntVppHandler) unregisterPuntWithSocketIPv6(punt *punt.ToHost) error { - return h.unregisterPuntWithSocket(punt, false) -} - -func (h *PuntVppHandler) unregisterPuntWithSocket(punt *punt.ToHost, isIPv4 bool) error { - req := &puntba.PuntSocketDeregister{ - IsIP4: boolToUint(isIPv4), - L4Protocol: resolveL4Proto(punt.L4Protocol), - L4Port: uint16(punt.Port), - } - reply := &puntba.PuntSocketDeregisterReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - /*if h.RegisterSocketFn != nil { - if p, ok := socketPathMap[punt.Port]; ok { - h.RegisterSocketFn(false, punt, p.SocketPath) - } - }*/ - delete(socketPathMap, punt.Port) - - return nil -} - -func (h *PuntVppHandler) handlePuntRedirectIPv4(punt *punt.IPRedirect, isAdd bool) error { - return h.handlePuntRedirect(punt, true, isAdd) -} - -func (h *PuntVppHandler) handlePuntRedirectIPv6(punt *punt.IPRedirect, isAdd bool) error { - return h.handlePuntRedirect(punt, false, isAdd) -} - -func (h *PuntVppHandler) handlePuntRedirect(punt *punt.IPRedirect, isIPv4, isAdd bool) error { - // rx interface - var rxIfIdx uint32 - if punt.RxInterface == "" { - rxIfIdx = ^uint32(0) - } else { - rxMetadata, exists := h.ifIndexes.LookupByName(punt.RxInterface) - if !exists { - return errors.Errorf("index not found for interface %s", punt.RxInterface) - } - rxIfIdx = rxMetadata.SwIfIndex - } - - // tx interface - txMetadata, exists := h.ifIndexes.LookupByName(punt.TxInterface) - if !exists { - return errors.Errorf("index not found for interface %s", punt.TxInterface) - } - - // next hop address - // - remove mask from IP address if necessary - nextHopStr := punt.NextHop - ipParts := strings.Split(punt.NextHop, "/") - if len(ipParts) > 1 { - h.log.Debugf("IP punt redirect next hop IP address %s is defined with mask, removing it") - nextHopStr = ipParts[0] - } - var nextHop []byte - if isIPv4 { - nextHop = net.ParseIP(nextHopStr).To4() - } else { - nextHop = net.ParseIP(nextHopStr).To16() - } - - req := &ipba.IPPuntRedirect{ - IsAdd: boolToUint(isAdd), - IsIP6: boolToUint(!isIPv4), - RxSwIfIndex: rxIfIdx, - TxSwIfIndex: txMetadata.SwIfIndex, - Nh: nextHop, - } - reply := &ipba.IPPuntRedirectReply{} - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil -} - -func resolveL3Proto(protocol punt.L3Protocol) uint8 { - switch protocol { - case punt.L3Protocol_IPv4: - return uint8(punt.L3Protocol_IPv4) - case punt.L3Protocol_IPv6: - return uint8(punt.L3Protocol_IPv6) - case punt.L3Protocol_ALL: - return ^uint8(0) // binary API representation for both protocols - } - return uint8(punt.L3Protocol_UNDEFINED_L3) -} - -func resolveL4Proto(protocol punt.L4Protocol) uint8 { - switch protocol { - case punt.L4Protocol_TCP: - return uint8(punt.L4Protocol_TCP) - case punt.L4Protocol_UDP: - return uint8(punt.L4Protocol_UDP) - } - return uint8(punt.L4Protocol_UNDEFINED_L4) -} - -func boolToUint(input bool) uint8 { - if input { - return 1 - } - return 0 -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls/vpp1810/vppcalls_handler.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls/vpp1810/vppcalls_handler.go deleted file mode 100644 index a04ded16fe..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls/vpp1810/vppcalls_handler.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - govppapi "git.fd.io/govpp.git/api" - "github.com/ligato/cn-infra/logging" - - ba_ip "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/ip" - ba_punt "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/punt" - "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifaceidx" - "github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls" -) - -func init() { - var msgs []govppapi.Message - msgs = append(msgs, ba_ip.Messages...) - msgs = append(msgs, ba_punt.Messages...) - - vppcalls.Versions["vpp1810"] = vppcalls.HandlerVersion{ - Msgs: msgs, - New: NewPuntVppHandler, - } -} - -// PuntVppHandler is accessor for punt-related vppcalls methods. -type PuntVppHandler struct { - callsChannel govppapi.Channel - ifIndexes ifaceidx.IfaceMetadataIndex - log logging.Logger -} - -// NewPuntVppHandler creates new instance of punt vppcalls handler -func NewPuntVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.IfaceMetadataIndex, log logging.Logger) vppcalls.PuntVppAPI { - return &PuntVppHandler{ - callsChannel: callsChan, - ifIndexes: ifIndexes, - log: log, - } -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/srplugin/srplugin.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/srplugin/srplugin.go index b3c52ad910..f0b324aac5 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/srplugin/srplugin.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/srplugin/srplugin.go @@ -29,7 +29,6 @@ import ( "github.com/ligato/vpp-agent/plugins/vpp/srplugin/vppcalls" "github.com/pkg/errors" - _ "github.com/ligato/vpp-agent/plugins/vpp/srplugin/vppcalls/vpp1810" _ "github.com/ligato/vpp-agent/plugins/vpp/srplugin/vppcalls/vpp1901" _ "github.com/ligato/vpp-agent/plugins/vpp/srplugin/vppcalls/vpp1904" ) diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/srplugin/vppcalls/vpp1810/srv6.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/srplugin/vppcalls/vpp1810/srv6.go deleted file mode 100644 index 12516fe73f..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/srplugin/vppcalls/vpp1810/srv6.go +++ /dev/null @@ -1,644 +0,0 @@ -// Copyright (c) 2019 Bell Canada, Pantheon Technologies and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package vpp1810 contains wrappers over VPP (version 18.10) binary APIs to simplify their usage -package vpp1810 - -import ( - "bytes" - "fmt" - "net" - "regexp" - "strconv" - "strings" - - "github.com/ligato/cn-infra/logging" - nbint "github.com/ligato/vpp-agent/api/models/vpp/interfaces" - srv6 "github.com/ligato/vpp-agent/api/models/vpp/srv6" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/interfaces" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/sr" -) - -// Constants for behavior function hardcoded into VPP (there can be also custom behavior functions implemented as VPP plugins) -// Constants are taken from VPP's vnet/srv6/sr.h (names are modified to Golang from original C form in VPP code) -const ( - BehaviorEnd uint8 = iota + 1 // Behavior of simple endpoint - BehaviorX // Behavior of endpoint with Layer-3 cross-connect - BehaviorT // Behavior of endpoint with specific IPv6 table lookup - BehaviorDfirst // Unused. Separator in between regular and D - BehaviorDX2 // Behavior of endpoint with decapulation and Layer-2 cross-connect (or DX2 with egress VLAN rewrite when VLAN notzero - not supported this variant yet) - BehaviorDX6 // Behavior of endpoint with decapsulation and IPv6 cross-connect - BehaviorDX4 // Behavior of endpoint with decapsulation and IPv4 cross-connect - BehaviorDT6 // Behavior of endpoint with decapsulation and specific IPv6 table lookup - BehaviorDT4 // Behavior of endpoint with decapsulation and specific IPv4 table lookup - BehaviorLast // seems unused, note in VPP: "Must always be the last one" -) - -// Constants for steering type -// Constants are taken from VPP's vnet/srv6/sr.h (names are modified to Golang from original C form in VPP code) -const ( - SteerTypeL2 uint8 = 2 - SteerTypeIPv4 uint8 = 4 - SteerTypeIPv6 uint8 = 6 -) - -// Constants for operation of SR policy modify binary API method -const ( - AddSRList uint8 = iota + 1 // Add SR List to an existing SR policy - DeleteSRList // Delete SR List from an existing SR policy - ModifyWeightOfSRList // Modify the weight of an existing SR List -) - -// AddLocalSid adds local sid into VPP -func (h *SRv6VppHandler) AddLocalSid(localSID *srv6.LocalSID) error { - sidAddr, err := parseIPv6(localSID.GetSid()) - if err != nil { - return fmt.Errorf("sid address %s is not IPv6 address: %v", localSID.GetSid(), err) // calls from descriptor are already validated - } - return h.addDelLocalSid(false, sidAddr, localSID) -} - -// DeleteLocalSid delets local sid given by in VPP -func (h *SRv6VppHandler) DeleteLocalSid(sidAddr net.IP) error { - return h.addDelLocalSid(true, sidAddr, nil) -} - -func (h *SRv6VppHandler) addDelLocalSid(deletion bool, sidAddr net.IP, localSID *srv6.LocalSID) error { - h.log.WithFields(logging.Fields{"localSID": sidAddr, "delete": deletion, "installationVrfID": h.installationVrfID(localSID), "end function": h.endFunction(localSID)}). - Debug("Adding/deleting Local SID", sidAddr) - if !deletion && localSID.GetEndFunction_AD() != nil { - return h.addSRProxy(sidAddr, localSID) - } - req := &sr.SrLocalsidAddDel{ - IsDel: boolToUint(deletion), - Localsid: sr.Srv6Sid{Addr: []byte(sidAddr)}, - } - if !deletion { - req.FibTable = localSID.InstallationVrfId // where to install localsid entry - if err := h.writeEndFunction(req, sidAddr, localSID); err != nil { - return err - } - } - reply := &sr.SrLocalsidAddDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - if reply.Retval != 0 { - return fmt.Errorf("vpp call %q returned: %d", reply.GetMessageName(), reply.Retval) - } - - h.log.WithFields(logging.Fields{"localSID": sidAddr, "delete": deletion, "installationVrfID": h.installationVrfID(localSID), "end function": h.endFunction(localSID)}). - Debug("Added/deleted Local SID ", sidAddr) - - return nil -} - -// addSRProxy adds local sid with SR-proxy end function (End.AD). This functionality has no binary API in VPP, therefore -// CLI commands are used (VPE binary API that calls VPP's CLI). -func (h *SRv6VppHandler) addSRProxy(sidAddr net.IP, localSID *srv6.LocalSID) error { - // get VPP-internal names of IN and OUT interfaces - names, err := h.interfaceNameMapping() - if err != nil { - return fmt.Errorf("can't convert interface names from etcd to VPP-internal interface names:%v", err) - } - outInterface, found := names[localSID.GetEndFunction_AD().OutgoingInterface] - if !found { - return fmt.Errorf("can't find VPP-internal name for interface %v (name in etcd)", localSID.GetEndFunction_AD().OutgoingInterface) - } - inInterface, found := names[localSID.GetEndFunction_AD().IncomingInterface] - if !found { - return fmt.Errorf("can't find VPP-internal name for interface %v (name in etcd)", localSID.GetEndFunction_AD().IncomingInterface) - } - - // add SR-proxy using VPP CLI - var cmd string - if strings.TrimSpace(localSID.GetEndFunction_AD().L3ServiceAddress) == "" { // L2 service - cmd = fmt.Sprintf("sr localsid address %v behavior end.ad oif %v iif %v", sidAddr, outInterface, inInterface) - } else { // L3 service - cmd = fmt.Sprintf("sr localsid address %v behavior end.ad nh %v oif %v iif %v", sidAddr, localSID.GetEndFunction_AD().L3ServiceAddress, outInterface, inInterface) - } - data, err := h.RunCli(cmd) - if err != nil { - return err - } - if len(strings.TrimSpace(string(data))) > 0 { - return fmt.Errorf("addition of dynamic segment routing proxy failed by returning nonblank space text in CLI: %v", string(data)) - } - return nil -} - -// interfaceNameMapping dumps from VPP internal names of interfaces and uses them to produce mapping from ligato interface names to vpp internal names. -func (h *SRv6VppHandler) interfaceNameMapping() (map[string]string, error) { - mapping := make(map[string]string) - reqCtx := h.callsChannel.SendMultiRequest(&interfaces.SwInterfaceDump{}) - - for { - // get next interface info - ifDetails := &interfaces.SwInterfaceDetails{} - stop, err := reqCtx.ReceiveReply(ifDetails) - if stop { - break // Break from the loop. - } - if err != nil { - return nil, fmt.Errorf("failed to dump interface: %v", err) - } - - // extract and compute names - ligatoName := string(bytes.SplitN(ifDetails.Tag, []byte{0x00}, 2)[0]) - vppInternalName := string(bytes.SplitN(ifDetails.InterfaceName, []byte{0x00}, 2)[0]) - if ifDetails.SupSwIfIndex == ifDetails.SwIfIndex && // no subinterface (subinterface are not DPDK) - guessInterfaceType(string(ifDetails.InterfaceName)) == nbint.Interface_DPDK { // fill name for physical interfaces (they are mostly without tag) - ligatoName = vppInternalName - } - - mapping[ligatoName] = vppInternalName - } - return mapping, nil -} - -func (h *SRv6VppHandler) installationVrfID(localSID *srv6.LocalSID) string { - if localSID != nil { - return string(localSID.InstallationVrfId) - } - return "" -} - -func (h *SRv6VppHandler) endFunction(localSID *srv6.LocalSID) string { - switch ef := localSID.GetEndFunction().(type) { - case *srv6.LocalSID_BaseEndFunction: - return fmt.Sprintf("End{psp: %v}", ef.BaseEndFunction.Psp) - case *srv6.LocalSID_EndFunction_X: - return fmt.Sprintf("X{psp: %v, OutgoingInterface: %v, NextHop: %v}", ef.EndFunction_X.Psp, ef.EndFunction_X.OutgoingInterface, ef.EndFunction_X.NextHop) - case *srv6.LocalSID_EndFunction_T: - return fmt.Sprintf("T{psp: %v, vrf: %v}", ef.EndFunction_T.Psp, ef.EndFunction_T.VrfId) - case *srv6.LocalSID_EndFunction_DX2: - return fmt.Sprintf("DX2{VlanTag: %v, OutgoingInterface: %v}", ef.EndFunction_DX2.VlanTag, ef.EndFunction_DX2.OutgoingInterface) - case *srv6.LocalSID_EndFunction_DX4: - return fmt.Sprintf("DX4{OutgoingInterface: %v, NextHop: %v}", ef.EndFunction_DX4.OutgoingInterface, ef.EndFunction_DX4.NextHop) - case *srv6.LocalSID_EndFunction_DX6: - return fmt.Sprintf("DX6{OutgoingInterface: %v, NextHop: %v}", ef.EndFunction_DX6.OutgoingInterface, ef.EndFunction_DX6.NextHop) - case *srv6.LocalSID_EndFunction_DT4: - return fmt.Sprintf("DT4{vrf: %v}", ef.EndFunction_DT4.VrfId) - case *srv6.LocalSID_EndFunction_DT6: - return fmt.Sprintf("DT6{vrf: %v}", ef.EndFunction_DT6.VrfId) - case *srv6.LocalSID_EndFunction_AD: - return fmt.Sprintf("AD{L3ServiceAddress: %v, OutgoingInterface: %v, IncomingInterface: %v}", ef.EndFunction_AD.L3ServiceAddress, ef.EndFunction_AD.OutgoingInterface, ef.EndFunction_AD.IncomingInterface) - case nil: - return "" - default: - return "unknown end function" - } -} - -func (h *SRv6VppHandler) writeEndFunction(req *sr.SrLocalsidAddDel, sidAddr net.IP, localSID *srv6.LocalSID) error { - switch ef := localSID.EndFunction.(type) { - case *srv6.LocalSID_BaseEndFunction: - req.Behavior = BehaviorEnd - req.EndPsp = boolToUint(ef.BaseEndFunction.Psp) - case *srv6.LocalSID_EndFunction_X: - req.Behavior = BehaviorX - req.EndPsp = boolToUint(ef.EndFunction_X.Psp) - ifMeta, exists := h.ifIndexes.LookupByName(ef.EndFunction_X.OutgoingInterface) - if !exists { - return fmt.Errorf("for interface %v doesn't exist sw index", ef.EndFunction_X.OutgoingInterface) - } - req.SwIfIndex = ifMeta.SwIfIndex - nhAddr, err := parseIPv6(ef.EndFunction_X.NextHop) // parses also ipv4 addresses but into ipv6 address form - if err != nil { - return err - } - if nhAddr4 := nhAddr.To4(); nhAddr4 != nil { // ipv4 address in ipv6 address form? - req.NhAddr4 = nhAddr4 - } else { - req.NhAddr6 = []byte(nhAddr) - } - case *srv6.LocalSID_EndFunction_T: - req.Behavior = BehaviorT - req.EndPsp = boolToUint(ef.EndFunction_T.Psp) - req.SwIfIndex = ef.EndFunction_T.VrfId - case *srv6.LocalSID_EndFunction_DX2: - req.Behavior = BehaviorDX2 - req.VlanIndex = ef.EndFunction_DX2.VlanTag - ifMeta, exists := h.ifIndexes.LookupByName(ef.EndFunction_DX2.OutgoingInterface) - if !exists { - return fmt.Errorf("for interface %v doesn't exist sw index", ef.EndFunction_DX2.OutgoingInterface) - } - req.SwIfIndex = ifMeta.SwIfIndex - case *srv6.LocalSID_EndFunction_DX4: - req.Behavior = BehaviorDX4 - ifMeta, exists := h.ifIndexes.LookupByName(ef.EndFunction_DX4.OutgoingInterface) - if !exists { - return fmt.Errorf("for interface %v doesn't exist sw index", ef.EndFunction_DX4.OutgoingInterface) - } - req.SwIfIndex = ifMeta.SwIfIndex - nhAddr, err := parseIPv6(ef.EndFunction_DX4.NextHop) // parses also IPv4 - if err != nil { - return err - } - nhAddr4 := nhAddr.To4() - if nhAddr4 == nil { - return fmt.Errorf("next hop of DX4 end function (%v) is not valid IPv4 address", ef.EndFunction_DX4.NextHop) - } - req.NhAddr4 = []byte(nhAddr4) - case *srv6.LocalSID_EndFunction_DX6: - req.Behavior = BehaviorDX6 - ifMeta, exists := h.ifIndexes.LookupByName(ef.EndFunction_DX6.OutgoingInterface) - if !exists { - return fmt.Errorf("for interface %v doesn't exist sw index", ef.EndFunction_DX6.OutgoingInterface) - } - req.SwIfIndex = ifMeta.SwIfIndex - nhAddr6, err := parseIPv6(ef.EndFunction_DX6.NextHop) - if err != nil { - return err - } - req.NhAddr6 = []byte(nhAddr6) - case *srv6.LocalSID_EndFunction_DT4: - req.Behavior = BehaviorDT4 - req.SwIfIndex = ef.EndFunction_DT4.VrfId - case *srv6.LocalSID_EndFunction_DT6: - req.Behavior = BehaviorDT6 - req.SwIfIndex = ef.EndFunction_DT6.VrfId - case nil: - return fmt.Errorf("End function not set. Please configure end function for local SID %v ", sidAddr) - default: - return fmt.Errorf("unknown end function (model link type %T)", ef) // EndFunction_AD is handled elsewhere - } - - return nil -} - -// SetEncapsSourceAddress sets for SRv6 in VPP the source address used for encapsulated packet -func (h *SRv6VppHandler) SetEncapsSourceAddress(address string) error { - h.log.Debugf("Configuring encapsulation source address to address %v", address) - ipAddress, err := parseIPv6(address) - if err != nil { - return err - } - req := &sr.SrSetEncapSource{ - EncapsSource: []byte(ipAddress), - } - reply := &sr.SrSetEncapSourceReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - if reply.Retval != 0 { - return fmt.Errorf("vpp call %q returned: %d", reply.GetMessageName(), reply.Retval) - } - - h.log.WithFields(logging.Fields{"Encapsulation source address": address}). - Debug("Encapsulation source address configured.") - - return nil -} - -// AddPolicy adds SRv6 policy into VPP (including all policy's segment lists). -func (h *SRv6VppHandler) AddPolicy(policy *srv6.Policy) error { - if err := h.addBasePolicyWithFirstSegmentList(policy); err != nil { - return fmt.Errorf("can't create Policy with first segment list (Policy: %+v): %v", policy, err) - } - if err := h.addOtherSegmentLists(policy); err != nil { - return fmt.Errorf("can't add all segment lists to created policy %+v: %v", policy, err) - } - return nil -} - -func (h *SRv6VppHandler) addBasePolicyWithFirstSegmentList(policy *srv6.Policy) error { - h.log.Debugf("Adding SR policy %+v", policy) - bindingSid, err := parseIPv6(policy.GetBsid()) // already validated - if err != nil { - return fmt.Errorf("binding sid address %s is not IPv6 address: %v", policy.GetBsid(), err) // calls from descriptor are already validated - } - if len(policy.SegmentLists) == 0 { - return fmt.Errorf("policy must have defined at least one segment list (Policy: %+v)", policy) // calls from descriptor are already validated - } - sids, err := h.convertPolicySegment(policy.SegmentLists[0]) - if err != nil { - return err - } - // Note: Weight in sr.SrPolicyAdd is leftover from API changes that moved weight into sr.Srv6SidList (it is weight of sid list not of the whole policy) - req := &sr.SrPolicyAdd{ - BsidAddr: []byte(bindingSid), - Sids: *sids, - IsEncap: boolToUint(policy.SrhEncapsulation), - Type: boolToUint(policy.SprayBehaviour), - FibTable: policy.InstallationVrfId, - } - reply := &sr.SrPolicyAddReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - if reply.Retval != 0 { - return fmt.Errorf("vpp call %q returned: %d", reply.GetMessageName(), reply.Retval) - } - - h.log.WithFields(logging.Fields{"binding SID": bindingSid, "list of next SIDs": policy.SegmentLists[0].Segments}). - Debug("base SR policy (policy with just one segment list) added") - - return nil -} - -func (h *SRv6VppHandler) addOtherSegmentLists(policy *srv6.Policy) error { - for _, sl := range policy.SegmentLists[1:] { - if err := h.AddPolicySegmentList(sl, policy); err != nil { - return fmt.Errorf("failed to add policy segment %+v: %v", sl, err) - } - } - return nil -} - -// DeletePolicy deletes SRv6 policy given by binding SID -func (h *SRv6VppHandler) DeletePolicy(bindingSid net.IP) error { - h.log.Debugf("Deleting SR policy with binding SID %v ", bindingSid) - req := &sr.SrPolicyDel{ - BsidAddr: sr.Srv6Sid{Addr: []byte(bindingSid)}, // TODO add ability to define policy also by index (SrPolicyIndex) - } - reply := &sr.SrPolicyDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - if reply.Retval != 0 { - return fmt.Errorf("vpp call %q returned: %d", reply.GetMessageName(), reply.Retval) - } - - h.log.WithFields(logging.Fields{"binding SID": bindingSid}).Debug("SR policy deleted") - - return nil -} - -// AddPolicySegmentList adds segment list to SRv6 policy in VPP -func (h *SRv6VppHandler) AddPolicySegmentList(segmentList *srv6.Policy_SegmentList, policy *srv6.Policy) error { - h.log.Debugf("Adding segment %+v to SR policy %+v", segmentList, policy) - err := h.modPolicy(AddSRList, policy, segmentList, 0) - if err == nil { - h.log.WithFields(logging.Fields{"binding SID": policy.Bsid, "list of next SIDs": segmentList.Segments}). - Debug("SR policy modified(added another segment list)") - } - return err -} - -// DeletePolicySegmentList removes segment list (with VPP-internal index ) from SRv6 policy in VPP -func (h *SRv6VppHandler) DeletePolicySegmentList(segmentList *srv6.Policy_SegmentList, segmentVPPIndex uint32, policy *srv6.Policy) error { - h.log.Debugf("Removing segment %+v (vpp-internal index %v) from SR policy %+v", segmentList, segmentVPPIndex, policy) - err := h.modPolicy(DeleteSRList, policy, segmentList, segmentVPPIndex) - if err == nil { - h.log.WithFields(logging.Fields{"binding SID": policy.Bsid, "list of next SIDs": segmentList.Segments, "segmentListIndex": segmentVPPIndex}). - Debug("SR policy modified(removed segment list)") - } - return err -} - -func (h *SRv6VppHandler) modPolicy(operation uint8, policy *srv6.Policy, segmentList *srv6.Policy_SegmentList, segmentListIndex uint32) error { - bindingSid, err := parseIPv6(policy.GetBsid()) - if err != nil { - return fmt.Errorf("binding sid address %s is not IPv6 address: %v", policy.GetBsid(), err) // calls from descriptor are already validated - } - sids, err := h.convertPolicySegment(segmentList) - if err != nil { - return err - } - - // Note: Weight in sr.SrPolicyMod is leftover from API changes that moved weight into sr.Srv6SidList (it is weight of sid list not of the whole policy) - req := &sr.SrPolicyMod{ - BsidAddr: []byte(bindingSid), // TODO add ability to define policy also by index (SrPolicyIndex) - Operation: operation, - Sids: *sids, - FibTable: policy.InstallationVrfId, - } - if operation == DeleteSRList || operation == ModifyWeightOfSRList { - req.SlIndex = segmentListIndex - } - - reply := &sr.SrPolicyModReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - if reply.Retval != 0 { - return fmt.Errorf("vpp call %q returned: %d", reply.GetMessageName(), reply.Retval) - } - return nil -} - -func (h *SRv6VppHandler) convertPolicySegment(segmentList *srv6.Policy_SegmentList) (*sr.Srv6SidList, error) { - var segments []sr.Srv6Sid - for _, sid := range segmentList.Segments { - // parse to IPv6 address - parserSid, err := parseIPv6(sid) - if err != nil { - return nil, err - } - - // add sid to segment list - ipv6Segment := sr.Srv6Sid{ - Addr: make([]byte, 16), // sr.Srv6Sid.Addr = [16]byte - } - copy(ipv6Segment.Addr, parserSid) - segments = append(segments, ipv6Segment) - } - return &sr.Srv6SidList{ - NumSids: uint8(len(segments)), - Sids: segments, - Weight: segmentList.Weight, - }, nil -} - -// RetrievePolicyIndexInfo retrieves index of policy and its segment lists -func (h *SRv6VppHandler) RetrievePolicyIndexInfo(policy *srv6.Policy) (policyIndex uint32, segmentListIndexes map[*srv6.Policy_SegmentList]uint32, err error) { - // dump sr policies using VPP CLI - data, err := h.RunCli("sh sr policies") - if err != nil { - return ^uint32(0), nil, fmt.Errorf("can't dump index data from VPP: %v", err) - } - - // do necessary parsing to extract index of segment list - dumpStr := strings.ToLower(string(data)) - segmentListIndexes = make(map[*srv6.Policy_SegmentList]uint32) - - for _, policyStr := range strings.Split(dumpStr, "-----------") { - policyHeader := regexp.MustCompile(fmt.Sprintf("\\[(\\d+)\\]\\.-\\s+bsid:\\s*%s", strings.ToLower(strings.TrimSpace(policy.GetBsid())))) - if policyMatch := policyHeader.FindStringSubmatch(policyStr); policyMatch != nil { - parsed, err := strconv.ParseUint(policyMatch[1], 10, 32) - if err != nil { - return ^uint32(0), nil, fmt.Errorf("can't parse policy index %q (dump: %s)", policyMatch[1], dumpStr) - } - policyIndex = uint32(parsed) - - for _, sl := range policy.SegmentLists { - slRE := regexp.MustCompile(fmt.Sprintf("\\[(\\d+)\\].- < %s,[^:>]*> weight: %d", strings.ToLower(strings.Join(sl.Segments, ", ")), sl.Weight)) - if slMatch := slRE.FindStringSubmatch(policyStr); slMatch != nil { - parsed, err := strconv.ParseUint(slMatch[1], 10, 32) - if err != nil { - return ^uint32(0), nil, fmt.Errorf("can't parse segment policy index %q (dump: %s)", slMatch[1], dumpStr) - } - segmentListIndexes[sl] = uint32(parsed) - continue - } - return ^uint32(0), nil, fmt.Errorf("can't find index for segment list %+v (policy bsid %v) in dump %q", sl, policy.GetBsid(), dumpStr) - } - return policyIndex, segmentListIndexes, nil - } - } - return ^uint32(0), nil, fmt.Errorf("can't find index for policy with bsid %v in dump %q", policy.GetBsid(), dumpStr) -} - -// AddSteering sets in VPP steering into SRv6 policy. -func (h *SRv6VppHandler) AddSteering(steering *srv6.Steering) error { - return h.addDelSteering(false, steering) -} - -// RemoveSteering removes in VPP steering into SRv6 policy. -func (h *SRv6VppHandler) RemoveSteering(steering *srv6.Steering) error { - return h.addDelSteering(true, steering) -} - -func (h *SRv6VppHandler) addDelSteering(delete bool, steering *srv6.Steering) error { - // defining operation strings for logging - operationProgressing, operationFinished := "Adding", "Added" - if delete { - operationProgressing, operationFinished = "Removing", "Removed" - } - - // logging info about operation with steering - switch t := steering.Traffic.(type) { - case *srv6.Steering_L3Traffic_: - h.log.Debugf("%v steering for l3 traffic with destination %v to SR policy (binding SID %v, policy index %v)", - operationProgressing, t.L3Traffic.PrefixAddress, steering.GetPolicyBsid(), steering.GetPolicyIndex()) - case *srv6.Steering_L2Traffic_: - h.log.Debugf("%v steering for l2 traffic from interface %v to SR policy (binding SID %v, policy index %v)", - operationProgressing, t.L2Traffic.InterfaceName, steering.GetPolicyBsid(), steering.GetPolicyIndex()) - } - - // converting policy reference - var policyBSIDAddr []byte // undefined reference - var policyIndex = uint32(0) // undefined reference - switch ref := steering.PolicyRef.(type) { - case *srv6.Steering_PolicyBsid: - bsid, err := parseIPv6(ref.PolicyBsid) - if err != nil { - return fmt.Errorf("can't parse binding SID %q to IP address: %v ", ref.PolicyBsid, err) - } - policyBSIDAddr = []byte(bsid) - case *srv6.Steering_PolicyIndex: - policyIndex = ref.PolicyIndex - case nil: - return fmt.Errorf("policy reference must be provided") - default: - return fmt.Errorf("unknown policy reference type (link type %+v)", ref) - } - - // converting target traffic info - var prefixAddr []byte - steerType := SteerTypeIPv6 - tableID := uint32(0) - maskWidth := uint32(0) - intIndex := uint32(0) - switch t := steering.Traffic.(type) { - case *srv6.Steering_L3Traffic_: - ip, ipnet, err := net.ParseCIDR(t.L3Traffic.PrefixAddress) - if err != nil { - return fmt.Errorf("can't parse ip prefix %q: %v", t.L3Traffic.PrefixAddress, err) - } - if ip.To4() != nil { // IPv4 address - steerType = SteerTypeIPv4 - } - tableID = t.L3Traffic.InstallationVrfId - prefixAddr = []byte(ip.To16()) - ms, _ := ipnet.Mask.Size() - maskWidth = uint32(ms) - case *srv6.Steering_L2Traffic_: - steerType = SteerTypeL2 - ifMeta, exists := h.ifIndexes.LookupByName(t.L2Traffic.InterfaceName) - if !exists { - return fmt.Errorf("for interface %v doesn't exist sw index", t.L2Traffic.InterfaceName) - } - intIndex = ifMeta.SwIfIndex - case nil: - return fmt.Errorf("traffic type must be provided") - default: - return fmt.Errorf("unknown traffic type (link type %+v)", t) - } - req := &sr.SrSteeringAddDel{ - IsDel: boolToUint(delete), - TableID: tableID, - BsidAddr: policyBSIDAddr, // policy (to which we want to steer routing into) identified by policy binding sid (alternativelly it can be used policy index) - SrPolicyIndex: policyIndex, // policy (to which we want to steer routing into) identified by policy index (alternativelly it can be used policy binding sid) - TrafficType: steerType, // type of traffic to steer - PrefixAddr: prefixAddr, // destination prefix address (L3 traffic type only) - MaskWidth: maskWidth, // destination ip prefix mask (L3 traffic type only) - SwIfIndex: intIndex, // incoming interface (L2 traffic type only) - } - reply := &sr.SrSteeringAddDelReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - if reply.Retval != 0 { - return fmt.Errorf("vpp call %q returned: %d", reply.GetMessageName(), reply.Retval) - } - - h.log.WithFields(logging.Fields{"steer type": steerType, "L3 prefix address bytes": prefixAddr, - "L2 interface index": intIndex, "policy binding SID": policyBSIDAddr, "policy index": policyIndex}). - Debugf("%v steering to SR policy ", operationFinished) - - return nil -} - -func boolToUint(input bool) uint8 { - if input { - return uint8(1) - } - return uint8(0) -} - -// parseIPv6 parses string to IPv6 address (including IPv4 address converted to IPv6 address) -func parseIPv6(str string) (net.IP, error) { - ip := net.ParseIP(str) - if ip == nil { - return nil, fmt.Errorf(" %q is not ip address", str) - } - ipv6 := ip.To16() - if ipv6 == nil { - return nil, fmt.Errorf(" %q is not ipv6 address", str) - } - return ipv6, nil -} - -// guessInterfaceType attempts to guess the correct interface type from its internal name (as given by VPP). -// This is required mainly for those interface types, that do not provide dump binary API, -// such as loopback of af_packet. -func guessInterfaceType(ifName string) nbint.Interface_Type { - switch { - case strings.HasPrefix(ifName, "loop"), - strings.HasPrefix(ifName, "local"): - return nbint.Interface_SOFTWARE_LOOPBACK - case strings.HasPrefix(ifName, "memif"): - return nbint.Interface_MEMIF - case strings.HasPrefix(ifName, "tap"): - return nbint.Interface_TAP - case strings.HasPrefix(ifName, "host"): - return nbint.Interface_AF_PACKET - case strings.HasPrefix(ifName, "vxlan"): - return nbint.Interface_VXLAN_TUNNEL - case strings.HasPrefix(ifName, "ipsec"): - return nbint.Interface_IPSEC_TUNNEL - case strings.HasPrefix(ifName, "vmxnet3"): - return nbint.Interface_VMXNET3_INTERFACE - default: - return nbint.Interface_DPDK - } -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/srplugin/vppcalls/vpp1810/vppcalls_handlers.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/srplugin/vppcalls/vpp1810/vppcalls_handlers.go deleted file mode 100644 index b54451a327..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/srplugin/vppcalls/vpp1810/vppcalls_handlers.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2019 Bell Canada, Pantheon Technologies and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - govppapi "git.fd.io/govpp.git/api" - "github.com/ligato/cn-infra/logging" - vpe_vppcalls "github.com/ligato/vpp-agent/plugins/govppmux/vppcalls" - vpe_vpp1810 "github.com/ligato/vpp-agent/plugins/govppmux/vppcalls/vpp1810" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/sr" - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/vpe" - "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifaceidx" - "github.com/ligato/vpp-agent/plugins/vpp/srplugin/vppcalls" -) - -func init() { - var msgs []govppapi.Message - msgs = append(msgs, sr.Messages...) - msgs = append(msgs, vpe.Messages...) // using also vpe -> need to have correct vpp version also for vpe - - vppcalls.Versions["vpp1810"] = vppcalls.HandlerVersion{ - Msgs: msgs, - New: func(ch govppapi.Channel, ifIndexes ifaceidx.IfaceMetadataIndex, log logging.Logger) vppcalls.SRv6VppAPI { - return NewSRv6VppHandler(ch, ifIndexes, log) - }, - } -} - -// SRv6VppHandler is accessor for SRv6-related vppcalls methods -type SRv6VppHandler struct { - vpe_vppcalls.VpeVppAPI - - log logging.Logger - ifIndexes ifaceidx.IfaceMetadataIndex - callsChannel govppapi.Channel -} - -// NewSRv6VppHandler creates new instance of SRv6 vppcalls handler -func NewSRv6VppHandler(vppChan govppapi.Channel, ifIndexes ifaceidx.IfaceMetadataIndex, log logging.Logger) *SRv6VppHandler { - return &SRv6VppHandler{ - callsChannel: vppChan, - ifIndexes: ifIndexes, - log: log, - VpeVppAPI: vpe_vpp1810.NewVpeHandler(vppChan), - } -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/stnplugin/stnplugin.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/stnplugin/stnplugin.go index 3f0cabe07c..52524d6a57 100644 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/stnplugin/stnplugin.go +++ b/vendor/github.com/ligato/vpp-agent/plugins/vpp/stnplugin/stnplugin.go @@ -29,7 +29,6 @@ import ( "github.com/ligato/vpp-agent/plugins/vpp/stnplugin/descriptor/adapter" "github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls" - _ "github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls/vpp1810" _ "github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls/vpp1901" _ "github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls/vpp1904" ) diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls/vpp1810/dump_stn_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls/vpp1810/dump_stn_vppcalls.go deleted file mode 100644 index 80ecf44a6e..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls/vpp1810/dump_stn_vppcalls.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "net" - - "github.com/pkg/errors" - - stn "github.com/ligato/vpp-agent/api/models/vpp/stn" - api "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/stn" - "github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls" -) - -// DumpSTNRules implements STN handler, it returns all STN rules present on the VPP -func (h *StnVppHandler) DumpSTNRules() ([]*vppcalls.StnDetails, error) { - var stnDetails []*vppcalls.StnDetails - - req := &api.StnRulesDump{} - reqCtx := h.callsChannel.SendMultiRequest(req) - for { - msg := &api.StnRulesDetails{} - stop, err := reqCtx.ReceiveReply(msg) - if stop { - break - } - if err != nil { - return nil, errors.Errorf("error reading STN rules from the VPP: %v", err) - } - ifName, _, found := h.ifIndexes.LookupBySwIfIndex(msg.SwIfIndex) - if !found { - h.log.Warnf("STN dump: interface name not found for index %d", msg.SwIfIndex) - } - - var stnIP string - if uintToBool(msg.IsIP4) { - stnIP = net.IP(msg.IPAddress[:4]).To4().String() - } else { - stnIP = net.IP(msg.IPAddress).To16().String() - } - - stnRule := &stn.Rule{ - IpAddress: stnIP, - Interface: ifName, - } - stnMeta := &vppcalls.StnMeta{ - IfIdx: msg.SwIfIndex, - } - - stnDetails = append(stnDetails, &vppcalls.StnDetails{ - Rule: stnRule, - Meta: stnMeta, - }) - } - - return stnDetails, nil -} - -func uintToBool(value uint8) bool { - if value == 0 { - return false - } - return true -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls/vpp1810/stn_vppcalls.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls/vpp1810/stn_vppcalls.go deleted file mode 100644 index e93c929f57..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls/vpp1810/stn_vppcalls.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - "net" - "strings" - - "github.com/pkg/errors" - - stn "github.com/ligato/vpp-agent/api/models/vpp/stn" - api "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/stn" -) - -// AddSTNRule implements STN handler, adds a new STN rule to the VPP. -func (h *StnVppHandler) AddSTNRule(stnRule *stn.Rule) error { - return h.addDelStnRule(stnRule, true) -} - -// DeleteSTNRule implements STN handler, removes the provided STN rule from the VPP. -func (h *StnVppHandler) DeleteSTNRule(stnRule *stn.Rule) error { - return h.addDelStnRule(stnRule, false) -} - -func (h *StnVppHandler) addDelStnRule(stnRule *stn.Rule, isAdd bool) error { - // get interface index - ifaceMeta, found := h.ifIndexes.LookupByName(stnRule.Interface) - if !found { - return errors.New("failed to get interface metadata") - } - swIfIndex := ifaceMeta.GetIndex() - - // remove mask from IP address if necessary - ipAddr := stnRule.IpAddress - ipParts := strings.Split(ipAddr, "/") - if len(ipParts) > 1 { - h.log.Debugf("STN IP address %s is defined with mask, removing it") - ipAddr = ipParts[0] - } - - // parse IP address - var byteIP []byte - var isIPv4 uint8 - ip := net.ParseIP(ipAddr) - if ip == nil { - return errors.Errorf("failed to parse IP address %s", ipAddr) - } else if ip.To4() == nil { - byteIP = []byte(ip.To16()) - isIPv4 = 0 - } else { - byteIP = []byte(ip.To4()) - isIPv4 = 1 - } - - // add STN rule - req := &api.StnAddDelRule{ - IsIP4: isIPv4, - IPAddress: byteIP, - SwIfIndex: swIfIndex, - IsAdd: boolToUint(isAdd), - } - reply := &api.StnAddDelRuleReply{} - - if err := h.callsChannel.SendRequest(req).ReceiveReply(reply); err != nil { - return err - } - - return nil - -} - -func boolToUint(input bool) uint8 { - if input { - return 1 - } - return 0 -} diff --git a/vendor/github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls/vpp1810/vppcalls_handler.go b/vendor/github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls/vpp1810/vppcalls_handler.go deleted file mode 100644 index 046a5ceb8d..0000000000 --- a/vendor/github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls/vpp1810/vppcalls_handler.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2019 Cisco and/or its affiliates. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package vpp1810 - -import ( - govppapi "git.fd.io/govpp.git/api" - "github.com/ligato/cn-infra/logging" - - "github.com/ligato/vpp-agent/plugins/vpp/binapi/vpp1810/stn" - "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/ifaceidx" - "github.com/ligato/vpp-agent/plugins/vpp/stnplugin/vppcalls" -) - -func init() { - var msgs []govppapi.Message - msgs = append(msgs, stn.Messages...) - - vppcalls.Versions["vpp1810"] = vppcalls.HandlerVersion{ - Msgs: msgs, - New: func(ch govppapi.Channel, ifIdx ifaceidx.IfaceMetadataIndex, log logging.Logger) vppcalls.StnVppAPI { - return &StnVppHandler{ch, ifIdx, log} - }, - } -} - -// StnVppHandler is accessor for STN-related vppcalls methods -type StnVppHandler struct { - callsChannel govppapi.Channel - ifIndexes ifaceidx.IfaceMetadataIndex - log logging.Logger -}