Line data Source code
1 : /* 2 : * Copyright (c) 2023 Cisco and/or its affiliates. 3 : * Licensed under the Apache License, Version 2.0 (the "License"); 4 : * you may not use this file except in compliance with the License. 5 : * You may obtain a copy of the License at: 6 : * 7 : * http://www.apache.org/licenses/LICENSE-2.0 8 : * 9 : * Unless required by applicable law or agreed to in writing, software 10 : * distributed under the License is distributed on an "AS IS" BASIS, 11 : * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 : * See the License for the specific language governing permissions and 13 : * limitations under the License. 14 : */ 15 : 16 : #include <vlib/vlib.h> 17 : #include <tracenode/tracenode.h> 18 : #include <vlibmemory/api.h> 19 : 20 : /* define message IDs */ 21 : #include <tracenode/tracenode.api_enum.h> 22 : #include <tracenode/tracenode.api_types.h> 23 : 24 : #define REPLY_MSG_ID_BASE (tnm->msg_id_base) 25 : #include <vlibapi/api_helper_macros.h> 26 : 27 : static void 28 2 : vl_api_tracenode_enable_disable_t_handler ( 29 : vl_api_tracenode_enable_disable_t *mp) 30 : { 31 2 : tracenode_main_t *tnm = &tracenode_main; 32 : vl_api_tracenode_enable_disable_reply_t *rmp; 33 2 : int rv = 0; 34 : 35 2 : VALIDATE_SW_IF_INDEX (mp); 36 : 37 2 : rv = tracenode_feature_enable_disable (ntohl (mp->sw_if_index), mp->is_pcap, 38 2 : mp->enable); 39 : 40 2 : BAD_SW_IF_INDEX_LABEL; 41 : 42 2 : REPLY_MACRO (VL_API_TRACENODE_ENABLE_DISABLE_REPLY); 43 : } 44 : 45 : #include <tracenode/tracenode.api.c> 46 : 47 : clib_error_t * 48 575 : tracenode_plugin_api_hookup (vlib_main_t *vm) 49 : { 50 575 : tracenode_main_t *tnm = &tracenode_main; 51 : 52 : /* ask for a correctly-sized block of API message decode slots */ 53 575 : tnm->msg_id_base = setup_message_id_table (); 54 : 55 575 : return 0; 56 : } 57 : 58 : /* 59 : * fd.io coding-style-patch-verification: ON 60 : * 61 : * Local Variables: 62 : * eval: (c-set-style "gnu") 63 : * End: 64 : */