From aa479bb91d0c75b603e6c8828e6fffa0c70c5a0c Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Tue, 9 Mar 2021 16:34:57 -0500 Subject: misc: remove cop API support (part 1) API marked for deprecation last year due to non-inclusive language. Last supported release: 21.01. See the "adl" plugin. Type: improvement Signed-off-by: Dave Barach Change-Id: I931e58ced9cc8403ca5b23fd6b07e50d0ff7306b --- src/vnet/CMakeLists.txt | 10 --- src/vnet/cop/cop.api | 44 +---------- src/vnet/cop/cop_api.c | 193 ---------------------------------------------- src/vnet/vnet_all_api_h.h | 1 - 4 files changed, 1 insertion(+), 247 deletions(-) delete mode 100644 src/vnet/cop/cop_api.c (limited to 'src/vnet') diff --git a/src/vnet/CMakeLists.txt b/src/vnet/CMakeLists.txt index 38aeda5be93..eecb18c937b 100644 --- a/src/vnet/CMakeLists.txt +++ b/src/vnet/CMakeLists.txt @@ -110,16 +110,6 @@ list(APPEND VNET_API_FILES policer/policer_types.api ) -############################################################################## -# Binary API compatibility until vpp 20.12, see the ADL plugin... -############################################################################## - -list(APPEND VNET_SOURCES - cop/cop_api.c -) - -list(APPEND VNET_API_FILES cop/cop.api) - ############################################################################## # Layer 2 protocols go here ############################################################################## diff --git a/src/vnet/cop/cop.api b/src/vnet/cop/cop.api index f0916cb5844..bc213c2eb7b 100644 --- a/src/vnet/cop/cop.api +++ b/src/vnet/cop/cop.api @@ -13,49 +13,7 @@ * limitations under the License. */ -option version = "1.0.1"; - -import "vnet/interface_types.api"; - - /** \brief cop: enable/disable junk filtration features on an interface - @param client_index - opaque cookie to identify the sender - @param context - sender context, to match reply w/ request - @param sw_if_inded - desired interface - @param enable_disable - 1 => enable, 0 => disable -*/ - -autoreply define cop_interface_enable_disable -{ - option deprecated; - u32 client_index; - u32 context; - vl_api_interface_index_t sw_if_index; - bool enable_disable; -}; - -/** \brief cop: enable/disable whitelist filtration features on an interface - Note: the supplied fib_id must match in order to remove the feature! - - @param client_index - opaque cookie to identify the sender - @param context - sender context, to match reply w/ request - @param sw_if_index - interface handle, physical interfaces only - @param fib_id - fib identifier for the whitelist / blacklist fib - @param ip4 - 1 => enable ip4 filtration, 0=> disable ip4 filtration - @param ip6 - 1 => enable ip6 filtration, 0=> disable ip6 filtration - @param default_cop - 1 => enable non-ip4, non-ip6 filtration 0=> disable it -*/ - -autoreply define cop_whitelist_enable_disable -{ - option deprecated; - u32 client_index; - u32 context; - vl_api_interface_index_t sw_if_index; - u32 fib_id; - bool ip4; - bool ip6; - bool default_cop; -}; +option version = "0.0.1"; /* * Local Variables: diff --git a/src/vnet/cop/cop_api.c b/src/vnet/cop/cop_api.c deleted file mode 100644 index 6ebcebcbf86..00000000000 --- a/src/vnet/cop/cop_api.c +++ /dev/null @@ -1,193 +0,0 @@ -/* - *------------------------------------------------------------------ - * cop_api.c - cop api - * - * Copyright (c) 2016,2020 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. - *------------------------------------------------------------------ - */ - -#include -#include - -#include -#include - -#include - -#define vl_typedefs /* define message structures */ -#include -#undef vl_typedefs - -#define vl_endianfun /* define message structures */ -#include -#undef vl_endianfun - -/* instantiate all the print functions we know about */ -#define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) -#define vl_printfun -#include -#undef vl_printfun - -#include - -#define foreach_vpe_api_msg \ -_(COP_INTERFACE_ENABLE_DISABLE, cop_interface_enable_disable) \ -_(COP_WHITELIST_ENABLE_DISABLE, cop_whitelist_enable_disable) - -typedef struct -{ - u32 sw_if_index; - u8 ip4; - u8 ip6; - u8 default_cop; - u32 fib_id; -} cop_whitelist_enable_disable_args_t; - -/* - * This API will be deprecated in vpp 20.12. - * - * Continue to support it for the moment if the "adl" plugin - * is loaded... - */ -static int default_interface_enable_disable_callback - (u32 sw_if_index, int enable_disable) -{ - return VNET_API_ERROR_UNIMPLEMENTED; -} - -static int (*interface_enable_disable_callback) (u32, int) = - default_interface_enable_disable_callback; - -void -register_vl_api_cop_interface_enable_disable_callback (void *cb) -{ - interface_enable_disable_callback = cb; -} - -static void vl_api_cop_interface_enable_disable_t_handler - (vl_api_cop_interface_enable_disable_t * mp) -{ - vl_api_cop_interface_enable_disable_reply_t *rmp; - int rv; - u32 sw_if_index = ntohl (mp->sw_if_index); - int enable_disable; - - VALIDATE_SW_IF_INDEX (mp); - - enable_disable = (int) mp->enable_disable; - - rv = (*interface_enable_disable_callback) (sw_if_index, enable_disable); - - BAD_SW_IF_INDEX_LABEL; - - REPLY_MACRO (VL_API_COP_INTERFACE_ENABLE_DISABLE_REPLY); -} - -/* - * This API will be deprecated in vpp 20.12. - * - * Continue to support it for the moment if the "adl" plugin - * is loaded... - */ - -static int default_whitelist_enable_disable_callback - (cop_whitelist_enable_disable_args_t * a) -{ - return VNET_API_ERROR_UNIMPLEMENTED; -} - -static int (*whitelist_enable_disable_callback) - (cop_whitelist_enable_disable_args_t * a) = - default_whitelist_enable_disable_callback; - -void -register_vl_api_cop_whitelist_enable_disable_callback (void *cb) -{ - whitelist_enable_disable_callback = cb; -} - -static void vl_api_cop_whitelist_enable_disable_t_handler - (vl_api_cop_whitelist_enable_disable_t * mp) -{ - vl_api_cop_whitelist_enable_disable_reply_t *rmp; - cop_whitelist_enable_disable_args_t _a, *a = &_a; - u32 sw_if_index = ntohl (mp->sw_if_index); - int rv; - - VALIDATE_SW_IF_INDEX (mp); - - a->sw_if_index = sw_if_index; - a->ip4 = mp->ip4; - a->ip6 = mp->ip6; - a->default_cop = mp->default_cop; - a->fib_id = ntohl (mp->fib_id); - - rv = (*whitelist_enable_disable_callback) (a); - - BAD_SW_IF_INDEX_LABEL; - - REPLY_MACRO (VL_API_COP_WHITELIST_ENABLE_DISABLE_REPLY); -} - -/* - * cop_api_hookup - * Add vpe's API message handlers to the table. - * vlib has already mapped shared memory and - * added the client registration handlers. - * See .../vlib-api/vlibmemory/memclnt_vlib.c:memclnt_process() - */ -#define vl_msg_name_crc_list -#include -#undef vl_msg_name_crc_list - -static void -setup_message_id_table (api_main_t * am) -{ -#define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); - foreach_vl_msg_name_crc_cop; -#undef _ -} - -static clib_error_t * -cop_api_hookup (vlib_main_t * vm) -{ - api_main_t *am = vlibapi_get_main (); - -#define _(N,n) \ - vl_msg_api_set_handlers(VL_API_##N, #n, \ - vl_api_##n##_t_handler, \ - vl_noop_handler, \ - vl_api_##n##_t_endian, \ - vl_api_##n##_t_print, \ - sizeof(vl_api_##n##_t), 1); - foreach_vpe_api_msg; -#undef _ - - /* - * Set up the (msg_name, crc, message-id) table - */ - setup_message_id_table (am); - - return 0; -} - -VLIB_API_INIT_FUNCTION (cop_api_hookup); - -/* - * fd.io coding-style-patch-verification: ON - * - * Local Variables: - * eval: (c-set-style "gnu") - * End: - */ diff --git a/src/vnet/vnet_all_api_h.h b/src/vnet/vnet_all_api_h.h index 2a5b6bd557e..364bbecabcc 100644 --- a/src/vnet/vnet_all_api_h.h +++ b/src/vnet/vnet_all_api_h.h @@ -51,7 +51,6 @@ #include #include #include -#include #include #include #include -- cgit 1.2.3-korg