2 *------------------------------------------------------------------
3 * gso_api.c - Generic Segmentation Offload api
5 * Copyright (c) 2019 Cisco and/or its affiliates.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at:
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *------------------------------------------------------------------
20 #include <vnet/vnet.h>
21 #include <vlibmemory/api.h>
22 #include <vnet/gso/gso.h>
24 #include <vnet/format_fns.h>
25 #include <vnet/gso/gso.api_enum.h>
26 #include <vnet/gso/gso.api_types.h>
28 #define REPLY_MSG_ID_BASE gso_main.msg_id_base
29 #include <vlibapi/api_helper_macros.h>
32 vl_api_feature_gso_enable_disable_t_handler
33 (vl_api_feature_gso_enable_disable_t * mp)
35 vl_api_feature_gso_enable_disable_reply_t *rmp;
38 VALIDATE_SW_IF_INDEX (mp);
41 vnet_sw_interface_gso_enable_disable (ntohl (mp->sw_if_index),
44 BAD_SW_IF_INDEX_LABEL;
46 REPLY_MACRO (VL_API_FEATURE_GSO_ENABLE_DISABLE_REPLY);
49 #include <vnet/gso/gso.api.c>
52 feature_gso_api_hookup (vlib_main_t * vm)
55 * Set up the (msg_name, crc, message-id) table
57 gso_main.msg_id_base = setup_message_id_table ();
62 VLIB_API_INIT_FUNCTION (feature_gso_api_hookup);
65 * fd.io coding-style-patch-verification: ON
68 * eval: (c-set-style "gnu")